diff --git a/src/ResourceManager/Common/Commands.ResourceManager.Common/Tags/TagsConversionHelper.cs b/src/ResourceManager/Common/Commands.ResourceManager.Common/Tags/TagsConversionHelper.cs index 9e4fbc4902c0..d1fa67c9efcd 100644 --- a/src/ResourceManager/Common/Commands.ResourceManager.Common/Tags/TagsConversionHelper.cs +++ b/src/ResourceManager/Common/Commands.ResourceManager.Common/Tags/TagsConversionHelper.cs @@ -16,6 +16,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; +using System.Management.Automation; using ProjectResources = Microsoft.Azure.Commands.ResourceManager.Common.Properties.Resources; namespace Microsoft.Azure.Commands.ResourceManager.Common.Tags @@ -93,5 +94,20 @@ public static Hashtable CreateTagHashtable(IDictionary dictionar } return tagsHashtable; } + + public static Dictionary ReadOrFetchTags(PSCmdlet cmdlet, Dictionary tagsFromModel) + { + object tagsFromCli; + if (cmdlet.MyInvocation.BoundParameters.TryGetValue("Tags", out tagsFromCli)) + { + Hashtable tags = tagsFromCli as Hashtable; + return TagsConversionHelper.CreateTagDictionary(tags, validate: true); + } + else + { + return tagsFromModel; + } + } + } } diff --git a/src/ResourceManager/Sql/ChangeLog.md b/src/ResourceManager/Sql/ChangeLog.md index 8b6f15b9ba7b..00967bed0728 100644 --- a/src/ResourceManager/Sql/ChangeLog.md +++ b/src/ResourceManager/Sql/ChangeLog.md @@ -23,5 +23,8 @@ - RetentionInDays * Removed the unsupported param "AuditAction" from Set-AzureSqlDatabaseServerAuditingPolicy * Added new param "AuditAction" to Set-AzureSqlDatabaseAuditingPolicy - +* Fix for showing on GET and persisting Tags on SET (if not given) for Database, Server and Elastic Pool + - If Tags is used in command it will save tags, if not it will not wipe out tags on resource. ## Version 2.3.0 +* Fix for showing on GET and persisting Tags on SET (if not given) for Database, Server and Elastic Pool + - If Tags is used in command it will save tags, if not it will not wipe out tags on resource. \ No newline at end of file diff --git a/src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/DatabaseCrudTests.ps1 b/src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/DatabaseCrudTests.ps1 index 1aff9b792212..ec3cfee53372 100644 --- a/src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/DatabaseCrudTests.ps1 +++ b/src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/DatabaseCrudTests.ps1 @@ -78,22 +78,28 @@ function Test-CreateDatabaseInternal ($serverVersion, $location = "Japan East") # Create with all parameters $databaseName = Get-DatabaseName $db = New-AzureRmSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $databaseName ` - -CollationName "Japanese_Bushu_Kakusu_100_CS_AS" -MaxSizeBytes 1GB -Edition Basic -RequestedServiceObjectiveName Basic + -CollationName "Japanese_Bushu_Kakusu_100_CS_AS" -MaxSizeBytes 1GB -Edition Basic -RequestedServiceObjectiveName Basic -Tags @{"tag_key"="tag_value"} Assert-AreEqual $db.DatabaseName $databaseName Assert-AreEqual $db.MaxSizeBytes 1GB Assert-AreEqual $db.Edition Basic Assert-AreEqual $db.CurrentServiceObjectiveName Basic Assert-AreEqual $db.CollationName "Japanese_Bushu_Kakusu_100_CS_AS" + Assert-NotNull $db.Tags + Assert-AreEqual True $db.Tags.ContainsKey("tag_key") + Assert-AreEqual "tag_value" $db.Tags["tag_key"] # Create with all parameters $databaseName = Get-DatabaseName $db = $server | New-AzureRmSqlDatabase -DatabaseName $databaseName ` - -CollationName "Japanese_Bushu_Kakusu_100_CS_AS" -MaxSizeBytes 1GB -Edition Basic -RequestedServiceObjectiveName Basic + -CollationName "Japanese_Bushu_Kakusu_100_CS_AS" -MaxSizeBytes 1GB -Edition Basic -RequestedServiceObjectiveName Basic -Tags @{"tag_key"="tag_value"} Assert-AreEqual $db.DatabaseName $databaseName Assert-AreEqual $db.MaxSizeBytes 1GB Assert-AreEqual $db.Edition Basic Assert-AreEqual $db.CurrentServiceObjectiveName Basic Assert-AreEqual $db.CollationName "Japanese_Bushu_Kakusu_100_CS_AS" + Assert-NotNull $db.Tags + Assert-AreEqual True $db.Tags.ContainsKey("tag_key") + Assert-AreEqual "tag_value" $db.Tags["tag_key"] } finally { @@ -142,20 +148,26 @@ function Test-UpdateDatabaseInternal ($serverVersion, $location = "Japan East") { # Alter all properties $db1 = Set-AzureRmSqlDatabase -ResourceGroupName $db.ResourceGroupName -ServerName $db.ServerName -DatabaseName $db.DatabaseName ` - -MaxSizeBytes 1GB -Edition Basic -RequestedServiceObjectiveName Basic + -MaxSizeBytes 1GB -Edition Basic -RequestedServiceObjectiveName Basic -Tags @{"tag_key"="tag_new_value"} Assert-AreEqual $db1.DatabaseName $db.DatabaseName Assert-AreEqual $db1.MaxSizeBytes 1GB Assert-AreEqual $db1.Edition Basic Assert-AreEqual $db1.CurrentServiceObjectiveName Basic Assert-AreEqual $db1.CollationName $db.CollationName + Assert-NotNull $db.Tags + Assert-AreEqual True $db.Tags.ContainsKey("tag_key") + Assert-AreEqual "tag_new_value" $db.Tags["tag_key"] # Alter all properties using piping - $db2 = $db1 | Set-AzureRmSqlDatabase -MaxSizeBytes 100GB -Edition Standard -RequestedServiceObjectiveName S1 + $db2 = $db1 | Set-AzureRmSqlDatabase -MaxSizeBytes 100GB -Edition Standard -RequestedServiceObjectiveName S1 -Tags @{"tag_key"="tag_new_value"} Assert-AreEqual $db2.DatabaseName $db.DatabaseName Assert-AreEqual $db2.MaxSizeBytes 100GB Assert-AreEqual $db2.Edition Standard Assert-AreEqual $db2.CurrentServiceObjectiveName S1 Assert-AreEqual $db2.CollationName $db.CollationName + Assert-NotNull $db.Tags + Assert-AreEqual True $db.Tags.ContainsKey("tag_key") + Assert-AreEqual "tag_new_value" $db.Tags["tag_key"] # Create and alter data warehouse database. $databaseName = Get-DatabaseName @@ -176,20 +188,26 @@ function Test-UpdateDatabaseInternal ($serverVersion, $location = "Japan East") { # Alter all properties $db1 = Set-AzureRmSqlDatabase -ResourceGroupName $db.ResourceGroupName -ServerName $db.ServerName -DatabaseName $db.DatabaseName ` - -MaxSizeBytes 1GB -Edition Basic -RequestedServiceObjectiveName Basic + -MaxSizeBytes 1GB -Edition Basic -RequestedServiceObjectiveName Basic -Tags @{"tag_key"="tag_new_value"} Assert-AreEqual $db1.DatabaseName $db.DatabaseName Assert-AreEqual $db1.MaxSizeBytes 250GB Assert-AreEqual $db1.Edition Standard Assert-AreEqual $db1.CurrentServiceObjectiveName S0 Assert-AreEqual $db1.CollationName $db.CollationName + Assert-NotNull $db.Tags + Assert-AreEqual True $db.Tags.ContainsKey("tag_key") + Assert-AreEqual "tag_new_value" $db.Tags["tag_key"] # Alter all properties using piping - $db2 = $db1 | Set-AzureRmSqlDatabase -MaxSizeBytes 100GB -Edition Standard -RequestedServiceObjectiveName S1 + $db2 = $db1 | Set-AzureRmSqlDatabase -MaxSizeBytes 100GB -Edition Standard -RequestedServiceObjectiveName S1 -Tags @{"tag_key"="tag_new_value"} Assert-AreEqual $db2.DatabaseName $db.DatabaseName Assert-AreEqual $db2.MaxSizeBytes 1GB Assert-AreEqual $db2.Edition Basic Assert-AreEqual $db2.CurrentServiceObjectiveName Basic Assert-AreEqual $db2.CollationName $db.CollationName + Assert-NotNull $db.Tags + Assert-AreEqual True $db.Tags.ContainsKey("tag_key") + Assert-AreEqual "tag_new_value" $db.Tags["tag_key"] } } finally diff --git a/src/ResourceManager/Sql/Commands.Sql.Test/SessionRecords/Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseCrudTests/TestDatabaseCreate.json b/src/ResourceManager/Sql/Commands.Sql.Test/SessionRecords/Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseCrudTests/TestDatabaseCreate.json index fad2480a1627..201e491af78c 100644 --- a/src/ResourceManager/Sql/Commands.Sql.Test/SessionRecords/Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseCrudTests/TestDatabaseCreate.json +++ b/src/ResourceManager/Sql/Commands.Sql.Test/SessionRecords/Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseCrudTests/TestDatabaseCreate.json @@ -313,7 +313,7 @@ "97c2e946-a12c-410e-b23d-7c8819c1887b" ] }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk7619/providers/Microsoft.Sql/servers/onesdk1857\",\r\n \"name\": \"onesdk1857\",\r\n \"type\": \"Microsoft.Sql/servers\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0\",\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"onesdk1857.sqltest-eg1.mscds.com\",\r\n \"administratorLogin\": \"testusername\",\r\n \"administratorLoginPassword\": null,\r\n \"externalAdministratorLogin\": null,\r\n \"externalAdministratorSid\": null,\r\n \"version\": \"12.0\",\r\n \"state\": \"Ready\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk7619/providers/Microsoft.Sql/servers/onesdk1857\",\r\n \"name\": \"onesdk1857\",\r\n \"type\": \"Microsoft.Sql/servers\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0\",\r\n \"tags\": {\"tag_key\":\"tag_value\"},\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"onesdk1857.sqltest-eg1.mscds.com\",\r\n \"administratorLogin\": \"testusername\",\r\n \"administratorLoginPassword\": null,\r\n \"externalAdministratorLogin\": null,\r\n \"externalAdministratorSid\": null,\r\n \"version\": \"12.0\",\r\n \"state\": \"Ready\"\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ "469" @@ -367,7 +367,7 @@ "f3d9d31f-cdea-4442-a547-7124c81e38b1" ] }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk7619/providers/Microsoft.Sql/servers/onesdk1857\",\r\n \"name\": \"onesdk1857\",\r\n \"type\": \"Microsoft.Sql/servers\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0\",\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"onesdk1857.sqltest-eg1.mscds.com\",\r\n \"administratorLogin\": \"testusername\",\r\n \"administratorLoginPassword\": null,\r\n \"externalAdministratorLogin\": null,\r\n \"externalAdministratorSid\": null,\r\n \"version\": \"12.0\",\r\n \"state\": \"Ready\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk7619/providers/Microsoft.Sql/servers/onesdk1857\",\r\n \"name\": \"onesdk1857\",\r\n \"type\": \"Microsoft.Sql/servers\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0\",\r\n \"tags\": {\"tag_key\":\"tag_value\"},\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"onesdk1857.sqltest-eg1.mscds.com\",\r\n \"administratorLogin\": \"testusername\",\r\n \"administratorLoginPassword\": null,\r\n \"externalAdministratorLogin\": null,\r\n \"externalAdministratorSid\": null,\r\n \"version\": \"12.0\",\r\n \"state\": \"Ready\"\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ "469" @@ -421,7 +421,7 @@ "bbd5cc50-764e-4b0b-b376-89bfc771c949" ] }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk7619/providers/Microsoft.Sql/servers/onesdk1857\",\r\n \"name\": \"onesdk1857\",\r\n \"type\": \"Microsoft.Sql/servers\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0\",\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"onesdk1857.sqltest-eg1.mscds.com\",\r\n \"administratorLogin\": \"testusername\",\r\n \"administratorLoginPassword\": null,\r\n \"externalAdministratorLogin\": null,\r\n \"externalAdministratorSid\": null,\r\n \"version\": \"12.0\",\r\n \"state\": \"Ready\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk7619/providers/Microsoft.Sql/servers/onesdk1857\",\r\n \"name\": \"onesdk1857\",\r\n \"type\": \"Microsoft.Sql/servers\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0\",\r\n \"tags\": {\"tag_key\":\"tag_value\"},\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"onesdk1857.sqltest-eg1.mscds.com\",\r\n \"administratorLogin\": \"testusername\",\r\n \"administratorLoginPassword\": null,\r\n \"externalAdministratorLogin\": null,\r\n \"externalAdministratorSid\": null,\r\n \"version\": \"12.0\",\r\n \"state\": \"Ready\"\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ "469" @@ -475,7 +475,7 @@ "51a915b3-d59e-40de-91bf-1022fe3fdca1" ] }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk7619/providers/Microsoft.Sql/servers/onesdk1857\",\r\n \"name\": \"onesdk1857\",\r\n \"type\": \"Microsoft.Sql/servers\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0\",\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"onesdk1857.sqltest-eg1.mscds.com\",\r\n \"administratorLogin\": \"testusername\",\r\n \"administratorLoginPassword\": null,\r\n \"externalAdministratorLogin\": null,\r\n \"externalAdministratorSid\": null,\r\n \"version\": \"12.0\",\r\n \"state\": \"Ready\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk7619/providers/Microsoft.Sql/servers/onesdk1857\",\r\n \"name\": \"onesdk1857\",\r\n \"type\": \"Microsoft.Sql/servers\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0\",\r\n \"tags\": {\"tag_key\":\"tag_value\"},\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"onesdk1857.sqltest-eg1.mscds.com\",\r\n \"administratorLogin\": \"testusername\",\r\n \"administratorLoginPassword\": null,\r\n \"externalAdministratorLogin\": null,\r\n \"externalAdministratorSid\": null,\r\n \"version\": \"12.0\",\r\n \"state\": \"Ready\"\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ "469" @@ -529,7 +529,7 @@ "d1ba2f45-c214-4135-bfe4-9bf47f13edcf" ] }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk7619/providers/Microsoft.Sql/servers/onesdk1857\",\r\n \"name\": \"onesdk1857\",\r\n \"type\": \"Microsoft.Sql/servers\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0\",\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"onesdk1857.sqltest-eg1.mscds.com\",\r\n \"administratorLogin\": \"testusername\",\r\n \"administratorLoginPassword\": null,\r\n \"externalAdministratorLogin\": null,\r\n \"externalAdministratorSid\": null,\r\n \"version\": \"12.0\",\r\n \"state\": \"Ready\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk7619/providers/Microsoft.Sql/servers/onesdk1857\",\r\n \"name\": \"onesdk1857\",\r\n \"type\": \"Microsoft.Sql/servers\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0\",\r\n \"tags\": {\"tag_key\":\"tag_value\"},\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"onesdk1857.sqltest-eg1.mscds.com\",\r\n \"administratorLogin\": \"testusername\",\r\n \"administratorLoginPassword\": null,\r\n \"externalAdministratorLogin\": null,\r\n \"externalAdministratorSid\": null,\r\n \"version\": \"12.0\",\r\n \"state\": \"Ready\"\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ "469" @@ -589,7 +589,7 @@ "478b3ffa-2fc8-4c65-9652-af8179ad7c5e" ] }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk7619/providers/Microsoft.Sql/servers/onesdk1857\",\r\n \"name\": \"onesdk1857\",\r\n \"type\": \"Microsoft.Sql/servers\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0\",\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"onesdk1857.sqltest-eg1.mscds.com\",\r\n \"administratorLogin\": \"testusername\",\r\n \"administratorLoginPassword\": \"t357ingP@s5w0rd!\",\r\n \"externalAdministratorLogin\": null,\r\n \"externalAdministratorSid\": null,\r\n \"version\": \"12.0\",\r\n \"state\": \"Ready\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk7619/providers/Microsoft.Sql/servers/onesdk1857\",\r\n \"name\": \"onesdk1857\",\r\n \"type\": \"Microsoft.Sql/servers\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0\",\r\n \"tags\": {\"tag_key\":\"tag_value\"},\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"onesdk1857.sqltest-eg1.mscds.com\",\r\n \"administratorLogin\": \"testusername\",\r\n \"administratorLoginPassword\": \"t357ingP@s5w0rd!\",\r\n \"externalAdministratorLogin\": null,\r\n \"externalAdministratorSid\": null,\r\n \"version\": \"12.0\",\r\n \"state\": \"Ready\"\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ "483" @@ -688,7 +688,7 @@ "RequestUri": "/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk7619/providers/Microsoft.Sql/servers/onesdk1857/databases/onesdk2401?api-version=2014-04-01", "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMWRjOTE4N2EtOTg2ZC00ODg4LThkY2YtYWYwYmQ0M2RmOTllL3Jlc291cmNlR3JvdXBzL29uZXNkazc2MTkvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9vbmVzZGsxODU3L2RhdGFiYXNlcy9vbmVzZGsyNDAxP2FwaS12ZXJzaW9uPTIwMTQtMDQtMDE=", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"maxSizeBytes\": \"0\"\r\n },\r\n \"location\": \"Southeast Asia\",\r\n \"tags\": {}\r\n}", + "RequestBody": "{\r\n \"properties\": {\r\n \"maxSizeBytes\": \"0\"\r\n },\r\n \"location\": \"Southeast Asia\",\r\n \"tags\": {\"tag_key\":\"tag_value\"}\r\n}", "RequestHeaders": { "Content-Type": [ "application/json; charset=utf-8" @@ -946,7 +946,7 @@ "3eb08e2d-82a7-40e6-8c31-3b176f17fd26" ] }, - "ResponseBody": "{\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk7619/providers/Microsoft.Sql/servers/onesdk1857/databases/onesdk2401\",\r\n \"name\": \"onesdk2401\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"251a2643-f078-4a71-a992-c31a0af8f848\",\r\n \"edition\": \"Standard\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"S0\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"creationDate\": \"2015-06-10T16:03:16.33Z\",\r\n \"currentServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"Japan East\",\r\n \"earliestRestoreDate\": \"2015-06-10T16:14:06.217Z\",\r\n \"elasticPoolName\": null,\r\n \"containmentState\": 2\r\n }\r\n}", + "ResponseBody": "{\r\n \"tags\": {\"tag_key\":\"tag_value\"},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk7619/providers/Microsoft.Sql/servers/onesdk1857/databases/onesdk2401\",\r\n \"name\": \"onesdk2401\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"251a2643-f078-4a71-a992-c31a0af8f848\",\r\n \"edition\": \"Standard\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"S0\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"creationDate\": \"2015-06-10T16:03:16.33Z\",\r\n \"currentServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"Japan East\",\r\n \"earliestRestoreDate\": \"2015-06-10T16:14:06.217Z\",\r\n \"elasticPoolName\": null,\r\n \"containmentState\": 2\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ "824" @@ -1042,7 +1042,7 @@ "RequestUri": "/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk7619/providers/Microsoft.Sql/servers/onesdk1857/databases/onesdk1549?api-version=2014-04-01", "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMWRjOTE4N2EtOTg2ZC00ODg4LThkY2YtYWYwYmQ0M2RmOTllL3Jlc291cmNlR3JvdXBzL29uZXNkazc2MTkvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9vbmVzZGsxODU3L2RhdGFiYXNlcy9vbmVzZGsxNTQ5P2FwaS12ZXJzaW9uPTIwMTQtMDQtMDE=", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"maxSizeBytes\": \"0\"\r\n },\r\n \"location\": \"Southeast Asia\",\r\n \"tags\": {}\r\n}", + "RequestBody": "{\r\n \"properties\": {\r\n \"maxSizeBytes\": \"0\"\r\n },\r\n \"location\": \"Southeast Asia\",\r\n \"tags\": {\"tag_key\":\"tag_value\"}\r\n}", "RequestHeaders": { "Content-Type": [ "application/json; charset=utf-8" @@ -1360,7 +1360,7 @@ "e44f3dae-a645-48bb-9956-f89f1620f033" ] }, - "ResponseBody": "{\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk7619/providers/Microsoft.Sql/servers/onesdk1857/databases/onesdk1549\",\r\n \"name\": \"onesdk1549\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"620a9de3-7cf8-4de4-90d4-9fd8f0d0b530\",\r\n \"edition\": \"Standard\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"S0\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"creationDate\": \"2015-06-10T16:04:17.627Z\",\r\n \"currentServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"Japan East\",\r\n \"earliestRestoreDate\": \"2015-06-10T16:15:38.253Z\",\r\n \"elasticPoolName\": null,\r\n \"containmentState\": 2\r\n }\r\n}", + "ResponseBody": "{\r\n \"tags\": {\"tag_key\":\"tag_value\"},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk7619/providers/Microsoft.Sql/servers/onesdk1857/databases/onesdk1549\",\r\n \"name\": \"onesdk1549\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"620a9de3-7cf8-4de4-90d4-9fd8f0d0b530\",\r\n \"edition\": \"Standard\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"S0\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"creationDate\": \"2015-06-10T16:04:17.627Z\",\r\n \"currentServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"Japan East\",\r\n \"earliestRestoreDate\": \"2015-06-10T16:15:38.253Z\",\r\n \"elasticPoolName\": null,\r\n \"containmentState\": 2\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ "825" @@ -2134,7 +2134,7 @@ "be18e04b-6db1-4e63-9497-897d4f5f14cd" ] }, - "ResponseBody": "{\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk7619/providers/Microsoft.Sql/servers/onesdk1857/databases/onesdk967\",\r\n \"name\": \"onesdk967\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"82a06ad6-7bb5-4797-9b25-e68104c9ee65\",\r\n \"edition\": \"DataWarehouse\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"DW100\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"creationDate\": \"2015-06-10T16:05:41.183Z\",\r\n \"currentServiceObjectiveId\": \"4e63cb0e-91b9-46fd-b05c-51fdd2367618\",\r\n \"requestedServiceObjectiveId\": \"4e63cb0e-91b9-46fd-b05c-51fdd2367618\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"Japan East\",\r\n \"earliestRestoreDate\": \"2015-06-10T16:18:30.057Z\",\r\n \"elasticPoolName\": null,\r\n \"containmentState\": 2\r\n }\r\n}", + "ResponseBody": "{\r\n \"tags\": {\"tag_key\":\"tag_value\"},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk7619/providers/Microsoft.Sql/servers/onesdk1857/databases/onesdk967\",\r\n \"name\": \"onesdk967\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"82a06ad6-7bb5-4797-9b25-e68104c9ee65\",\r\n \"edition\": \"DataWarehouse\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"DW100\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"creationDate\": \"2015-06-10T16:05:41.183Z\",\r\n \"currentServiceObjectiveId\": \"4e63cb0e-91b9-46fd-b05c-51fdd2367618\",\r\n \"requestedServiceObjectiveId\": \"4e63cb0e-91b9-46fd-b05c-51fdd2367618\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"Japan East\",\r\n \"earliestRestoreDate\": \"2015-06-10T16:18:30.057Z\",\r\n \"elasticPoolName\": null,\r\n \"containmentState\": 2\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ "831" @@ -2230,7 +2230,7 @@ "RequestUri": "/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk7619/providers/Microsoft.Sql/servers/onesdk1857/databases/onesdk4701?api-version=2014-04-01", "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMWRjOTE4N2EtOTg2ZC00ODg4LThkY2YtYWYwYmQ0M2RmOTllL3Jlc291cmNlR3JvdXBzL29uZXNkazc2MTkvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9vbmVzZGsxODU3L2RhdGFiYXNlcy9vbmVzZGs0NzAxP2FwaS12ZXJzaW9uPTIwMTQtMDQtMDE=", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"edition\": \"Basic\",\r\n \"collation\": \"Japanese_Bushu_Kakusu_100_CS_AS\",\r\n \"maxSizeBytes\": \"1073741824\",\r\n \"requestedServiceObjectiveName\": \"Basic\"\r\n },\r\n \"location\": \"Southeast Asia\",\r\n \"tags\": {}\r\n}", + "RequestBody": "{\r\n \"properties\": {\r\n \"edition\": \"Basic\",\r\n \"collation\": \"Japanese_Bushu_Kakusu_100_CS_AS\",\r\n \"maxSizeBytes\": \"1073741824\",\r\n \"requestedServiceObjectiveName\": \"Basic\"\r\n },\r\n \"location\": \"Southeast Asia\",\r\n \"tags\": {\"tag_key\":\"tag_value\"}\r\n}", "RequestHeaders": { "Content-Type": [ "application/json; charset=utf-8" @@ -2488,7 +2488,7 @@ "44b8132c-ed5a-4827-8fc7-e3885fd22cb9" ] }, - "ResponseBody": "{\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk7619/providers/Microsoft.Sql/servers/onesdk1857/databases/onesdk4701\",\r\n \"name\": \"onesdk4701\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"01855dc0-be75-49e4-808b-3e9e3f126f4c\",\r\n \"edition\": \"Basic\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"Basic\",\r\n \"collation\": \"Japanese_Bushu_Kakusu_100_CS_AS\",\r\n \"maxSizeBytes\": \"1073741824\",\r\n \"creationDate\": \"2015-06-10T16:08:42.637Z\",\r\n \"currentServiceObjectiveId\": \"dd6d99bb-f193-4ec1-86f2-43d3bccbc49c\",\r\n \"requestedServiceObjectiveId\": \"dd6d99bb-f193-4ec1-86f2-43d3bccbc49c\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"Japan East\",\r\n \"earliestRestoreDate\": \"2015-06-10T16:19:32.807Z\",\r\n \"elasticPoolName\": null,\r\n \"containmentState\": 2\r\n }\r\n}", + "ResponseBody": "{\r\n \"tags\": {\"tag_key\":\"tag_value\"},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk7619/providers/Microsoft.Sql/servers/onesdk1857/databases/onesdk4701\",\r\n \"name\": \"onesdk4701\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"01855dc0-be75-49e4-808b-3e9e3f126f4c\",\r\n \"edition\": \"Basic\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"Basic\",\r\n \"collation\": \"Japanese_Bushu_Kakusu_100_CS_AS\",\r\n \"maxSizeBytes\": \"1073741824\",\r\n \"creationDate\": \"2015-06-10T16:08:42.637Z\",\r\n \"currentServiceObjectiveId\": \"dd6d99bb-f193-4ec1-86f2-43d3bccbc49c\",\r\n \"requestedServiceObjectiveId\": \"dd6d99bb-f193-4ec1-86f2-43d3bccbc49c\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"Japan East\",\r\n \"earliestRestoreDate\": \"2015-06-10T16:19:32.807Z\",\r\n \"elasticPoolName\": null,\r\n \"containmentState\": 2\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ "826" @@ -2584,7 +2584,7 @@ "RequestUri": "/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk7619/providers/Microsoft.Sql/servers/onesdk1857/databases/onesdk7314?api-version=2014-04-01", "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMWRjOTE4N2EtOTg2ZC00ODg4LThkY2YtYWYwYmQ0M2RmOTllL3Jlc291cmNlR3JvdXBzL29uZXNkazc2MTkvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9vbmVzZGsxODU3L2RhdGFiYXNlcy9vbmVzZGs3MzE0P2FwaS12ZXJzaW9uPTIwMTQtMDQtMDE=", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"edition\": \"Basic\",\r\n \"collation\": \"Japanese_Bushu_Kakusu_100_CS_AS\",\r\n \"maxSizeBytes\": \"1073741824\",\r\n \"requestedServiceObjectiveName\": \"Basic\"\r\n },\r\n \"location\": \"Southeast Asia\",\r\n \"tags\": {}\r\n}", + "RequestBody": "{\r\n \"properties\": {\r\n \"edition\": \"Basic\",\r\n \"collation\": \"Japanese_Bushu_Kakusu_100_CS_AS\",\r\n \"maxSizeBytes\": \"1073741824\",\r\n \"requestedServiceObjectiveName\": \"Basic\"\r\n },\r\n \"location\": \"Southeast Asia\",\r\n \"tags\": {\"tag_key\":\"tag_value\"}\r\n}", "RequestHeaders": { "Content-Type": [ "application/json; charset=utf-8" @@ -2722,7 +2722,7 @@ "c17c6304-2a29-4761-8151-7461cb925c03" ] }, - "ResponseBody": "{\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk7619/providers/Microsoft.Sql/servers/onesdk1857/databases/onesdk7314\",\r\n \"name\": \"onesdk7314\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"f1bb2b56-3e7b-4903-9f81-25336688724d\",\r\n \"edition\": \"Basic\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"Basic\",\r\n \"collation\": \"Japanese_Bushu_Kakusu_100_CS_AS\",\r\n \"maxSizeBytes\": \"1073741824\",\r\n \"creationDate\": \"2015-06-10T16:09:49.953Z\",\r\n \"currentServiceObjectiveId\": \"dd6d99bb-f193-4ec1-86f2-43d3bccbc49c\",\r\n \"requestedServiceObjectiveId\": \"dd6d99bb-f193-4ec1-86f2-43d3bccbc49c\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"Japan East\",\r\n \"earliestRestoreDate\": \"2015-06-10T16:19:59.843Z\",\r\n \"elasticPoolName\": null,\r\n \"containmentState\": 2\r\n }\r\n}", + "ResponseBody": "{\r\n \"tags\": {\"tag_key\":\"tag_value\"},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk7619/providers/Microsoft.Sql/servers/onesdk1857/databases/onesdk7314\",\r\n \"name\": \"onesdk7314\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"f1bb2b56-3e7b-4903-9f81-25336688724d\",\r\n \"edition\": \"Basic\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"Basic\",\r\n \"collation\": \"Japanese_Bushu_Kakusu_100_CS_AS\",\r\n \"maxSizeBytes\": \"1073741824\",\r\n \"creationDate\": \"2015-06-10T16:09:49.953Z\",\r\n \"currentServiceObjectiveId\": \"dd6d99bb-f193-4ec1-86f2-43d3bccbc49c\",\r\n \"requestedServiceObjectiveId\": \"dd6d99bb-f193-4ec1-86f2-43d3bccbc49c\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"Japan East\",\r\n \"earliestRestoreDate\": \"2015-06-10T16:19:59.843Z\",\r\n \"elasticPoolName\": null,\r\n \"containmentState\": 2\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ "826" diff --git a/src/ResourceManager/Sql/Commands.Sql.Test/SessionRecords/Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseCrudTests/TestDatabaseCreateV2.json b/src/ResourceManager/Sql/Commands.Sql.Test/SessionRecords/Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseCrudTests/TestDatabaseCreateV2.json index 13f48ffc2a3c..fcd544666390 100644 --- a/src/ResourceManager/Sql/Commands.Sql.Test/SessionRecords/Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseCrudTests/TestDatabaseCreateV2.json +++ b/src/ResourceManager/Sql/Commands.Sql.Test/SessionRecords/Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseCrudTests/TestDatabaseCreateV2.json @@ -526,7 +526,7 @@ "RequestUri": "/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk2103/providers/Microsoft.Sql/servers/onesdk6755/databases/onesdk7038?api-version=2014-04-01", "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMWRjOTE4N2EtOTg2ZC00ODg4LThkY2YtYWYwYmQ0M2RmOTllL3Jlc291cmNlR3JvdXBzL29uZXNkazIxMDMvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9vbmVzZGs2NzU1L2RhdGFiYXNlcy9vbmVzZGs3MDM4P2FwaS12ZXJzaW9uPTIwMTQtMDQtMDE=", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"edition\": \"Basic\",\r\n \"collation\": \"Japanese_Bushu_Kakusu_100_CS_AS\",\r\n \"maxSizeBytes\": \"1073741824\",\r\n \"requestedServiceObjectiveName\": \"Basic\"\r\n },\r\n \"location\": \"North Central US\",\r\n \"tags\": {}\r\n}", + "RequestBody": "{\r\n \"properties\": {\r\n \"edition\": \"Basic\",\r\n \"collation\": \"Japanese_Bushu_Kakusu_100_CS_AS\",\r\n \"maxSizeBytes\": \"1073741824\",\r\n \"requestedServiceObjectiveName\": \"Basic\"\r\n },\r\n \"location\": \"North Central US\",\r\n \"tags\": {\"tag_key\":\"tag_value\"}\r\n}", "RequestHeaders": { "Content-Type": [ "application/json; charset=utf-8" @@ -541,7 +541,7 @@ "f8dda6d5-fdbd-4af2-ab69-765f40f2bc0c" ] }, - "ResponseBody": "{\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk2103/providers/Microsoft.Sql/servers/onesdk6755/databases/onesdk7038\",\r\n \"name\": \"onesdk7038\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"North Central US\",\r\n \"kind\": \"v2.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"2ed02051-e06e-4600-8a69-f649189d5a67\",\r\n \"edition\": \"Basic\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"Basic\",\r\n \"collation\": \"Japanese_Bushu_Kakusu_100_CS_AS\",\r\n \"maxSizeBytes\": \"1073741824\",\r\n \"creationDate\": \"2015-06-10T07:43:27.79Z\",\r\n \"currentServiceObjectiveId\": \"dd6d99bb-f193-4ec1-86f2-43d3bccbc49c\",\r\n \"requestedServiceObjectiveId\": \"dd6d99bb-f193-4ec1-86f2-43d3bccbc49c\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"West US\",\r\n \"earliestRestoreDate\": \"2015-06-10T07:44:27.79Z\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"tags\": {\"tag_key\":\"tag_value\"},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk2103/providers/Microsoft.Sql/servers/onesdk6755/databases/onesdk7038\",\r\n \"name\": \"onesdk7038\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"North Central US\",\r\n \"kind\": \"v2.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"2ed02051-e06e-4600-8a69-f649189d5a67\",\r\n \"edition\": \"Basic\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"Basic\",\r\n \"collation\": \"Japanese_Bushu_Kakusu_100_CS_AS\",\r\n \"maxSizeBytes\": \"1073741824\",\r\n \"creationDate\": \"2015-06-10T07:43:27.79Z\",\r\n \"currentServiceObjectiveId\": \"dd6d99bb-f193-4ec1-86f2-43d3bccbc49c\",\r\n \"requestedServiceObjectiveId\": \"dd6d99bb-f193-4ec1-86f2-43d3bccbc49c\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"West US\",\r\n \"earliestRestoreDate\": \"2015-06-10T07:44:27.79Z\"\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ "778" @@ -640,7 +640,7 @@ "RequestUri": "/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk2103/providers/Microsoft.Sql/servers/onesdk6755/databases/onesdk2184?api-version=2014-04-01", "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMWRjOTE4N2EtOTg2ZC00ODg4LThkY2YtYWYwYmQ0M2RmOTllL3Jlc291cmNlR3JvdXBzL29uZXNkazIxMDMvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9vbmVzZGs2NzU1L2RhdGFiYXNlcy9vbmVzZGsyMTg0P2FwaS12ZXJzaW9uPTIwMTQtMDQtMDE=", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"edition\": \"Basic\",\r\n \"collation\": \"Japanese_Bushu_Kakusu_100_CS_AS\",\r\n \"maxSizeBytes\": \"1073741824\",\r\n \"requestedServiceObjectiveName\": \"Basic\"\r\n },\r\n \"location\": \"North Central US\",\r\n \"tags\": {}\r\n}", + "RequestBody": "{\r\n \"properties\": {\r\n \"edition\": \"Basic\",\r\n \"collation\": \"Japanese_Bushu_Kakusu_100_CS_AS\",\r\n \"maxSizeBytes\": \"1073741824\",\r\n \"requestedServiceObjectiveName\": \"Basic\"\r\n },\r\n \"location\": \"North Central US\",\r\n \"tags\": {\"tag_key\":\"tag_value\"}\r\n}", "RequestHeaders": { "Content-Type": [ "application/json; charset=utf-8" @@ -655,7 +655,7 @@ "22949c33-fb91-426c-a2fb-49b48906e7db" ] }, - "ResponseBody": "{\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk2103/providers/Microsoft.Sql/servers/onesdk6755/databases/onesdk2184\",\r\n \"name\": \"onesdk2184\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"North Central US\",\r\n \"kind\": \"v2.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"6f3fe241-e717-47ba-a5f7-c565074520ff\",\r\n \"edition\": \"Basic\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"Basic\",\r\n \"collation\": \"Japanese_Bushu_Kakusu_100_CS_AS\",\r\n \"maxSizeBytes\": \"1073741824\",\r\n \"creationDate\": \"2015-06-10T07:43:33.843Z\",\r\n \"currentServiceObjectiveId\": \"dd6d99bb-f193-4ec1-86f2-43d3bccbc49c\",\r\n \"requestedServiceObjectiveId\": \"dd6d99bb-f193-4ec1-86f2-43d3bccbc49c\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"West US\",\r\n \"earliestRestoreDate\": \"2015-06-10T07:44:33.843Z\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"tags\": {\"tag_key\":\"tag_value\"},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk2103/providers/Microsoft.Sql/servers/onesdk6755/databases/onesdk2184\",\r\n \"name\": \"onesdk2184\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"North Central US\",\r\n \"kind\": \"v2.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"6f3fe241-e717-47ba-a5f7-c565074520ff\",\r\n \"edition\": \"Basic\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"Basic\",\r\n \"collation\": \"Japanese_Bushu_Kakusu_100_CS_AS\",\r\n \"maxSizeBytes\": \"1073741824\",\r\n \"creationDate\": \"2015-06-10T07:43:33.843Z\",\r\n \"currentServiceObjectiveId\": \"dd6d99bb-f193-4ec1-86f2-43d3bccbc49c\",\r\n \"requestedServiceObjectiveId\": \"dd6d99bb-f193-4ec1-86f2-43d3bccbc49c\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"West US\",\r\n \"earliestRestoreDate\": \"2015-06-10T07:44:33.843Z\"\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ "780" diff --git a/src/ResourceManager/Sql/Commands.Sql.Test/SessionRecords/Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseCrudTests/TestDatabaseUpdate.json b/src/ResourceManager/Sql/Commands.Sql.Test/SessionRecords/Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseCrudTests/TestDatabaseUpdate.json index 9322dc465789..e75f6f2690f3 100644 --- a/src/ResourceManager/Sql/Commands.Sql.Test/SessionRecords/Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseCrudTests/TestDatabaseUpdate.json +++ b/src/ResourceManager/Sql/Commands.Sql.Test/SessionRecords/Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseCrudTests/TestDatabaseUpdate.json @@ -313,7 +313,7 @@ "2b070e9b-6bf2-4a87-970b-5ea0c0a8f6f0" ] }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk6493/providers/Microsoft.Sql/servers/onesdk1225\",\r\n \"name\": \"onesdk1225\",\r\n \"type\": \"Microsoft.Sql/servers\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0\",\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"onesdk1225.sqltest-eg1.mscds.com\",\r\n \"administratorLogin\": \"testusername\",\r\n \"administratorLoginPassword\": null,\r\n \"externalAdministratorLogin\": null,\r\n \"externalAdministratorSid\": null,\r\n \"version\": \"12.0\",\r\n \"state\": \"Ready\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk6493/providers/Microsoft.Sql/servers/onesdk1225\",\r\n \"name\": \"onesdk1225\",\r\n \"type\": \"Microsoft.Sql/servers\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0\",\r\n \"tags\": {\"tag_key\":\"tag_new_value\"},\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"onesdk1225.sqltest-eg1.mscds.com\",\r\n \"administratorLogin\": \"testusername\",\r\n \"administratorLoginPassword\": null,\r\n \"externalAdministratorLogin\": null,\r\n \"externalAdministratorSid\": null,\r\n \"version\": \"12.0\",\r\n \"state\": \"Ready\"\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ "469" @@ -367,7 +367,7 @@ "de56699d-268c-421c-9c20-71e55e6b7949" ] }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk6493/providers/Microsoft.Sql/servers/onesdk1225\",\r\n \"name\": \"onesdk1225\",\r\n \"type\": \"Microsoft.Sql/servers\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0\",\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"onesdk1225.sqltest-eg1.mscds.com\",\r\n \"administratorLogin\": \"testusername\",\r\n \"administratorLoginPassword\": null,\r\n \"externalAdministratorLogin\": null,\r\n \"externalAdministratorSid\": null,\r\n \"version\": \"12.0\",\r\n \"state\": \"Ready\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk6493/providers/Microsoft.Sql/servers/onesdk1225\",\r\n \"name\": \"onesdk1225\",\r\n \"type\": \"Microsoft.Sql/servers\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0\",\r\n \"tags\": {\"tag_key\":\"tag_new_value\"},\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"onesdk1225.sqltest-eg1.mscds.com\",\r\n \"administratorLogin\": \"testusername\",\r\n \"administratorLoginPassword\": null,\r\n \"externalAdministratorLogin\": null,\r\n \"externalAdministratorSid\": null,\r\n \"version\": \"12.0\",\r\n \"state\": \"Ready\"\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ "469" @@ -427,7 +427,7 @@ "81e47dd1-c837-4f4c-99bd-38cce23c5916" ] }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk6493/providers/Microsoft.Sql/servers/onesdk1225\",\r\n \"name\": \"onesdk1225\",\r\n \"type\": \"Microsoft.Sql/servers\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0\",\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"onesdk1225.sqltest-eg1.mscds.com\",\r\n \"administratorLogin\": \"testusername\",\r\n \"administratorLoginPassword\": \"t357ingP@s5w0rd!\",\r\n \"externalAdministratorLogin\": null,\r\n \"externalAdministratorSid\": null,\r\n \"version\": \"12.0\",\r\n \"state\": \"Ready\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk6493/providers/Microsoft.Sql/servers/onesdk1225\",\r\n \"name\": \"onesdk1225\",\r\n \"type\": \"Microsoft.Sql/servers\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0\",\r\n \"tags\": {\"tag_key\":\"tag_new_value\"},\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"onesdk1225.sqltest-eg1.mscds.com\",\r\n \"administratorLogin\": \"testusername\",\r\n \"administratorLoginPassword\": \"t357ingP@s5w0rd!\",\r\n \"externalAdministratorLogin\": null,\r\n \"externalAdministratorSid\": null,\r\n \"version\": \"12.0\",\r\n \"state\": \"Ready\"\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ "483" @@ -535,7 +535,7 @@ "e5bc98fb-857b-4e65-8bf0-c67cf2cd646a" ] }, - "ResponseBody": "{\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk6493/providers/Microsoft.Sql/servers/onesdk1225/databases/onesdk8331\",\r\n \"name\": \"onesdk8331\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"82762e25-f773-4953-95e3-beef5e2d5aef\",\r\n \"edition\": \"Standard\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"S0\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"creationDate\": \"2015-06-11T00:03:20.193Z\",\r\n \"currentServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"Japan East\",\r\n \"earliestRestoreDate\": \"2015-06-11T00:14:05.78Z\",\r\n \"elasticPoolName\": null,\r\n \"containmentState\": 2\r\n }\r\n}", + "ResponseBody": "{\r\n \"tags\": {\"tag_key\":\"tag_new_value\"},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk6493/providers/Microsoft.Sql/servers/onesdk1225/databases/onesdk8331\",\r\n \"name\": \"onesdk8331\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"82762e25-f773-4953-95e3-beef5e2d5aef\",\r\n \"edition\": \"Standard\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"S0\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"creationDate\": \"2015-06-11T00:03:20.193Z\",\r\n \"currentServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"Japan East\",\r\n \"earliestRestoreDate\": \"2015-06-11T00:14:05.78Z\",\r\n \"elasticPoolName\": null,\r\n \"containmentState\": 2\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ "824" @@ -589,7 +589,7 @@ "445f4807-8474-4e59-94bf-64ca42f5d4d3" ] }, - "ResponseBody": "{\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk6493/providers/Microsoft.Sql/servers/onesdk1225/databases/onesdk8331\",\r\n \"name\": \"onesdk8331\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"82762e25-f773-4953-95e3-beef5e2d5aef\",\r\n \"edition\": \"Basic\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"Basic\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"1073741824\",\r\n \"creationDate\": \"2015-06-11T00:03:20.193Z\",\r\n \"currentServiceObjectiveId\": \"dd6d99bb-f193-4ec1-86f2-43d3bccbc49c\",\r\n \"requestedServiceObjectiveId\": \"dd6d99bb-f193-4ec1-86f2-43d3bccbc49c\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"Japan East\",\r\n \"earliestRestoreDate\": \"2015-06-11T00:14:05.78Z\",\r\n \"elasticPoolName\": null,\r\n \"containmentState\": 2\r\n }\r\n}", + "ResponseBody": "{\r\n \"tags\": {\"tag_key\":\"tag_new_value\"},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk6493/providers/Microsoft.Sql/servers/onesdk1225/databases/onesdk8331\",\r\n \"name\": \"onesdk8331\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"82762e25-f773-4953-95e3-beef5e2d5aef\",\r\n \"edition\": \"Basic\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"Basic\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"1073741824\",\r\n \"creationDate\": \"2015-06-11T00:03:20.193Z\",\r\n \"currentServiceObjectiveId\": \"dd6d99bb-f193-4ec1-86f2-43d3bccbc49c\",\r\n \"requestedServiceObjectiveId\": \"dd6d99bb-f193-4ec1-86f2-43d3bccbc49c\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"Japan East\",\r\n \"earliestRestoreDate\": \"2015-06-11T00:14:05.78Z\",\r\n \"elasticPoolName\": null,\r\n \"containmentState\": 2\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ "822" @@ -634,7 +634,7 @@ "RequestUri": "/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk6493/providers/Microsoft.Sql/servers/onesdk1225/databases/onesdk8331?api-version=2014-04-01", "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMWRjOTE4N2EtOTg2ZC00ODg4LThkY2YtYWYwYmQ0M2RmOTllL3Jlc291cmNlR3JvdXBzL29uZXNkazY0OTMvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9vbmVzZGsxMjI1L2RhdGFiYXNlcy9vbmVzZGs4MzMxP2FwaS12ZXJzaW9uPTIwMTQtMDQtMDE=", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"edition\": \"Standard\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"requestedServiceObjectiveName\": \"S0\"\r\n },\r\n \"location\": \"Southeast Asia\",\r\n \"tags\": {}\r\n}", + "RequestBody": "{\r\n \"properties\": {\r\n \"edition\": \"Standard\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"requestedServiceObjectiveName\": \"S0\"\r\n },\r\n \"location\": \"Southeast Asia\",\r\n \"tags\": {\"tag_key\":\"tag_new_value\"}\r\n}", "RequestHeaders": { "Content-Type": [ "application/json; charset=utf-8" @@ -703,7 +703,7 @@ "RequestUri": "/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk6493/providers/Microsoft.Sql/servers/onesdk1225/databases/onesdk8331?api-version=2014-04-01", "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMWRjOTE4N2EtOTg2ZC00ODg4LThkY2YtYWYwYmQ0M2RmOTllL3Jlc291cmNlR3JvdXBzL29uZXNkazY0OTMvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9vbmVzZGsxMjI1L2RhdGFiYXNlcy9vbmVzZGs4MzMxP2FwaS12ZXJzaW9uPTIwMTQtMDQtMDE=", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"edition\": \"Basic\",\r\n \"maxSizeBytes\": \"1073741824\",\r\n \"requestedServiceObjectiveName\": \"Basic\"\r\n },\r\n \"location\": \"Southeast Asia\",\r\n \"tags\": {}\r\n}", + "RequestBody": "{\r\n \"properties\": {\r\n \"edition\": \"Basic\",\r\n \"maxSizeBytes\": \"1073741824\",\r\n \"requestedServiceObjectiveName\": \"Basic\"\r\n },\r\n \"location\": \"Southeast Asia\",\r\n \"tags\": {\"tag_key\":\"tag_new_value\"}\r\n}", "RequestHeaders": { "Content-Type": [ "application/json; charset=utf-8" @@ -772,7 +772,7 @@ "RequestUri": "/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk6493/providers/Microsoft.Sql/servers/onesdk1225/databases/onesdk8331?api-version=2014-04-01", "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMWRjOTE4N2EtOTg2ZC00ODg4LThkY2YtYWYwYmQ0M2RmOTllL3Jlc291cmNlR3JvdXBzL29uZXNkazY0OTMvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9vbmVzZGsxMjI1L2RhdGFiYXNlcy9vbmVzZGs4MzMxP2FwaS12ZXJzaW9uPTIwMTQtMDQtMDE=", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"edition\": \"Standard\",\r\n \"maxSizeBytes\": \"107374182400\",\r\n \"requestedServiceObjectiveName\": \"S1\"\r\n },\r\n \"location\": \"Southeast Asia\",\r\n \"tags\": {}\r\n}", + "RequestBody": "{\r\n \"properties\": {\r\n \"edition\": \"Standard\",\r\n \"maxSizeBytes\": \"107374182400\",\r\n \"requestedServiceObjectiveName\": \"S1\"\r\n },\r\n \"location\": \"Southeast Asia\",\r\n \"tags\": {\"tag_key\":\"tag_new_value\"}\r\n}", "RequestHeaders": { "Content-Type": [ "application/json; charset=utf-8" @@ -970,7 +970,7 @@ "320bd440-fdba-4eb8-805e-850f45754937" ] }, - "ResponseBody": "{\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk6493/providers/Microsoft.Sql/servers/onesdk1225/databases/onesdk8331\",\r\n \"name\": \"onesdk8331\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"82762e25-f773-4953-95e3-beef5e2d5aef\",\r\n \"edition\": \"Standard\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"S0\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"creationDate\": \"2015-06-11T00:03:20.193Z\",\r\n \"currentServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"Japan East\",\r\n \"earliestRestoreDate\": \"2015-06-11T00:14:05.78Z\",\r\n \"elasticPoolName\": null,\r\n \"containmentState\": 2\r\n }\r\n}", + "ResponseBody": "{\r\n \"tags\": {\"tag_key\":\"tag_new_value\"},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk6493/providers/Microsoft.Sql/servers/onesdk1225/databases/onesdk8331\",\r\n \"name\": \"onesdk8331\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"82762e25-f773-4953-95e3-beef5e2d5aef\",\r\n \"edition\": \"Standard\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"S0\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"creationDate\": \"2015-06-11T00:03:20.193Z\",\r\n \"currentServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"Japan East\",\r\n \"earliestRestoreDate\": \"2015-06-11T00:14:05.78Z\",\r\n \"elasticPoolName\": null,\r\n \"containmentState\": 2\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ "824" @@ -1324,7 +1324,7 @@ "cf5eb6e4-c1ed-402c-a71e-edb7de711d5c" ] }, - "ResponseBody": "{\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk6493/providers/Microsoft.Sql/servers/onesdk1225/databases/onesdk8331\",\r\n \"name\": \"onesdk8331\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"82762e25-f773-4953-95e3-beef5e2d5aef\",\r\n \"edition\": \"Basic\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"Basic\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"1073741824\",\r\n \"creationDate\": \"2015-06-11T00:03:20.193Z\",\r\n \"currentServiceObjectiveId\": \"dd6d99bb-f193-4ec1-86f2-43d3bccbc49c\",\r\n \"requestedServiceObjectiveId\": \"dd6d99bb-f193-4ec1-86f2-43d3bccbc49c\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"Japan East\",\r\n \"earliestRestoreDate\": \"2015-06-11T00:14:05.78Z\",\r\n \"elasticPoolName\": null,\r\n \"containmentState\": 2\r\n },\r\n \"operationId\": \"381f1706-237b-4f1f-a739-7895f072fa20\"\r\n}", + "ResponseBody": "{\r\n \"tags\": {\"tag_key\":\"tag_new_value\"},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk6493/providers/Microsoft.Sql/servers/onesdk1225/databases/onesdk8331\",\r\n \"name\": \"onesdk8331\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"82762e25-f773-4953-95e3-beef5e2d5aef\",\r\n \"edition\": \"Basic\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"Basic\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"1073741824\",\r\n \"creationDate\": \"2015-06-11T00:03:20.193Z\",\r\n \"currentServiceObjectiveId\": \"dd6d99bb-f193-4ec1-86f2-43d3bccbc49c\",\r\n \"requestedServiceObjectiveId\": \"dd6d99bb-f193-4ec1-86f2-43d3bccbc49c\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"Japan East\",\r\n \"earliestRestoreDate\": \"2015-06-11T00:14:05.78Z\",\r\n \"elasticPoolName\": null,\r\n \"containmentState\": 2\r\n },\r\n \"operationId\": \"381f1706-237b-4f1f-a739-7895f072fa20\"\r\n}", "ResponseHeaders": { "Content-Length": [ "875" @@ -1618,7 +1618,7 @@ "d2a3bf62-001b-4288-9258-45a3be608296" ] }, - "ResponseBody": "{\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk6493/providers/Microsoft.Sql/servers/onesdk1225/databases/onesdk8331\",\r\n \"name\": \"onesdk8331\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"82762e25-f773-4953-95e3-beef5e2d5aef\",\r\n \"edition\": \"Standard\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"S1\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"107374182400\",\r\n \"creationDate\": \"2015-06-11T00:03:20.193Z\",\r\n \"currentServiceObjectiveId\": \"1b1ebd4d-d903-4baa-97f9-4ea675f5e928\",\r\n \"requestedServiceObjectiveId\": \"1b1ebd4d-d903-4baa-97f9-4ea675f5e928\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"Japan East\",\r\n \"earliestRestoreDate\": \"2015-06-11T00:14:05.78Z\",\r\n \"elasticPoolName\": null,\r\n \"containmentState\": 2\r\n },\r\n \"operationId\": \"963af164-deff-4e60-bd65-29730d4c571e\"\r\n}", + "ResponseBody": "{\r\n \"tags\": {\"tag_key\":\"tag_new_value\"},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk6493/providers/Microsoft.Sql/servers/onesdk1225/databases/onesdk8331\",\r\n \"name\": \"onesdk8331\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"82762e25-f773-4953-95e3-beef5e2d5aef\",\r\n \"edition\": \"Standard\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"S1\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"107374182400\",\r\n \"creationDate\": \"2015-06-11T00:03:20.193Z\",\r\n \"currentServiceObjectiveId\": \"1b1ebd4d-d903-4baa-97f9-4ea675f5e928\",\r\n \"requestedServiceObjectiveId\": \"1b1ebd4d-d903-4baa-97f9-4ea675f5e928\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"Japan East\",\r\n \"earliestRestoreDate\": \"2015-06-11T00:14:05.78Z\",\r\n \"elasticPoolName\": null,\r\n \"containmentState\": 2\r\n },\r\n \"operationId\": \"963af164-deff-4e60-bd65-29730d4c571e\"\r\n}", "ResponseHeaders": { "Content-Length": [ "877" @@ -1723,7 +1723,7 @@ "1ba7640d-e368-41ae-8646-6d6c4dda0741" ] }, - "ResponseBody": "{\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk6493/providers/Microsoft.Sql/servers/onesdk1225/databases/onesdk8205\",\r\n \"name\": \"onesdk8205\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"9d7600ec-c58f-439e-ab5b-6010bc211d79\",\r\n \"edition\": \"DataWarehouse\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"DW100\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"creationDate\": \"2015-06-11T00:07:19.183Z\",\r\n \"currentServiceObjectiveId\": \"4e63cb0e-91b9-46fd-b05c-51fdd2367618\",\r\n \"requestedServiceObjectiveId\": \"4e63cb0e-91b9-46fd-b05c-51fdd2367618\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"Japan East\",\r\n \"earliestRestoreDate\": \"2015-06-11T00:20:28.437Z\",\r\n \"elasticPoolName\": null,\r\n \"containmentState\": 2\r\n }\r\n}", + "ResponseBody": "{\r\n \"tags\": {\"tag_key\":\"tag_new_value\"},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk6493/providers/Microsoft.Sql/servers/onesdk1225/databases/onesdk8205\",\r\n \"name\": \"onesdk8205\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"9d7600ec-c58f-439e-ab5b-6010bc211d79\",\r\n \"edition\": \"DataWarehouse\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"DW100\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"creationDate\": \"2015-06-11T00:07:19.183Z\",\r\n \"currentServiceObjectiveId\": \"4e63cb0e-91b9-46fd-b05c-51fdd2367618\",\r\n \"requestedServiceObjectiveId\": \"4e63cb0e-91b9-46fd-b05c-51fdd2367618\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"Japan East\",\r\n \"earliestRestoreDate\": \"2015-06-11T00:20:28.437Z\",\r\n \"elasticPoolName\": null,\r\n \"containmentState\": 2\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ "833" @@ -2575,7 +2575,7 @@ "f2224497-fd81-4673-a45e-3e0363f1cfb8" ] }, - "ResponseBody": "{\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk6493/providers/Microsoft.Sql/servers/onesdk1225/databases/onesdk8205\",\r\n \"name\": \"onesdk8205\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"9d7600ec-c58f-439e-ab5b-6010bc211d79\",\r\n \"edition\": \"DataWarehouse\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"DW100\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"creationDate\": \"2015-06-11T00:07:19.183Z\",\r\n \"currentServiceObjectiveId\": \"4e63cb0e-91b9-46fd-b05c-51fdd2367618\",\r\n \"requestedServiceObjectiveId\": \"4e63cb0e-91b9-46fd-b05c-51fdd2367618\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"Japan East\",\r\n \"earliestRestoreDate\": \"2015-06-11T00:20:28.437Z\",\r\n \"elasticPoolName\": null,\r\n \"containmentState\": 2\r\n }\r\n}", + "ResponseBody": "{\r\n \"tags\": {\"tag_key\":\"tag_new_value\"},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk6493/providers/Microsoft.Sql/servers/onesdk1225/databases/onesdk8205\",\r\n \"name\": \"onesdk8205\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"9d7600ec-c58f-439e-ab5b-6010bc211d79\",\r\n \"edition\": \"DataWarehouse\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"DW100\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"creationDate\": \"2015-06-11T00:07:19.183Z\",\r\n \"currentServiceObjectiveId\": \"4e63cb0e-91b9-46fd-b05c-51fdd2367618\",\r\n \"requestedServiceObjectiveId\": \"4e63cb0e-91b9-46fd-b05c-51fdd2367618\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"Japan East\",\r\n \"earliestRestoreDate\": \"2015-06-11T00:20:28.437Z\",\r\n \"elasticPoolName\": null,\r\n \"containmentState\": 2\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ "833" @@ -2689,7 +2689,7 @@ "444f64a4-3058-4b4e-99f9-a6bad13f7524" ] }, - "ResponseBody": "{\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk6493/providers/Microsoft.Sql/servers/onesdk1225/databases/onesdk8205\",\r\n \"name\": \"onesdk8205\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"9d7600ec-c58f-439e-ab5b-6010bc211d79\",\r\n \"edition\": \"DataWarehouse\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"DW200\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"creationDate\": \"2015-06-11T00:07:19.183Z\",\r\n \"currentServiceObjectiveId\": \"99e78a92-d724-4e1b-857b-2be661f3d153\",\r\n \"requestedServiceObjectiveId\": \"99e78a92-d724-4e1b-857b-2be661f3d153\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"Japan East\",\r\n \"earliestRestoreDate\": \"2015-06-11T00:20:28.437Z\",\r\n \"elasticPoolName\": null,\r\n \"containmentState\": 2\r\n },\r\n \"operationId\": \"07bcbee7-20cf-4edf-8583-9eb9571d5947\"\r\n}", + "ResponseBody": "{\r\n \"tags\": {\"tag_key\":\"tag_new_value\"},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk6493/providers/Microsoft.Sql/servers/onesdk1225/databases/onesdk8205\",\r\n \"name\": \"onesdk8205\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"Southeast Asia\",\r\n \"kind\": \"v12.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"9d7600ec-c58f-439e-ab5b-6010bc211d79\",\r\n \"edition\": \"DataWarehouse\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"DW200\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"creationDate\": \"2015-06-11T00:07:19.183Z\",\r\n \"currentServiceObjectiveId\": \"99e78a92-d724-4e1b-857b-2be661f3d153\",\r\n \"requestedServiceObjectiveId\": \"99e78a92-d724-4e1b-857b-2be661f3d153\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"Japan East\",\r\n \"earliestRestoreDate\": \"2015-06-11T00:20:28.437Z\",\r\n \"elasticPoolName\": null,\r\n \"containmentState\": 2\r\n },\r\n \"operationId\": \"07bcbee7-20cf-4edf-8583-9eb9571d5947\"\r\n}", "ResponseHeaders": { "Content-Length": [ "886" diff --git a/src/ResourceManager/Sql/Commands.Sql.Test/SessionRecords/Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseCrudTests/TestDatabaseUpdateV2.json b/src/ResourceManager/Sql/Commands.Sql.Test/SessionRecords/Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseCrudTests/TestDatabaseUpdateV2.json index ad8bbda8a894..535d5efef0e3 100644 --- a/src/ResourceManager/Sql/Commands.Sql.Test/SessionRecords/Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseCrudTests/TestDatabaseUpdateV2.json +++ b/src/ResourceManager/Sql/Commands.Sql.Test/SessionRecords/Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseCrudTests/TestDatabaseUpdateV2.json @@ -313,7 +313,7 @@ "59eadf38-a2f8-4721-96c8-887bff110b6e" ] }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk4944/providers/Microsoft.Sql/servers/onesdk7380\",\r\n \"name\": \"onesdk7380\",\r\n \"type\": \"Microsoft.Sql/servers\",\r\n \"location\": \"North Central US\",\r\n \"kind\": \"v2.0\",\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"onesdk7380.sqltest-eg1.mscds.com\",\r\n \"administratorLogin\": \"testusername\",\r\n \"administratorLoginPassword\": null,\r\n \"externalAdministratorLogin\": null,\r\n \"externalAdministratorSid\": null,\r\n \"version\": \"2.0\",\r\n \"state\": \"Ready\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk4944/providers/Microsoft.Sql/servers/onesdk7380\",\r\n \"name\": \"onesdk7380\",\r\n \"type\": \"Microsoft.Sql/servers\",\r\n \"location\": \"North Central US\",\r\n \"kind\": \"v2.0\",\r\n \"tags\": {\"tag_key\":\"tag_new_value\"},\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"onesdk7380.sqltest-eg1.mscds.com\",\r\n \"administratorLogin\": \"testusername\",\r\n \"administratorLoginPassword\": null,\r\n \"externalAdministratorLogin\": null,\r\n \"externalAdministratorSid\": null,\r\n \"version\": \"2.0\",\r\n \"state\": \"Ready\"\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ "469" @@ -481,7 +481,7 @@ "5332583e-24a4-4237-9ed9-3b06e3847b09" ] }, - "ResponseBody": "{\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk4944/providers/Microsoft.Sql/servers/onesdk7380/databases/onesdk882\",\r\n \"name\": \"onesdk882\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"North Central US\",\r\n \"kind\": \"v2.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"2c72e858-00d1-4b82-b060-14e503c17ca2\",\r\n \"edition\": \"Standard\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"S0\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"creationDate\": \"2015-06-11T00:20:43.463Z\",\r\n \"currentServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"West US\",\r\n \"earliestRestoreDate\": \"2015-06-11T00:21:43.463Z\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"tags\": {\"tag_key\":\"tag_new_value\"},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk4944/providers/Microsoft.Sql/servers/onesdk7380/databases/onesdk882\",\r\n \"name\": \"onesdk882\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"North Central US\",\r\n \"kind\": \"v2.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"2c72e858-00d1-4b82-b060-14e503c17ca2\",\r\n \"edition\": \"Standard\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"S0\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"creationDate\": \"2015-06-11T00:20:43.463Z\",\r\n \"currentServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"West US\",\r\n \"earliestRestoreDate\": \"2015-06-11T00:21:43.463Z\"\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ "777" @@ -535,7 +535,7 @@ "a0d49375-49ec-4dbd-8d0d-686736c00e49" ] }, - "ResponseBody": "{\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk4944/providers/Microsoft.Sql/servers/onesdk7380/databases/onesdk882\",\r\n \"name\": \"onesdk882\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"North Central US\",\r\n \"kind\": \"v2.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"2c72e858-00d1-4b82-b060-14e503c17ca2\",\r\n \"edition\": \"Standard\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"S0\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"creationDate\": \"2015-06-11T00:20:43.463Z\",\r\n \"currentServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveId\": \"dd6d99bb-f193-4ec1-86f2-43d3bccbc49c\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"West US\",\r\n \"earliestRestoreDate\": \"2015-06-11T00:21:43.463Z\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"tags\": {\"tag_key\":\"tag_new_value\"},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk4944/providers/Microsoft.Sql/servers/onesdk7380/databases/onesdk882\",\r\n \"name\": \"onesdk882\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"North Central US\",\r\n \"kind\": \"v2.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"2c72e858-00d1-4b82-b060-14e503c17ca2\",\r\n \"edition\": \"Standard\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"S0\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"creationDate\": \"2015-06-11T00:20:43.463Z\",\r\n \"currentServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveId\": \"dd6d99bb-f193-4ec1-86f2-43d3bccbc49c\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"West US\",\r\n \"earliestRestoreDate\": \"2015-06-11T00:21:43.463Z\"\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ "777" @@ -580,7 +580,7 @@ "RequestUri": "/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk4944/providers/Microsoft.Sql/servers/onesdk7380/databases/onesdk882?api-version=2014-04-01", "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMWRjOTE4N2EtOTg2ZC00ODg4LThkY2YtYWYwYmQ0M2RmOTllL3Jlc291cmNlR3JvdXBzL29uZXNkazQ5NDQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9vbmVzZGs3MzgwL2RhdGFiYXNlcy9vbmVzZGs4ODI/YXBpLXZlcnNpb249MjAxNC0wNC0wMQ==", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"edition\": \"Standard\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"requestedServiceObjectiveName\": \"S0\"\r\n },\r\n \"location\": \"North Central US\",\r\n \"tags\": {}\r\n}", + "RequestBody": "{\r\n \"properties\": {\r\n \"edition\": \"Standard\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"requestedServiceObjectiveName\": \"S0\"\r\n },\r\n \"location\": \"North Central US\",\r\n \"tags\": {\"tag_key\":\"tag_new_value\"}\r\n}", "RequestHeaders": { "Content-Type": [ "application/json; charset=utf-8" @@ -595,7 +595,7 @@ "651a5345-b9c5-4f3d-91b2-62fca9883c71" ] }, - "ResponseBody": "{\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk4944/providers/Microsoft.Sql/servers/onesdk7380/databases/onesdk882\",\r\n \"name\": \"onesdk882\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"North Central US\",\r\n \"kind\": \"v2.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"2c72e858-00d1-4b82-b060-14e503c17ca2\",\r\n \"edition\": \"Standard\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"S0\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"creationDate\": \"2015-06-11T00:20:43.463Z\",\r\n \"currentServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"West US\",\r\n \"earliestRestoreDate\": \"2015-06-11T00:21:43.463Z\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"tags\": {\"tag_key\":\"tag_new_value\"},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk4944/providers/Microsoft.Sql/servers/onesdk7380/databases/onesdk882\",\r\n \"name\": \"onesdk882\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"North Central US\",\r\n \"kind\": \"v2.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"2c72e858-00d1-4b82-b060-14e503c17ca2\",\r\n \"edition\": \"Standard\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"S0\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"creationDate\": \"2015-06-11T00:20:43.463Z\",\r\n \"currentServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"West US\",\r\n \"earliestRestoreDate\": \"2015-06-11T00:21:43.463Z\"\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ "777" @@ -643,7 +643,7 @@ "RequestUri": "/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk4944/providers/Microsoft.Sql/servers/onesdk7380/databases/onesdk882?api-version=2014-04-01", "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMWRjOTE4N2EtOTg2ZC00ODg4LThkY2YtYWYwYmQ0M2RmOTllL3Jlc291cmNlR3JvdXBzL29uZXNkazQ5NDQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9vbmVzZGs3MzgwL2RhdGFiYXNlcy9vbmVzZGs4ODI/YXBpLXZlcnNpb249MjAxNC0wNC0wMQ==", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"edition\": \"Basic\",\r\n \"maxSizeBytes\": \"1073741824\",\r\n \"requestedServiceObjectiveName\": \"Basic\"\r\n },\r\n \"location\": \"North Central US\",\r\n \"tags\": {}\r\n}", + "RequestBody": "{\r\n \"properties\": {\r\n \"edition\": \"Basic\",\r\n \"maxSizeBytes\": \"1073741824\",\r\n \"requestedServiceObjectiveName\": \"Basic\"\r\n },\r\n \"location\": \"North Central US\",\r\n \"tags\": {\"tag_key\":\"tag_new_value\"}\r\n}", "RequestHeaders": { "Content-Type": [ "application/json; charset=utf-8" @@ -658,7 +658,7 @@ "e80deb21-bf07-480f-ac2b-8bbe75ed2289" ] }, - "ResponseBody": "{\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk4944/providers/Microsoft.Sql/servers/onesdk7380/databases/onesdk882\",\r\n \"name\": \"onesdk882\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"North Central US\",\r\n \"kind\": \"v2.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"2c72e858-00d1-4b82-b060-14e503c17ca2\",\r\n \"edition\": \"Standard\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"S0\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"creationDate\": \"2015-06-11T00:20:43.463Z\",\r\n \"currentServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveId\": \"dd6d99bb-f193-4ec1-86f2-43d3bccbc49c\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"West US\",\r\n \"earliestRestoreDate\": \"2015-06-11T00:21:43.463Z\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"tags\": {\"tag_key\":\"tag_new_value\"},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk4944/providers/Microsoft.Sql/servers/onesdk7380/databases/onesdk882\",\r\n \"name\": \"onesdk882\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"North Central US\",\r\n \"kind\": \"v2.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"2c72e858-00d1-4b82-b060-14e503c17ca2\",\r\n \"edition\": \"Standard\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"S0\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"creationDate\": \"2015-06-11T00:20:43.463Z\",\r\n \"currentServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveId\": \"dd6d99bb-f193-4ec1-86f2-43d3bccbc49c\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"West US\",\r\n \"earliestRestoreDate\": \"2015-06-11T00:21:43.463Z\"\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ "777" @@ -706,7 +706,7 @@ "RequestUri": "/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk4944/providers/Microsoft.Sql/servers/onesdk7380/databases/onesdk882?api-version=2014-04-01", "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMWRjOTE4N2EtOTg2ZC00ODg4LThkY2YtYWYwYmQ0M2RmOTllL3Jlc291cmNlR3JvdXBzL29uZXNkazQ5NDQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9vbmVzZGs3MzgwL2RhdGFiYXNlcy9vbmVzZGs4ODI/YXBpLXZlcnNpb249MjAxNC0wNC0wMQ==", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"edition\": \"Standard\",\r\n \"maxSizeBytes\": \"107374182400\",\r\n \"requestedServiceObjectiveName\": \"S1\"\r\n },\r\n \"location\": \"North Central US\",\r\n \"tags\": {}\r\n}", + "RequestBody": "{\r\n \"properties\": {\r\n \"edition\": \"Standard\",\r\n \"maxSizeBytes\": \"107374182400\",\r\n \"requestedServiceObjectiveName\": \"S1\"\r\n },\r\n \"location\": \"North Central US\",\r\n \"tags\": {\"tag_key\":\"tag_new_value\"}\r\n}", "RequestHeaders": { "Content-Type": [ "application/json; charset=utf-8" @@ -721,7 +721,7 @@ "c0f12e0c-8270-4e98-8071-327ff555bf66" ] }, - "ResponseBody": "{\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk4944/providers/Microsoft.Sql/servers/onesdk7380/databases/onesdk882\",\r\n \"name\": \"onesdk882\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"North Central US\",\r\n \"kind\": \"v2.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"2c72e858-00d1-4b82-b060-14e503c17ca2\",\r\n \"edition\": \"Basic\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"Basic\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"1073741824\",\r\n \"creationDate\": \"2015-06-11T00:20:43.463Z\",\r\n \"currentServiceObjectiveId\": \"dd6d99bb-f193-4ec1-86f2-43d3bccbc49c\",\r\n \"requestedServiceObjectiveId\": \"1b1ebd4d-d903-4baa-97f9-4ea675f5e928\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"West US\",\r\n \"earliestRestoreDate\": \"2015-06-11T00:21:43.463Z\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"tags\": {\"tag_key\":\"tag_new_value\"},\r\n \"id\": \"/subscriptions/1dc9187a-986d-4888-8dcf-af0bd43df99e/resourceGroups/onesdk4944/providers/Microsoft.Sql/servers/onesdk7380/databases/onesdk882\",\r\n \"name\": \"onesdk882\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"North Central US\",\r\n \"kind\": \"v2.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"2c72e858-00d1-4b82-b060-14e503c17ca2\",\r\n \"edition\": \"Basic\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"Basic\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"1073741824\",\r\n \"creationDate\": \"2015-06-11T00:20:43.463Z\",\r\n \"currentServiceObjectiveId\": \"dd6d99bb-f193-4ec1-86f2-43d3bccbc49c\",\r\n \"requestedServiceObjectiveId\": \"1b1ebd4d-d903-4baa-97f9-4ea675f5e928\",\r\n \"requestedServiceObjectiveName\": null,\r\n \"defaultSecondaryLocation\": \"West US\",\r\n \"earliestRestoreDate\": \"2015-06-11T00:21:43.463Z\"\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ "775" diff --git a/src/ResourceManager/Sql/Commands.Sql/Database/Cmdlet/SetAzureSqlDatabase.cs b/src/ResourceManager/Sql/Commands.Sql/Database/Cmdlet/SetAzureSqlDatabase.cs index a3c7163d6d59..277cdc286425 100644 --- a/src/ResourceManager/Sql/Commands.Sql/Database/Cmdlet/SetAzureSqlDatabase.cs +++ b/src/ResourceManager/Sql/Commands.Sql/Database/Cmdlet/SetAzureSqlDatabase.cs @@ -113,7 +113,7 @@ protected override IEnumerable ApplyUserInputToModel(IEnu Edition = Edition, MaxSizeBytes = MaxSizeBytes, RequestedServiceObjectiveName = RequestedServiceObjectiveName, - Tags = TagsConversionHelper.CreateTagDictionary(Tags, validate: true), + Tags = TagsConversionHelper.ReadOrFetchTags(this, model.FirstOrDefault().Tags), ElasticPoolName = ElasticPoolName, Location = model.FirstOrDefault().Location, }); diff --git a/src/ResourceManager/Sql/Commands.Sql/Database/Model/AzureSqlDatabaseModel.cs b/src/ResourceManager/Sql/Commands.Sql/Database/Model/AzureSqlDatabaseModel.cs index 924ca466ce1c..d9dd8a9d7c5f 100644 --- a/src/ResourceManager/Sql/Commands.Sql/Database/Model/AzureSqlDatabaseModel.cs +++ b/src/ResourceManager/Sql/Commands.Sql/Database/Model/AzureSqlDatabaseModel.cs @@ -14,6 +14,7 @@ using System; using System.Collections.Generic; +using Microsoft.Azure.Commands.ResourceManager.Common.Tags; namespace Microsoft.Azure.Commands.Sql.Database.Model { @@ -148,7 +149,7 @@ public AzureSqlDatabaseModel(string resourceGroup, string serverName, Management MaxSizeBytes = database.Properties.MaxSizeBytes; DatabaseName = database.Name; Status = database.Properties.Status; - Tags = database.Tags as Dictionary; + Tags = TagsConversionHelper.CreateTagDictionary(TagsConversionHelper.CreateTagHashtable(database.Tags), false); ElasticPoolName = database.Properties.ElasticPoolName; Location = database.Location; ResourceId = database.Id; diff --git a/src/ResourceManager/Sql/Commands.Sql/Database/Services/AzureSqlDatabaseAdapter.cs b/src/ResourceManager/Sql/Commands.Sql/Database/Services/AzureSqlDatabaseAdapter.cs index 26514cd42181..5b95b79c0b5c 100644 --- a/src/ResourceManager/Sql/Commands.Sql/Database/Services/AzureSqlDatabaseAdapter.cs +++ b/src/ResourceManager/Sql/Commands.Sql/Database/Services/AzureSqlDatabaseAdapter.cs @@ -133,6 +133,7 @@ internal AzureSqlDatabaseModel UpsertDatabase(string resourceGroup, string serve var resp = Communicator.CreateOrUpdate(resourceGroup, serverName, model.DatabaseName, Util.GenerateTracingId(), new DatabaseCreateOrUpdateParameters() { Location = model.Location, + Tags = model.Tags, Properties = new DatabaseCreateOrUpdateProperties() { Collation = model.CollationName, diff --git a/src/ResourceManager/Sql/Commands.Sql/Elastic Pools/Cmdlet/SetAzureSqlElasticPool.cs b/src/ResourceManager/Sql/Commands.Sql/Elastic Pools/Cmdlet/SetAzureSqlElasticPool.cs index 971c94d33208..51689974c1e5 100644 --- a/src/ResourceManager/Sql/Commands.Sql/Elastic Pools/Cmdlet/SetAzureSqlElasticPool.cs +++ b/src/ResourceManager/Sql/Commands.Sql/Elastic Pools/Cmdlet/SetAzureSqlElasticPool.cs @@ -119,7 +119,7 @@ protected override IEnumerable ApplyUserInputToModel(I { ResourceGroupName = ResourceGroupName, ServerName = ServerName, - Tags = TagsConversionHelper.CreateTagDictionary(Tags, validate: true), + Tags = TagsConversionHelper.ReadOrFetchTags(this, model.FirstOrDefault().Tags), Location = location, ElasticPoolName = ElasticPoolName, DatabaseDtuMax = MyInvocation.BoundParameters.ContainsKey("DatabaseDtuMax") ? (int?)DatabaseDtuMax : null, diff --git a/src/ResourceManager/Sql/Commands.Sql/Elastic Pools/Services/AzureSqlElasticPoolAdapter.cs b/src/ResourceManager/Sql/Commands.Sql/Elastic Pools/Services/AzureSqlElasticPoolAdapter.cs index ca5e9823d67b..79e077de1e32 100644 --- a/src/ResourceManager/Sql/Commands.Sql/Elastic Pools/Services/AzureSqlElasticPoolAdapter.cs +++ b/src/ResourceManager/Sql/Commands.Sql/Elastic Pools/Services/AzureSqlElasticPoolAdapter.cs @@ -22,6 +22,7 @@ using System; using System.Collections.Generic; using System.Linq; +using Microsoft.Azure.Commands.ResourceManager.Common.Tags; namespace Microsoft.Azure.Commands.Sql.ElasticPool.Services { @@ -98,6 +99,7 @@ internal AzureSqlElasticPoolModel UpsertElasticPool(AzureSqlElasticPoolModel mod var resp = Communicator.CreateOrUpdate(model.ResourceGroupName, model.ServerName, model.ElasticPoolName, Util.GenerateTracingId(), new ElasticPoolCreateOrUpdateParameters() { Location = model.Location, + Tags = model.Tags, Properties = new ElasticPoolCreateOrUpdateProperties() { DatabaseDtuMax = model.DatabaseDtuMax, @@ -278,7 +280,7 @@ private AzureSqlElasticPoolModel CreateElasticPoolModelFromResponse(string resou model.Dtu = (int)pool.Properties.Dtu; model.State = pool.Properties.State; model.StorageMB = pool.Properties.StorageMB; - model.Tags = pool.Tags as Dictionary; + model.Tags = TagsConversionHelper.CreateTagDictionary(TagsConversionHelper.CreateTagHashtable(pool.Tags), false); model.Location = pool.Location; DatabaseEdition edition = DatabaseEdition.None; diff --git a/src/ResourceManager/Sql/Commands.Sql/Server/Cmdlet/SetAzureSqlServer.cs b/src/ResourceManager/Sql/Commands.Sql/Server/Cmdlet/SetAzureSqlServer.cs index 38b4ecc1419e..c21d18a94804 100644 --- a/src/ResourceManager/Sql/Commands.Sql/Server/Cmdlet/SetAzureSqlServer.cs +++ b/src/ResourceManager/Sql/Commands.Sql/Server/Cmdlet/SetAzureSqlServer.cs @@ -100,7 +100,7 @@ public override void ExecuteCmdlet() ResourceGroupName = this.ResourceGroupName, ServerName = this.ServerName, SqlAdministratorPassword = this.SqlAdministratorPassword, - Tags = TagsConversionHelper.CreateTagDictionary(Tags, validate: true), + Tags = TagsConversionHelper.ReadOrFetchTags(this, model.FirstOrDefault().Tags), ServerVersion = this.ServerVersion, Location = model.FirstOrDefault().Location, }); diff --git a/src/ResourceManager/Sql/Commands.Sql/Server/Services/AzureSqlServerAdapter.cs b/src/ResourceManager/Sql/Commands.Sql/Server/Services/AzureSqlServerAdapter.cs index a16a149e3868..e11ad30f85f8 100644 --- a/src/ResourceManager/Sql/Commands.Sql/Server/Services/AzureSqlServerAdapter.cs +++ b/src/ResourceManager/Sql/Commands.Sql/Server/Services/AzureSqlServerAdapter.cs @@ -23,6 +23,7 @@ using System.Runtime.InteropServices; using System.Security; using System.Security.Permissions; +using Microsoft.Azure.Commands.ResourceManager.Common.Tags; namespace Microsoft.Azure.Commands.Sql.Server.Adapter { @@ -91,7 +92,7 @@ public AzureSqlServerModel UpsertServer(AzureSqlServerModel model) Properties = new ServerCreateOrUpdateProperties() { AdministratorLogin = model.SqlAdministratorLogin, - AdministratorLoginPassword = Decrypt(model.SqlAdministratorPassword), + AdministratorLoginPassword = model.SqlAdministratorPassword != null ? Decrypt(model.SqlAdministratorPassword) : null, Version = model.ServerVersion, } }); @@ -124,6 +125,7 @@ private static AzureSqlServerModel CreateServerModelFromResponse(string resource server.ServerVersion = resp.Properties.Version; server.SqlAdministratorLogin = resp.Properties.AdministratorLogin; server.Location = resp.Location; + server.Tags = TagsConversionHelper.CreateTagDictionary(TagsConversionHelper.CreateTagHashtable(resp.Tags), false); return server; }