Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public DatabaseSecurityAlertPolicy()
/// <param name="disabledAlerts">Specifies the semicolon-separated list
/// of alerts that are disabled, or empty string to disable no alerts.
/// Possible values: Sql_Injection; Sql_Injection_Vulnerability;
/// Access_Anomaly; Usage_Anomaly.</param>
/// Access_Anomaly; Data_Exfiltration; Unsafe_Action.</param>
/// <param name="emailAddresses">Specifies the semicolon-separated list
/// of e-mail addresses to which the alert is sent.</param>
/// <param name="emailAccountAdmins">Specifies that the alert is sent
Expand Down Expand Up @@ -109,7 +109,7 @@ public DatabaseSecurityAlertPolicy()
/// Gets or sets specifies the semicolon-separated list of alerts that
/// are disabled, or empty string to disable no alerts. Possible
/// values: Sql_Injection; Sql_Injection_Vulnerability; Access_Anomaly;
/// Usage_Anomaly.
/// Data_Exfiltration; Unsafe_Action.
/// </summary>
[JsonProperty(PropertyName = "properties.disabledAlerts")]
public string DisabledAlerts { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,13 @@ public ManagedInstance()
/// <param name="vCores">The number of VCores.</param>
/// <param name="storageSizeInGB">The maximum storage size in
/// GB.</param>
public ManagedInstance(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary<string, string> tags = default(IDictionary<string, string>), ResourceIdentity identity = default(ResourceIdentity), Sku sku = default(Sku), string fullyQualifiedDomainName = default(string), string administratorLogin = default(string), string administratorLoginPassword = default(string), string subnetId = default(string), string state = default(string), string licenseType = default(string), int? vCores = default(int?), int? storageSizeInGB = default(int?))
/// <param name="collation">Collation of the managed instance.</param>
/// <param name="dnsZone">The Dns Zone that the managed instance is
/// in.</param>
/// <param name="dnsZonePartner">The resource id of another managed
/// instance whose DNS zone this managed instance will share after
/// creation.</param>
public ManagedInstance(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary<string, string> tags = default(IDictionary<string, string>), ResourceIdentity identity = default(ResourceIdentity), Sku sku = default(Sku), string fullyQualifiedDomainName = default(string), string administratorLogin = default(string), string administratorLoginPassword = default(string), string subnetId = default(string), string state = default(string), string licenseType = default(string), int? vCores = default(int?), int? storageSizeInGB = default(int?), string collation = default(string), string dnsZone = default(string), string dnsZonePartner = default(string))
: base(location, id, name, type, tags)
{
Identity = identity;
Expand All @@ -70,6 +76,9 @@ public ManagedInstance()
LicenseType = licenseType;
VCores = vCores;
StorageSizeInGB = storageSizeInGB;
Collation = collation;
DnsZone = dnsZone;
DnsZonePartner = dnsZonePartner;
CustomInit();
}

Expand Down Expand Up @@ -143,6 +152,25 @@ public ManagedInstance()
[JsonProperty(PropertyName = "properties.storageSizeInGB")]
public int? StorageSizeInGB { get; set; }

/// <summary>
/// Gets collation of the managed instance.
/// </summary>
[JsonProperty(PropertyName = "properties.collation")]
public string Collation { get; private set; }

/// <summary>
/// Gets the Dns Zone that the managed instance is in.
/// </summary>
[JsonProperty(PropertyName = "properties.dnsZone")]
public string DnsZone { get; private set; }

/// <summary>
/// Gets or sets the resource id of another managed instance whose DNS
/// zone this managed instance will share after creation.
/// </summary>
[JsonProperty(PropertyName = "properties.dnsZonePartner")]
public string DnsZonePartner { get; set; }

/// <summary>
/// Validate the object.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,14 @@ public ManagedInstanceUpdate()
/// <param name="vCores">The number of VCores.</param>
/// <param name="storageSizeInGB">The maximum storage size in
/// GB.</param>
/// <param name="collation">Collation of the managed instance.</param>
/// <param name="dnsZone">The Dns Zone that the managed instance is
/// in.</param>
/// <param name="dnsZonePartner">The resource id of another managed
/// instance whose DNS zone this managed instance will share after
/// creation.</param>
/// <param name="tags">Resource tags.</param>
public ManagedInstanceUpdate(Sku sku = default(Sku), string fullyQualifiedDomainName = default(string), string administratorLogin = default(string), string administratorLoginPassword = default(string), string subnetId = default(string), string state = default(string), string licenseType = default(string), int? vCores = default(int?), int? storageSizeInGB = default(int?), IDictionary<string, string> tags = default(IDictionary<string, string>))
public ManagedInstanceUpdate(Sku sku = default(Sku), string fullyQualifiedDomainName = default(string), string administratorLogin = default(string), string administratorLoginPassword = default(string), string subnetId = default(string), string state = default(string), string licenseType = default(string), int? vCores = default(int?), int? storageSizeInGB = default(int?), string collation = default(string), string dnsZone = default(string), string dnsZonePartner = default(string), IDictionary<string, string> tags = default(IDictionary<string, string>))
{
Sku = sku;
FullyQualifiedDomainName = fullyQualifiedDomainName;
Expand All @@ -62,6 +68,9 @@ public ManagedInstanceUpdate()
LicenseType = licenseType;
VCores = vCores;
StorageSizeInGB = storageSizeInGB;
Collation = collation;
DnsZone = dnsZone;
DnsZonePartner = dnsZonePartner;
Tags = tags;
CustomInit();
}
Expand Down Expand Up @@ -129,6 +138,25 @@ public ManagedInstanceUpdate()
[JsonProperty(PropertyName = "properties.storageSizeInGB")]
public int? StorageSizeInGB { get; set; }

/// <summary>
/// Gets collation of the managed instance.
/// </summary>
[JsonProperty(PropertyName = "properties.collation")]
public string Collation { get; private set; }

/// <summary>
/// Gets the Dns Zone that the managed instance is in.
/// </summary>
[JsonProperty(PropertyName = "properties.dnsZone")]
public string DnsZone { get; private set; }

/// <summary>
/// Gets or sets the resource id of another managed instance whose DNS
/// zone this managed instance will share after creation.
/// </summary>
[JsonProperty(PropertyName = "properties.dnsZonePartner")]
public string DnsZonePartner { get; set; }

/// <summary>
/// Gets or sets resource tags.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public ServerSecurityAlertPolicy()
/// <param name="type">Resource type.</param>
/// <param name="disabledAlerts">Specifies an array of alerts that are
/// disabled. Allowed values are: Sql_Injection,
/// Sql_Injection_Vulnerability, Access_Anomaly</param>
/// Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration,
/// Unsafe_Action</param>
/// <param name="emailAddresses">Specifies an array of e-mail addresses
/// to which the alert is sent.</param>
/// <param name="emailAccountAdmins">Specifies that the alert is sent
Expand Down Expand Up @@ -83,7 +84,7 @@ public ServerSecurityAlertPolicy()
/// <summary>
/// Gets or sets specifies an array of alerts that are disabled.
/// Allowed values are: Sql_Injection, Sql_Injection_Vulnerability,
/// Access_Anomaly
/// Access_Anomaly, Data_Exfiltration, Unsafe_Action
/// </summary>
[JsonProperty(PropertyName = "properties.disabledAlerts")]
public IList<string> DisabledAlerts { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ public static IEnumerable<Tuple<string, string, string>> ApiInfo_SqlManagementCl
// BEGIN: Code Generation Metadata Section
public static readonly String AutoRestVersion = "latest";
public static readonly String AutoRestBootStrapperVersion = "[email protected]";
public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/sql/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=D:\\WS\\Azure\\netSdk\\src\\SDKs";
public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/sql/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=E:\\Github2\\azure-sdk-for-net\\src\\SDKs";
public static readonly String GithubForkName = "Azure";
public static readonly String GithubBranchName = "master";
public static readonly String GithubCommidId = "65f87146d9513e2eb53ecd29e12e9898c98776ab";
public static readonly String GithubCommidId = "1e9294304b3354f11caf980707ddad629e5ab56e";
public static readonly String CodeGenerationErrors = "";
public static readonly String GithubRepoName = "azure-rest-api-specs";
// END: Code Generation Metadata Section
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,19 @@ public partial class SqlManagementClient : ServiceClient<SqlManagementClient>, I
/// </summary>
public virtual IManagedInstanceEncryptionProtectorsOperations ManagedInstanceEncryptionProtectors { get; private set; }

/// <summary>
/// Initializes a new instance of the SqlManagementClient class.
/// </summary>
/// <param name='httpClient'>
/// HttpClient to be used
/// </param>
/// <param name='disposeHttpClient'>
/// True: will dispose the provided httpClient on calling SqlManagementClient.Dispose(). False: will not dispose provided httpClient</param>
protected SqlManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient)
{
Initialize();
}

/// <summary>
/// Initializes a new instance of the SqlManagementClient class.
/// </summary>
Expand Down Expand Up @@ -497,6 +510,33 @@ public SqlManagementClient(ServiceClientCredentials credentials, params Delegati
}
}

/// <summary>
/// Initializes a new instance of the SqlManagementClient class.
/// </summary>
/// <param name='credentials'>
/// Required. Credentials needed for the client to connect to Azure.
/// </param>
/// <param name='httpClient'>
/// HttpClient to be used
/// </param>
/// <param name='disposeHttpClient'>
/// True: will dispose the provided httpClient on calling SqlManagementClient.Dispose(). False: will not dispose provided httpClient</param>
/// <exception cref="System.ArgumentNullException">
/// Thrown when a required parameter is null
/// </exception>
public SqlManagementClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient)
{
if (credentials == null)
{
throw new System.ArgumentNullException("credentials");
}
Credentials = credentials;
if (Credentials != null)
{
Credentials.InitializeServiceClient(this);
}
}

/// <summary>
/// Initializes a new instance of the SqlManagementClient class.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
<PackageId>Microsoft.Azure.Management.Sql</PackageId>
<Description>Azure SQL Management SDK library</Description>
<AssemblyName>Microsoft.Azure.Management.Sql</AssemblyName>
<Version>1.20.0-preview</Version>
<Version>1.20.1-preview</Version>
<PackageTags>Microsoft Azure SQL Management;SQL;SQL Management;</PackageTags>
<PackageReleaseNotes>
<![CDATA[
New features:
- Added support for Managed Instance keys and encryption protectors.
- Added support for DatabaseVulnerabilityAssessment.StorageAccountAccessKey, which causes DatabaseVulnerabilityAssessment.StorageContainerSasKey to no longer be a required property.
- Added support for Managed Instance DnsZone, DnsZonePartner and Collation properties
]]>
</PackageReleaseNotes>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
[assembly: AssemblyTitle("Microsoft Azure SQL Management Library")]
[assembly: AssemblyDescription("Provides management functionality for Microsoft Azure SQL.")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.20.0.0")]
[assembly: AssemblyFileVersion("1.20.1.0")]

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void TestCreateUpdateGetDropManagedInstance()
ResourceGroup resourceGroup = context.CreateResourceGroup();
SqlManagementClient sqlClient = context.GetClient<SqlManagementClient>();

string managedInstanceName = "sqlcl-crudtests-dotnetsdk1";
string managedInstanceName = "sqlcl-crudtestswithdnszone-dotnetsdk1";
string login = "dummylogin";
string password = "Un53cuRE!";
Dictionary<string, string> tags = new Dictionary<string, string>()
Expand All @@ -33,8 +33,8 @@ public void TestCreateUpdateGetDropManagedInstance()
sku.Name = "MIGP8G4";
sku.Tier = "GeneralPurpose";

string subnetId = "/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/cloudlifter/providers/Microsoft.ClassicNetwork/virtualNetworks/cloud-lifter-stage-sea/subnets/default";
string location = "southeastasia";
string subnetId = "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/StdjordjTestResourceGroup/providers/Microsoft.Network/virtualNetworks/ZiwaVirtualNetwork4/subnets/default";
string location = "westcentralus";

//Create server
var managedInstance1 = sqlClient.ManagedInstances.CreateOrUpdate(resourceGroup.Name, managedInstanceName, new ManagedInstance()
Expand All @@ -49,7 +49,7 @@ public void TestCreateUpdateGetDropManagedInstance()
SqlManagementTestUtilities.ValidateManagedInstance(managedInstance1, managedInstanceName, login, tags, TestEnvironmentUtilities.DefaultLocationId);

// Create second server
string managedInstanceName2 = "sqlcl-crudtests-dotnetsdk2";
string managedInstanceName2 = "sqlcl-crudtestswithdnszone-dotnetsdk2";
var managedInstance2 = sqlClient.ManagedInstances.CreateOrUpdate(resourceGroup.Name, managedInstanceName2, new ManagedInstance()
{
AdministratorLogin = login,
Expand All @@ -58,6 +58,7 @@ public void TestCreateUpdateGetDropManagedInstance()
SubnetId = subnetId,
Tags = tags,
Location = location,
DnsZonePartner = string.Format("/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/{0}/providers/Microsoft.Sql/managedInstances/sqlcl-crudtestswithdnszone-dotnetsdk1", resourceGroup.Name)
});
SqlManagementTestUtilities.ValidateManagedInstance(managedInstance2, managedInstanceName2, login, tags, TestEnvironmentUtilities.DefaultLocationId);

Expand All @@ -69,6 +70,9 @@ public void TestCreateUpdateGetDropManagedInstance()
var getMI2 = sqlClient.ManagedInstances.Get(resourceGroup.Name, managedInstanceName2);
SqlManagementTestUtilities.ValidateManagedInstance(getMI2, managedInstanceName2, login, tags, TestEnvironmentUtilities.DefaultLocationId);

// Verify that dns zone value is correctly inherited from dns zone partner
Assert.Equal(getMI1.DnsZone, getMI2.DnsZone);

var listMI = sqlClient.ManagedInstances.ListByResourceGroup(resourceGroup.Name);
Assert.Equal(2, listMI.Count());

Expand All @@ -81,12 +85,12 @@ public void TestCreateUpdateGetDropManagedInstance()
SqlManagementTestUtilities.ValidateManagedInstance(updateMI1, managedInstanceName, login, newTags, TestEnvironmentUtilities.DefaultLocationId);

// Drop server, update count
sqlClient.ManagedInstances.Delete(resourceGroup.Name, managedInstanceName);
sqlClient.ManagedInstances.DeleteAsync(resourceGroup.Name, managedInstanceName);

var listMI2 = sqlClient.ManagedInstances.ListByResourceGroup(resourceGroup.Name);
Assert.Equal(1, listMI2.Count());

sqlClient.ManagedInstances.Delete(resourceGroup.Name, managedInstanceName2);
sqlClient.ManagedInstances.DeleteAsync(resourceGroup.Name, managedInstanceName2);
var listMI3 = sqlClient.ManagedInstances.ListByResourceGroup(resourceGroup.Name);
Assert.Empty(listMI3);
}
Expand Down
Loading