diff --git a/setup/azurecmdfiles.wxi b/setup/azurecmdfiles.wxi index e1a98f246399..9e4186c56098 100644 --- a/setup/azurecmdfiles.wxi +++ b/setup/azurecmdfiles.wxi @@ -404,6 +404,9 @@ + + + @@ -967,6 +970,9 @@ + + + @@ -1074,6 +1080,9 @@ + + + @@ -1296,6 +1305,9 @@ + + + @@ -1569,6 +1581,9 @@ + + + @@ -2101,6 +2116,9 @@ + + + @@ -2431,6 +2449,9 @@ + + + @@ -3131,6 +3152,9 @@ + + + @@ -3538,6 +3562,9 @@ + + + @@ -3928,6 +3955,7 @@ + @@ -4103,6 +4131,7 @@ + @@ -4138,6 +4167,7 @@ + @@ -4210,6 +4240,7 @@ + @@ -4299,6 +4330,7 @@ + @@ -4471,6 +4503,7 @@ + @@ -4579,6 +4612,7 @@ + @@ -4799,6 +4833,7 @@ + @@ -4924,6 +4959,7 @@ + diff --git a/src/Common/Commands.Common/Properties/Resources.Designer.cs b/src/Common/Commands.Common/Properties/Resources.Designer.cs index e6ec99348c7e..9edbb50d6af8 100644 --- a/src/Common/Commands.Common/Properties/Resources.Designer.cs +++ b/src/Common/Commands.Common/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.0 +// Runtime Version:4.0.30319.34014 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -3422,6 +3422,15 @@ public static string SwapWebsiteSlotWarning { } } + /// + /// Looks up a localized string similar to The Switch-AzureMode cmdlet is deprecated and will be removed in a future release.. + /// + public static string SwitchAzureModeDeprecated { + get { + return ResourceManager.GetString("SwitchAzureModeDeprecated", resourceCulture); + } + } + /// /// Looks up a localized string similar to Unable to decode string from base 64. Please make sure the string is correctly encoded: {0}.. /// diff --git a/src/Common/Commands.Common/Properties/Resources.resx b/src/Common/Commands.Common/Properties/Resources.resx index 1416eb73f97a..709da037014d 100644 --- a/src/Common/Commands.Common/Properties/Resources.resx +++ b/src/Common/Commands.Common/Properties/Resources.resx @@ -1358,4 +1358,7 @@ use and privacy statement at <url> and (c) agree to sharing my contact inf Selected profile must not be null. + + The Switch-AzureMode cmdlet is deprecated and will be removed in a future release. + \ No newline at end of file diff --git a/src/Common/Commands.Profile/SwitchAzureMode.cs b/src/Common/Commands.Profile/SwitchAzureMode.cs index 10e8392fb452..099dfef5d1e2 100644 --- a/src/Common/Commands.Profile/SwitchAzureMode.cs +++ b/src/Common/Commands.Profile/SwitchAzureMode.cs @@ -14,6 +14,7 @@ using System; using System.Management.Automation; +using Microsoft.WindowsAzure.Commands.Common.Properties; using Microsoft.WindowsAzure.Commands.Utilities.Common; using Microsoft.Azure.Common.Authentication; @@ -34,6 +35,7 @@ public class SwitchAzureMode : AzurePSCmdlet public override void ExecuteCmdlet() { + WriteWarning(Resources.SwitchAzureModeDeprecated); AzureModule moduleToImport = (AzureModule)Enum.Parse(typeof(AzureModule), Name, false); AzureModule moduleToRemove = moduleToImport == AzureModule.AzureResourceManager ? AzureModule.AzureServiceManagement : AzureModule.AzureResourceManager; RemoveAzureModule(FileUtilities.GetModuleName(moduleToRemove), FileUtilities.GetPSModulePathForModule(moduleToRemove)); diff --git a/src/ResourceManager/Resources/Commands.Resources/AzureResourceManager.psd1 b/src/ResourceManager/Resources/Commands.Resources/AzureResourceManager.psd1 index 5cf0b78a2317..9ca4b0c8d166 100644 --- a/src/ResourceManager/Resources/Commands.Resources/AzureResourceManager.psd1 +++ b/src/ResourceManager/Resources/Commands.Resources/AzureResourceManager.psd1 @@ -108,7 +108,12 @@ CmdletsToExport = '*' VariablesToExport = '*' # Aliases to export from this module -AliasesToExport = @() +AliasesToExport = @( + 'Get-AzureSqlDatabaseServerAuditingPolicy', + 'Remove-AzureSqlDatabaseServerAuditing', + 'Set-AzureSqlDatabaseServerAuditingPolicy', + 'Use-AzureSqlDatabaseServerAuditingPolicy' +) # List of all modules packaged with this module ModuleList = @() diff --git a/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj b/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj index 8e42605dbe46..a53c05713d99 100644 --- a/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj +++ b/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj @@ -257,6 +257,9 @@ PreserveNewest + + PreserveNewest + diff --git a/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/GetAzureLocationCommand.cs b/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/GetAzureLocationCommand.cs index be2596959af5..69834262df57 100644 --- a/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/GetAzureLocationCommand.cs +++ b/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/GetAzureLocationCommand.cs @@ -14,7 +14,10 @@ using System.Collections.Generic; using System.Management.Automation; +using System.Reflection; using Microsoft.Azure.Commands.Resources.Models; +using System.IO; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.Azure.Commands.Resources { @@ -22,11 +25,31 @@ namespace Microsoft.Azure.Commands.Resources /// Get the available locations for certain resource types. /// [Cmdlet(VerbsCommon.Get, "AzureLocation"), OutputType(typeof(List))] - public class GetAzureLocationCommand : ResourcesBaseCmdlet + public class GetAzureLocationCommand : ResourcesBaseCmdlet, IModuleAssemblyInitializer { public override void ExecuteCmdlet() { WriteObject(ResourcesClient.GetLocations(), true); } + + /// + /// Load global aliases for ARM + /// + public void OnImport() + { + try + { + System.Management.Automation.PowerShell invoker = null; + invoker = System.Management.Automation.PowerShell.Create(RunspaceMode.CurrentRunspace); + invoker.AddScript(File.ReadAllText(FileUtilities.GetContentFilePath( + Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), + "ResourceManagerStartup.ps1"))); + invoker.Invoke(); + } + catch + { + // This will throw exception for tests, ignore. + } + } } } \ No newline at end of file diff --git a/src/ResourceManager/Resources/Commands.Resources/ResourceManagerStartup.ps1 b/src/ResourceManager/Resources/Commands.Resources/ResourceManagerStartup.ps1 new file mode 100644 index 000000000000..e7c4b1f41a7c --- /dev/null +++ b/src/ResourceManager/Resources/Commands.Resources/ResourceManagerStartup.ps1 @@ -0,0 +1,21 @@ +# ---------------------------------------------------------------------------------- +# +# Copyright Microsoft Corporation +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ---------------------------------------------------------------------------------- + +@{ + # Sql aliases + "Get-AzureSqlDatabaseServerAuditingPolicy" = "Get-AzureSqlServerAuditingPolicy"; + "Remove-AzureSqlDatabaseServerAuditing" = "Remove-AzureSqlServerAuditing"; + "Set-AzureSqlDatabaseServerAuditingPolicy" = "Set-AzureSqlServerAuditingPolicy"; + "Use-AzureSqlDatabaseServerAuditingPolicy" = "Use-AzureSqlServerAuditingPolicy"; +}.GetEnumerator() | Select @{Name='Name'; Expression={$_.Key}}, @{Name='Value'; Expression={$_.Value}} | New-Alias -Description "AzureAlias" \ No newline at end of file diff --git a/src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/SecurityTests.ps1 b/src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/SecurityTests.ps1 index 7487dc5e7051..eb3e95393c2d 100644 --- a/src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/SecurityTests.ps1 +++ b/src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/SecurityTests.ps1 @@ -55,8 +55,8 @@ function Test-ServerUpdatePolicyWithStorage try { # Test - Set-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount - $policy = Get-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName + Set-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount + $policy = Get-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName # Assert Assert-AreEqual $policy.StorageAccountName $params.storageAccount @@ -117,11 +117,11 @@ function Test-ServerUpdatePolicyKeepPreviousStorage try { # Test - Set-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount - $policyBefore = Get-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName + Set-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount + $policyBefore = Get-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName - Set-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName - $policyAfter = Get-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName + Set-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName + $policyAfter = Get-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName # Assert Assert-AreEqual $policyBefore.StorageAccountName $policyAfter.StorageAccountName @@ -193,15 +193,15 @@ function Test-ServerUpdatePolicyWithEventTypes try { # Test - Set-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -EventType "All" - $policy = Get-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName + Set-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -EventType "All" + $policy = Get-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName # Assert Assert-AreEqual $policy.EventType.Length 15 # Test - Set-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -EventType "PlainSQL_Success","ParameterizedSQL_Success","ParameterizedSQL_Failure" - $policy = Get-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName + Set-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -EventType "PlainSQL_Success","ParameterizedSQL_Success","ParameterizedSQL_Failure" + $policy = Get-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName # Assert Assert-AreEqual $policy.EventType.Length 3 @@ -211,8 +211,8 @@ function Test-ServerUpdatePolicyWithEventTypes # Test - Set-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -EventType "None" - $policy = Get-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName + Set-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -EventType "None" + $policy = Get-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName # Assert Assert-AreEqual $policy.EventType.Length 0 @@ -297,42 +297,42 @@ function Test-ServerUpdatePolicyWithEventTypeShortcuts try { # Test - Set-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -EventType "All" - $policy = Get-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName + Set-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -EventType "All" + $policy = Get-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName # Assert Assert-AreEqual $policy.EventType.Length 15 # Test - Set-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -EventType "All" - $policy = Get-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName + Set-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -EventType "All" + $policy = Get-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName # Assert Assert-AreEqual $policy.EventType.Length 15 # Test - Set-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -EventType "None" - $policy = Get-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName + Set-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -EventType "None" + $policy = Get-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName # Assert Assert-AreEqual $policy.EventType.Length 0 # Test - Set-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -EventType "None" - $policy = Get-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName + Set-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -EventType "None" + $policy = Get-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName # Assert Assert-AreEqual $policy.EventType.Length 0 # Test - Assert-Throws {Set-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -EventType "All", "None"} - Assert-Throws {Set-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -EventType "None", "All"} - Assert-Throws {Set-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -EventType "PlainSQL_Success", "All"} - Assert-Throws {Set-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -EventType "PlainSQL_Success", "None"} + Assert-Throws {Set-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -EventType "All", "None"} + Assert-Throws {Set-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -EventType "None", "All"} + Assert-Throws {Set-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -EventType "PlainSQL_Success", "All"} + Assert-Throws {Set-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -EventType "PlainSQL_Success", "None"} #Test - If the event types includes new events and deprecated events we throw error - Assert-Throws {Set-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -EventType "PlainSQL_Success", "DataAccess"} + Assert-Throws {Set-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -EventType "PlainSQL_Success", "DataAccess"} } finally { @@ -383,9 +383,9 @@ function Test-DisableServerAuditing try { # Test - Set-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount - Remove-AzureSqlDatabaseServerAuditing -ResourceGroupName $params.rgname -ServerName $params.serverName - $policy = Get-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName + Set-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount + Remove-AzureSqlServerAuditing -ResourceGroupName $params.rgname -ServerName $params.serverName + $policy = Get-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName # Assert Assert-AreEqual $policy.AuditState "Disabled" @@ -444,10 +444,10 @@ function Test-ServerDisableEnableKeepProperties try { # Test - Set-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -EventType "TransactionManagement_Success" - Remove-AzureSqlDatabaseServerAuditing -ResourceGroupName $params.rgname -ServerName $params.serverName - Set-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName - $policy = Get-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName + Set-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -EventType "TransactionManagement_Success" + Remove-AzureSqlServerAuditing -ResourceGroupName $params.rgname -ServerName $params.serverName + Set-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName + $policy = Get-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName # Assert Assert-AreEqual $policy.StorageAccountName $params.storageAccount @@ -476,8 +476,8 @@ function Test-UseServerDefault try { # Test - Set-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount - Use-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName + Set-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount + Use-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName $policy = Get-AzureSqlDatabaseAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName # Assert @@ -527,7 +527,7 @@ function Test-FailedServerUpdatePolicyWithNoStorage try { # Assert - Assert-Throws { Set-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverWithoutPolicy} + Assert-Throws { Set-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverWithoutPolicy} } finally { @@ -550,7 +550,7 @@ function Test-FailedUseServerDefault try { # Assert - Assert-Throws { Use-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverWithoutPolicy -DatabaseName $params.databaseWithoutPolicy } + Assert-Throws { Use-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverWithoutPolicy -DatabaseName $params.databaseWithoutPolicy } } finally { @@ -599,10 +599,10 @@ function Test-FailWithBadServerIndentity try { # Assert - Assert-Throws { Get-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName "NONEXISTING-RG" -ServerName $params.serverName } - Assert-Throws { Get-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName "NONEXISTING-SERVER" } - Assert-Throws { Set-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName "NONEXISTING-RG" -ServerName $params.serverName -StorageAccountName $params.storageAccount} - Assert-Throws { Set-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName "NONEXISTING-SERVER" -StorageAccountName $params.storageAccount} + Assert-Throws { Get-AzureSqlServerAuditingPolicy -ResourceGroupName "NONEXISTING-RG" -ServerName $params.serverName } + Assert-Throws { Get-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName "NONEXISTING-SERVER" } + Assert-Throws { Set-AzureSqlServerAuditingPolicy -ResourceGroupName "NONEXISTING-RG" -ServerName $params.serverName -StorageAccountName $params.storageAccount} + Assert-Throws { Set-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName "NONEXISTING-SERVER" -StorageAccountName $params.storageAccount} } finally { @@ -667,22 +667,22 @@ function Test-ServerStorageKeyRotation try { # Test - Set-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -StorageKeyType "Primary" - $policy = Get-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName + Set-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -StorageKeyType "Primary" + $policy = Get-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName # Assert Assert-True { $policy.StorageKeyType -eq "Primary"} # Test - Set-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -StorageKeyType "Secondary" - $policy = Get-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName + Set-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -StorageKeyType "Secondary" + $policy = Get-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName # Assert Assert-True { $policy.StorageKeyType -eq "Secondary"} # Test - Set-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -StorageKeyType "Primary" - $policy = Get-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName + Set-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -StorageKeyType "Primary" + $policy = Get-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName # Assert Assert-True { $policy.StorageKeyType -eq "Primary"} @@ -749,8 +749,8 @@ function Test-ServerUpdatePolicyWithRetention { # Test $retentionTableIdentifier = "retentionTableIdentifier" + $testSuffix; - Set-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -RetentionInDays 10 -TableIdentifier $retentionTableIdentifier; - $policy = Get-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName + Set-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -RetentionInDays 10 -TableIdentifier $retentionTableIdentifier; + $policy = Get-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName # Assert Assert-AreEqual $policy.RetentionInDays 10 @@ -807,10 +807,10 @@ function Test-ServerRetentionKeepProperties { # Test $retentionTableIdentifier = "retentionTableIdentifier" + $testSuffix; - Set-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -RetentionInDays 10 -TableIdentifier $retentionTableIdentifier; + Set-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -RetentionInDays 10 -TableIdentifier $retentionTableIdentifier; - Set-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -RetentionInDays 11; - $policy = Get-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName + Set-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -RetentionInDays 11; + $policy = Get-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName # Assert Assert-AreEqual $policy.RetentionInDays 11 @@ -818,8 +818,8 @@ function Test-ServerRetentionKeepProperties # Test $retentionTableIdentifier = "retentionTableIdentifier1" + $testSuffix; - Set-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -TableIdentifier $retentionTableIdentifier; - $policy = Get-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName + Set-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -TableIdentifier $retentionTableIdentifier; + $policy = Get-AzureSqlServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName # Assert Assert-AreEqual $policy.RetentionInDays 11 diff --git a/src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/ServerCrudTests.ps1 b/src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/ServerCrudTests.ps1 index 5c45662814f9..3aebf522f5e0 100644 --- a/src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/ServerCrudTests.ps1 +++ b/src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/ServerCrudTests.ps1 @@ -30,10 +30,10 @@ function Test-CreateServer try { # With all parameters - $server1 = New-AzureSqlServer -ResourceGroupName $rg.ResourceGroupName -ServerName $serverName -Location $rg.Location -ServerVersion $version -SqlAdminCredentials $credentials + $server1 = New-AzureSqlServer -ResourceGroupName $rg.ResourceGroupName -ServerName $serverName -Location $rg.Location -ServerVersion $version -SqlAdministratorCredentials $credentials Assert-AreEqual $server1.ServerName $serverName Assert-AreEqual $server1.ServerVersion $version - Assert-AreEqual $server1.SqlAdminUserName $serverLogin + Assert-AreEqual $server1.SqlAdministratorLogin $serverLogin } finally { @@ -57,19 +57,19 @@ function Test-UpdateServer $serverPassword = "n3wc00lP@55w0rd" $secureString = ConvertTo-SecureString $serverPassword -AsPlainText -Force - $server1 = Set-AzureSqlServer -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -SqlAdminPassword $secureString + $server1 = Set-AzureSqlServer -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -SqlAdministratorPassword $secureString Assert-AreEqual $server1.ServerName $server.ServerName Assert-AreEqual $server1.ServerVersion $server.ServerVersion - Assert-AreEqual $server1.SqlAdminUserName $server.SqlAdminUserName + Assert-AreEqual $server1.SqlAdministratorLogin $server.SqlAdministratorLogin # Test piping $serverPassword = "n3wc00lP@55w0rd!!!" $secureString = ConvertTo-SecureString $serverPassword -AsPlainText -Force - $server2 = $server | Set-AzureSqlServer -SqlAdminPassword $secureString + $server2 = $server | Set-AzureSqlServer -SqlAdministratorPassword $secureString Assert-AreEqual $server2.ServerName $server.ServerName Assert-AreEqual $server2.ServerVersion $server.ServerVersion - Assert-AreEqual $server2.SqlAdminUserName $server.SqlAdminUserName + Assert-AreEqual $server2.SqlAdministratorLogin $server.SqlAdministratorLogin } finally { @@ -94,13 +94,13 @@ function Test-GetServer $resp1 = Get-AzureSqlServer -ResourceGroupName $rg.ResourceGroupName -ServerName $server1.ServerName Assert-AreEqual $server1.ServerName $resp1.ServerName Assert-AreEqual $server1.ServerVersion $resp1.ServerVersion - Assert-AreEqual $server1.SqlAdminUserName $resp1.SqlAdminUserName + Assert-AreEqual $server1.SqlAdministratorLogin $resp1.SqlAdministratorLogin # Test piping $resp2 = $server2 | Get-AzureSqlServer Assert-AreEqual $server2.ServerName $resp2.ServerName Assert-AreEqual $server2.ServerVersion $resp2.ServerVersion - Assert-AreEqual $server2.SqlAdminUserName $resp2.SqlAdminUserName + Assert-AreEqual $server2.SqlAdministratorLogin $resp2.SqlAdministratorLogin $all = Get-AzureSqlServer -ResourceGroupName $rg.ResourceGroupName Assert-AreEqual $all.Count 2 diff --git a/src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/ServerUpgradeTests.ps1 b/src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/ServerUpgradeTests.ps1 index a523a0387f67..9b3bf621386a 100644 --- a/src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/ServerUpgradeTests.ps1 +++ b/src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/ServerUpgradeTests.ps1 @@ -157,6 +157,6 @@ function Create-ServerForServerUpgradeTest() $serverPassword = "t357ingP@s5w0rd!" $credentials = New-Object System.Management.Automation.PSCredential($serverLogin, ($serverPassword | ConvertTo-SecureString -asPlainText -Force)) - $server = New-AzureSqlServer -ResourceGroupName $rgName -ServerName $serverName -Location $location -ServerVersion $version -SqlAdminCredentials $credentials + $server = New-AzureSqlServer -ResourceGroupName $rgName -ServerName $serverName -Location $location -ServerVersion $version -SqlAdministratorCredentials $credentials return $server } \ No newline at end of file diff --git a/src/ResourceManager/Sql/Commands.Sql.Test/UnitTests/AzureSqlDatabaseServerAttributeTests.cs b/src/ResourceManager/Sql/Commands.Sql.Test/UnitTests/AzureSqlDatabaseServerAttributeTests.cs index 35c97b00a2cf..3781f14bae93 100644 --- a/src/ResourceManager/Sql/Commands.Sql.Test/UnitTests/AzureSqlDatabaseServerAttributeTests.cs +++ b/src/ResourceManager/Sql/Commands.Sql.Test/UnitTests/AzureSqlDatabaseServerAttributeTests.cs @@ -31,7 +31,7 @@ public void NewAzureSqlServerAttributes() UnitTestHelper.CheckConfirmImpact(type, System.Management.Automation.ConfirmImpact.Low); UnitTestHelper.CheckCmdletParameterAttributes(type, "ServerName", isMandatory: true, valueFromPipelineByName: false); - UnitTestHelper.CheckCmdletParameterAttributes(type, "SqlAdminCredentials", isMandatory: true, valueFromPipelineByName: false); + UnitTestHelper.CheckCmdletParameterAttributes(type, "SqlAdministratorCredentials", isMandatory: true, valueFromPipelineByName: false); UnitTestHelper.CheckCmdletParameterAttributes(type, "Tags", isMandatory: false, valueFromPipelineByName: false); UnitTestHelper.CheckCmdletParameterAttributes(type, "ServerVersion", isMandatory: false, valueFromPipelineByName: false); } @@ -45,7 +45,7 @@ public void SetAzureSqlServerAttributes() UnitTestHelper.CheckConfirmImpact(type, System.Management.Automation.ConfirmImpact.Medium); UnitTestHelper.CheckCmdletParameterAttributes(type, "ServerName", isMandatory: true, valueFromPipelineByName: true); - UnitTestHelper.CheckCmdletParameterAttributes(type, "SqlAdminPassword", isMandatory: false, valueFromPipelineByName: false); + UnitTestHelper.CheckCmdletParameterAttributes(type, "SqlAdministratorPassword", isMandatory: false, valueFromPipelineByName: false); UnitTestHelper.CheckCmdletParameterAttributes(type, "Tags", isMandatory: false, valueFromPipelineByName: false); UnitTestHelper.CheckCmdletParameterAttributes(type, "ServerVersion", isMandatory: false, valueFromPipelineByName: false); } diff --git a/src/ResourceManager/Sql/Commands.Sql/Commands.Sql.csproj b/src/ResourceManager/Sql/Commands.Sql/Commands.Sql.csproj index fdb9d37c0801..9021210b4142 100644 --- a/src/ResourceManager/Sql/Commands.Sql/Commands.Sql.csproj +++ b/src/ResourceManager/Sql/Commands.Sql/Commands.Sql.csproj @@ -118,14 +118,14 @@ - + - - + + - + diff --git a/src/ResourceManager/Sql/Commands.Sql/Database/Cmdlet/AzureSqlDatabaseActivityCmdletBase.cs b/src/ResourceManager/Sql/Commands.Sql/Database/Cmdlet/AzureSqlDatabaseActivityCmdletBase.cs index 904e18d9fa7c..87723b27d302 100644 --- a/src/ResourceManager/Sql/Commands.Sql/Database/Cmdlet/AzureSqlDatabaseActivityCmdletBase.cs +++ b/src/ResourceManager/Sql/Commands.Sql/Database/Cmdlet/AzureSqlDatabaseActivityCmdletBase.cs @@ -37,7 +37,7 @@ public abstract class AzureSqlDatabaseActivityCmdletBase /// /// Gets or sets the name of the ElasticPool to use. /// - [Parameter(Mandatory = false, + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the Azure SQL Elastic Pool.")] [ValidateNotNullOrEmpty] @@ -46,7 +46,7 @@ public abstract class AzureSqlDatabaseActivityCmdletBase /// /// Gets or sets the name of the ElasticPool to use. /// - [Parameter(Mandatory = false, + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the Azure SQL Database.")] [ValidateNotNullOrEmpty] diff --git a/src/ResourceManager/Sql/Commands.Sql/Database/Model/AzureSqlDatabaseModel.cs b/src/ResourceManager/Sql/Commands.Sql/Database/Model/AzureSqlDatabaseModel.cs index 2c74ba566248..1459710a0d6b 100644 --- a/src/ResourceManager/Sql/Commands.Sql/Database/Model/AzureSqlDatabaseModel.cs +++ b/src/ResourceManager/Sql/Commands.Sql/Database/Model/AzureSqlDatabaseModel.cs @@ -85,7 +85,7 @@ public class AzureSqlDatabaseModel /// /// Gets or sets the current service objective name /// - public string CurrentServiceLevelObjectiveName { get; set; } + public string CurrentServiceObjectiveName { get; set; } /// /// gets or sets the requested service objective ID diff --git a/src/ResourceManager/Sql/Commands.Sql/Database/Services/AzureSqlDatabaseAdapter.cs b/src/ResourceManager/Sql/Commands.Sql/Database/Services/AzureSqlDatabaseAdapter.cs index 2c27122cd794..c0edf672cb05 100644 --- a/src/ResourceManager/Sql/Commands.Sql/Database/Services/AzureSqlDatabaseAdapter.cs +++ b/src/ResourceManager/Sql/Commands.Sql/Database/Services/AzureSqlDatabaseAdapter.cs @@ -14,10 +14,12 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.Linq; using Microsoft.Azure.Commands.Sql.Common; using Microsoft.Azure.Commands.Sql.Database.Model; using Microsoft.Azure.Commands.Sql.ElasticPool.Services; +using Microsoft.Azure.Commands.Sql.Properties; using Microsoft.Azure.Commands.Sql.Server.Adapter; using Microsoft.Azure.Commands.Sql.Services; using Microsoft.Azure.Common.Authentication.Models; @@ -160,7 +162,7 @@ public static AzureSqlDatabaseModel CreateDatabaseModelFromResponse(string resou model.ServerName = serverName; model.CollationName = database.Properties.Collation; model.CreationDate = database.Properties.CreationDate; - model.CurrentServiceLevelObjectiveName = database.Properties.ServiceObjective; + model.CurrentServiceObjectiveName = database.Properties.ServiceObjective; model.MaxSizeBytes = database.Properties.MaxSizeBytes; model.DatabaseName = database.Name; model.Status = database.Properties.Status; @@ -185,12 +187,10 @@ public static AzureSqlDatabaseModel CreateDatabaseModelFromResponse(string resou internal IEnumerable ListDatabaseActivity(string resourceGroupName, string serverName, string elasticPoolName, string databaseName, Guid? operationId) { - List list = new List(); - if(!string.IsNullOrEmpty(elasticPoolName)) { var response = ElasticPoolCommunicator.ListDatabaseActivity(resourceGroupName, serverName, elasticPoolName, Util.GenerateTracingId()); - list = response.Select((r) => + IEnumerable< AzureSqlDatabaseActivityModel> list = response.Select((r) => { return new AzureSqlDatabaseActivityModel() { @@ -219,14 +219,20 @@ internal IEnumerable ListDatabaseActivity(string } } }; - }).ToList(); + }); + + // Check if we have a database name constraint + if (!string.IsNullOrEmpty(databaseName)) + { + list = list.Where(pl => string.Equals(pl.DatabaseName, databaseName, StringComparison.OrdinalIgnoreCase)); + } + + return list.ToList(); } else { - + throw new NotSupportedException(string.Format(CultureInfo.InvariantCulture, Resources.StandaloneDatabaseActivityNotSupported)); } - - return list; } } } diff --git a/src/ResourceManager/Sql/Commands.Sql/FirewallRule/Cmdlet/RemoveAzureSqlServerFirewallRule.cs b/src/ResourceManager/Sql/Commands.Sql/FirewallRule/Cmdlet/RemoveAzureSqlServerFirewallRule.cs index 16b53ef2708c..7fae7ec81fad 100644 --- a/src/ResourceManager/Sql/Commands.Sql/FirewallRule/Cmdlet/RemoveAzureSqlServerFirewallRule.cs +++ b/src/ResourceManager/Sql/Commands.Sql/FirewallRule/Cmdlet/RemoveAzureSqlServerFirewallRule.cs @@ -81,8 +81,8 @@ public class RemoveAzureSqlServerFirewallRule : AzureSqlServerFirewallRuleCmdlet public override void ExecuteCmdlet() { if (!Force.IsPresent && !ShouldProcess( - string.Format(CultureInfo.InvariantCulture, Resources.RemoveAzureSqlDatabaseServerFirewallRuleDescription, this.FirewallRuleName, this.ServerName), - string.Format(CultureInfo.InvariantCulture, Resources.RemoveAzureSqlDatabaseServerFirewallRuleWarning, this.FirewallRuleName, this.ServerName), + string.Format(CultureInfo.InvariantCulture, Resources.RemoveAzureSqlServerFirewallRuleDescription, this.FirewallRuleName, this.ServerName), + string.Format(CultureInfo.InvariantCulture, Resources.RemoveAzureSqlServerFirewallRuleWarning, this.FirewallRuleName, this.ServerName), Resources.ShouldProcessCaption)) { return; diff --git a/src/ResourceManager/Sql/Commands.Sql/Microsoft.Azure.Commands.Sql.dll-Help.psd1 b/src/ResourceManager/Sql/Commands.Sql/Microsoft.Azure.Commands.Sql.dll-Help.psd1 index f6ee542d13a7..fbd08887e8a9 100644 --- a/src/ResourceManager/Sql/Commands.Sql/Microsoft.Azure.Commands.Sql.dll-Help.psd1 +++ b/src/ResourceManager/Sql/Commands.Sql/Microsoft.Azure.Commands.Sql.dll-Help.psd1 @@ -74,7 +74,7 @@ CmdletsToExport = '*' VariablesToExport = '*' # Aliases to export from this module -AliasesToExport = @() +AliasesToExport = '*' # List of all modules packaged with this module ModuleList = @() diff --git a/src/ResourceManager/Sql/Commands.Sql/Microsoft.Azure.Commands.Sql.dll-Help.xml b/src/ResourceManager/Sql/Commands.Sql/Microsoft.Azure.Commands.Sql.dll-Help.xml index 2fef0d882c03..59e872ee6679 100644 --- a/src/ResourceManager/Sql/Commands.Sql/Microsoft.Azure.Commands.Sql.dll-Help.xml +++ b/src/ResourceManager/Sql/Commands.Sql/Microsoft.Azure.Commands.Sql.dll-Help.xml @@ -1472,7 +1472,7 @@ Switch-AzureMode –Name AzureResourceManager - Get-AzureSqlDatabaseServerAuditingPolicy + Get-AzureSqlServerAuditingPolicy Gets an Azure SQL Server's auditing policy. @@ -1480,18 +1480,18 @@ Switch-AzureMode –Name AzureResourceManager Get - AzureSqlDatabaseServerAuditingPolicy + AzureSqlServerAuditingPolicy - The Get-AzureSqlDatabaseServerAuditingPolicy cmdlet gets the auditing policy of an Azure SQL Server. To use the cmdlet, use the ResourceGroupName and the ServerName parameters to identify the database server. + The Get-AzureSqlServerAuditingPolicy cmdlet gets the auditing policy of an Azure SQL Server. To use the cmdlet, use the ResourceGroupName and the ServerName parameters to identify the database server. Note: This cmdlet can only be executed in Azure Resource Manager mode. To enable Azure Resource Manager mode run the following command: Switch-AzureMode –Name AzureResourceManager For more information, see Using Windows PowerShell with Resource Manager. - Get-AzureSqlDatabaseServerAuditingPolicy + Get-AzureSqlServerAuditingPolicy ServerName @@ -1591,7 +1591,7 @@ Switch-AzureMode –Name AzureResourceManager PS C:\> - PS C:\>Get-AzureSqlDatabaseServerAuditingPolicy –ResourceGroupName "resourcegroup1" –ServerName "server1" + PS C:\>Get-AzureSqlServerAuditingPolicy –ResourceGroupName "resourcegroup1" –ServerName "server1" The following example returns the auditing policy for "server1". @@ -1621,7 +1621,7 @@ Switch-AzureMode –Name AzureResourceManager - Remove-AzureSqlDatabaseServerAuditing + Remove-AzureSqlServerAuditing @@ -1629,11 +1629,11 @@ Switch-AzureMode –Name AzureResourceManager - Set-AzureSqlDatabaseServerAuditingPolicy + Set-AzureSqlServerAuditingPolicy - Use-AzureSqlDatabaseServerAuditingPolicy + Use-AzureSqlServerAuditingPolicy @@ -2351,7 +2351,7 @@ Switch-AzureMode –Name AzureResourceManager - Get-AzureSqlElasticPoolDatabaseActivity + Get-AzureSqlDatabaseActivity @@ -2559,7 +2559,7 @@ Switch-AzureMode –Name AzureResourceManager - Get-AzureSqlElasticPoolDatabaseActivity + Get-AzureSqlDatabaseActivity @@ -4702,7 +4702,7 @@ For the current preview, the edition must be "Standard". - Get-AzureSqlElasticPoolDatabaseActivity + Get-AzureSqlDatabaseActivity @@ -5841,7 +5841,7 @@ Switch-AzureMode –Name AzureResourceManager - Remove-AzureSqlDatabaseServerAuditing + Remove-AzureSqlServerAuditing Disables auditing of all the databases that rely on the auditing policy of the given database server. @@ -5853,14 +5853,14 @@ Switch-AzureMode –Name AzureResourceManager - The Remove-AzureSqlDatabaseServerAuditing cmdlet disables auditing of all the databases that rely on the auditing policy of the given database server. To use the cmdlet, use the ResourceGroupName and ServerName parameters to identify the database server. After the successful execution of the cmdlet, auditing of the database is disabled. If the command succeeds and the PassThru switch is on, it returns an object describing the current auditing policy used as well as the database server identifiers (i.e. ResourceGroupName and ServerName) + The Remove-AzureSqlServerAuditing cmdlet disables auditing of all the databases that rely on the auditing policy of the given database server. To use the cmdlet, use the ResourceGroupName and ServerName parameters to identify the database server. After the successful execution of the cmdlet, auditing of the database is disabled. If the command succeeds and the PassThru switch is on, it returns an object describing the current auditing policy used as well as the database server identifiers (i.e. ResourceGroupName and ServerName) Note: This cmdlet can only be executed in Azure Resource Manager mode. To enable Azure Resource Manager mode run the following command: Switch-AzureMode –Name AzureResourceManager For more information, see Using Windows PowerShell with Resource Manager. - Remove-AzureSqlDatabaseServerAuditing + Remove-AzureSqlServerAuditing PassThru @@ -5979,7 +5979,7 @@ Switch-AzureMode –Name AzureResourceManager PS C:\> - PS C:\>Get-Help Remove-AzureSqlDatabaseServerAuditing -Full + PS C:\>Get-Help Remove-AzureSqlServerAuditing -Full Code Example Description @@ -6235,7 +6235,7 @@ Switch-AzureMode –Name AzureResourceManager - Get-AzureSqlElasticPoolDatabaseActivity + Get-AzureSqlDatabaseActivity @@ -7946,7 +7946,7 @@ Switch-AzureMode –Name AzureResourceManager - Set-AzureSqlDatabaseServerAuditingPolicy + Set-AzureSqlServerAuditingPolicy Sets an Azure SQL Database server's auditing policy. @@ -7954,18 +7954,18 @@ Switch-AzureMode –Name AzureResourceManager Set - AzureSqlDatabaseServerAuditingPolicy + AzureSqlServerAuditingPolicy - The Set-AzureSqlDatabaseServerAuditingPolicy cmdlet changes the auditing policy of an Azure SQL Database server. To use the cmdlet, use the ResourceGroupName and ServerName parameters to identify the database server, the StorageAccountName parameter to specify the storage account to be used for the audit logs and the EventType parameter to define which event types to audit. The auditing policy of a database server apply to all the databases in this server that are marked as using the server's auditing policy, as well as all newly created databases.If the command succeeds and the PassThru switch is on, it returns an object describing the current auditing policy used as well as the server's identifiers (i.e. ResourceGroupName and ServerName). + The Set-AzureSqlServerAuditingPolicy cmdlet changes the auditing policy of an Azure SQL Database server. To use the cmdlet, use the ResourceGroupName and ServerName parameters to identify the database server, the StorageAccountName parameter to specify the storage account to be used for the audit logs and the EventType parameter to define which event types to audit. The auditing policy of a database server apply to all the databases in this server that are marked as using the server's auditing policy, as well as all newly created databases.If the command succeeds and the PassThru switch is on, it returns an object describing the current auditing policy used as well as the server's identifiers (i.e. ResourceGroupName and ServerName). Note: This cmdlet can only be executed in Azure Resource Manager mode. To enable Azure Resource Manager mode run the following command: Switch-AzureMode –Name AzureResourceManager For more information, see Using Windows PowerShell with Resource Manager. - Set-AzureSqlDatabaseServerAuditingPolicy + Set-AzureSqlServerAuditingPolicy PassThru @@ -8181,7 +8181,7 @@ Switch-AzureMode –Name AzureResourceManager PS C:\> - PS C:\>Get-Help Set-AzureSqlDatabaseServerAuditingPolicy + PS C:\>Get-Help Set-AzureSqlServerAuditingPolicy Code Example Description @@ -8684,7 +8684,7 @@ Switch-AzureMode –Name AzureResourceManager - Get-AzureSqlElasticPoolDatabaseActivity + Get-AzureSqlDatabaseActivity @@ -9527,7 +9527,7 @@ Switch-AzureMode –Name AzureResourceManager - Use-AzureSqlDatabaseServerAuditingPolicy + Use-AzureSqlServerAuditingPolicy Marks an Azure SQL Database as using its server's auditing policy. @@ -9535,18 +9535,18 @@ Switch-AzureMode –Name AzureResourceManager Use - AzureSqlDatabaseServerAuditingPolicy + AzureSqlServerAuditingPolicy - The Use-AzureSqlDatabaseServerAuditingPolicy cmdlet marks an Azure SQL Database as using its server's auditing policy. To use the cmdlet, use the ResourceGroupName, ServerName and DatabaseName parameters to identify the database. If no auditing policy was defined already for the database server, this cmdlet would fail. + The Use-AzureSqlServerAuditingPolicy cmdlet marks an Azure SQL Database as using its server's auditing policy. To use the cmdlet, use the ResourceGroupName, ServerName and DatabaseName parameters to identify the database. If no auditing policy was defined already for the database server, this cmdlet would fail. Note: This cmdlet can only be executed in Azure Resource Manager mode. To enable Azure Resource Manager mode run the following command: Switch-AzureMode –Name AzureResourceManager For more information, see Using Windows PowerShell with Resource Manager. - Use-AzureSqlDatabaseServerAuditingPolicy + Use-AzureSqlServerAuditingPolicy PassThru @@ -9710,7 +9710,7 @@ Switch-AzureMode –Name AzureResourceManager - Get-AzureSqlElasticPoolDatabaseActivity + Get-AzureSqlDatabaseActivity Gets the status of database operations in an elastic database pool. @@ -9818,7 +9818,7 @@ Switch-AzureMode –Name AzureResourceManager PS C:\> - PS C:\>Get-AzureSqlElasticPoolDatabaseActivity –ResourceGroupName "resourcegroup1" –ServerName "server1" –ElasticPoolName "elasticpool1" + PS C:\>Get-AzureSqlDatabaseActivity –ResourceGroupName "resourcegroup1" –ServerName "server1" –ElasticPoolName "elasticpool1" The following example returns the operation status of all databases in an elastic pool named "elasticpool1". @@ -9844,7 +9844,7 @@ Switch-AzureMode –Name AzureResourceManager - New-AzureSqlFirewallRule + New-AzureSqlServerFirewallRule Creates a new firewall rule for an Azure SQL Database server. @@ -9856,7 +9856,7 @@ Switch-AzureMode –Name AzureResourceManager - The New-AzureSqlDatabaseServerFirewallRule cmdlet creates a new firewall rule for the specified SQL Database server. + The New-AzureSqlServerFirewallRule cmdlet creates a new firewall rule for the specified SQL Database server. Note: This cmdlet can only be executed in Azure Resource Manager mode. To enable Azure Resource Manager mode run the following command: Switch-AzureMode –Name AzureResourceManager diff --git a/src/ResourceManager/Sql/Commands.Sql/Properties/Resources.Designer.cs b/src/ResourceManager/Sql/Commands.Sql/Properties/Resources.Designer.cs index 5c514033a158..4ac043718151 100644 --- a/src/ResourceManager/Sql/Commands.Sql/Properties/Resources.Designer.cs +++ b/src/ResourceManager/Sql/Commands.Sql/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34014 +// Runtime Version:4.0.30319.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -223,47 +223,47 @@ internal static string RemoveAzureSqlDatabaseElasticPoolWarning { } /// - /// Looks up a localized string similar to Permanently removing Azure Sql Database Server '{0}'.. + /// Looks up a localized string similar to Are you sure you want to remove the Azure Sql Database '{0}' on server '{1}'?. /// - internal static string RemoveAzureSqlDatabaseServerDescription { + internal static string RemoveAzureSqlDatabaseWarning { get { - return ResourceManager.GetString("RemoveAzureSqlDatabaseServerDescription", resourceCulture); + return ResourceManager.GetString("RemoveAzureSqlDatabaseWarning", resourceCulture); } } /// - /// Looks up a localized string similar to Permanently removing Firewall Rule '{0}' for Azure Sql Database Server '{1}'.. + /// Looks up a localized string similar to Permanently removing Azure Sql Database Server '{0}'.. /// - internal static string RemoveAzureSqlDatabaseServerFirewallRuleDescription { + internal static string RemoveAzureSqlServerDescription { get { - return ResourceManager.GetString("RemoveAzureSqlDatabaseServerFirewallRuleDescription", resourceCulture); + return ResourceManager.GetString("RemoveAzureSqlServerDescription", resourceCulture); } } /// - /// Looks up a localized string similar to Are you sure you want to remove the Firewall Rule '{0}' for Azure Sql Database Server '{1}'?. + /// Looks up a localized string similar to Permanently removing Firewall Rule '{0}' for Azure Sql Database Server '{1}'.. /// - internal static string RemoveAzureSqlDatabaseServerFirewallRuleWarning { + internal static string RemoveAzureSqlServerFirewallRuleDescription { get { - return ResourceManager.GetString("RemoveAzureSqlDatabaseServerFirewallRuleWarning", resourceCulture); + return ResourceManager.GetString("RemoveAzureSqlServerFirewallRuleDescription", resourceCulture); } } /// - /// Looks up a localized string similar to Are you sure you want to remove the Azure Sql Database Server '{0}'?. + /// Looks up a localized string similar to Are you sure you want to remove the Firewall Rule '{0}' for Azure Sql Database Server '{1}'?. /// - internal static string RemoveAzureSqlDatabaseServerWarning { + internal static string RemoveAzureSqlServerFirewallRuleWarning { get { - return ResourceManager.GetString("RemoveAzureSqlDatabaseServerWarning", resourceCulture); + return ResourceManager.GetString("RemoveAzureSqlServerFirewallRuleWarning", resourceCulture); } } /// - /// Looks up a localized string similar to Are you sure you want to remove the Azure Sql Database '{0}' on server '{1}'?. + /// Looks up a localized string similar to Are you sure you want to remove the Azure Sql Database Server '{0}'?. /// - internal static string RemoveAzureSqlDatabaseWarning { + internal static string RemoveAzureSqlServerWarning { get { - return ResourceManager.GetString("RemoveAzureSqlDatabaseWarning", resourceCulture); + return ResourceManager.GetString("RemoveAzureSqlServerWarning", resourceCulture); } } @@ -339,6 +339,15 @@ internal static string sqlSampleTitle { } } + /// + /// Looks up a localized string similar to Azure Sql Database Elastic Pool name is required for this operation. + /// + internal static string StandaloneDatabaseActivityNotSupported { + get { + return ResourceManager.GetString("StandaloneDatabaseActivityNotSupported", resourceCulture); + } + } + /// /// Looks up a localized string similar to Stopping upgrade for Azure Sql Database Server '{0}'.. /// diff --git a/src/ResourceManager/Sql/Commands.Sql/Properties/Resources.resx b/src/ResourceManager/Sql/Commands.Sql/Properties/Resources.resx index 444840ee21a0..9dd6332d604c 100644 --- a/src/ResourceManager/Sql/Commands.Sql/Properties/Resources.resx +++ b/src/ResourceManager/Sql/Commands.Sql/Properties/Resources.resx @@ -171,10 +171,10 @@ The rule {0} does not exist - + Permanently removing Azure Sql Database Server '{0}'. - + Are you sure you want to remove the Azure Sql Database Server '{0}'? @@ -192,10 +192,10 @@ Firewall Rule with name: '{0}' already exists for server '{1}'. - + Permanently removing Firewall Rule '{0}' for Azure Sql Database Server '{1}'. - + Are you sure you want to remove the Firewall Rule '{0}' for Azure Sql Database Server '{1}'? @@ -222,4 +222,7 @@ Stopping upgrade for Azure Sql Database Server '{0}'. + + Azure Sql Database Elastic Pool name is required for this operation + \ No newline at end of file diff --git a/src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/GetAzureSqlDatabaseServerAuditingPolicy.cs b/src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/GetAzureSqlServerAuditingPolicy.cs similarity index 84% rename from src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/GetAzureSqlDatabaseServerAuditingPolicy.cs rename to src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/GetAzureSqlServerAuditingPolicy.cs index 24ab4ecabf41..b854ba0ff362 100644 --- a/src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/GetAzureSqlDatabaseServerAuditingPolicy.cs +++ b/src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/GetAzureSqlServerAuditingPolicy.cs @@ -20,8 +20,9 @@ namespace Microsoft.Azure.Commands.Sql.Security.Cmdlet.Auditing /// /// Returns the auditing policy of a specific database server. /// - [Cmdlet(VerbsCommon.Get, "AzureSqlDatabaseServerAuditingPolicy"), OutputType(typeof(ServerAuditingPolicyModel))] - public class GetAzureSqlDatabaseServerAuditingPolicy : SqlDatabaseServerAuditingCmdletBase + [Cmdlet(VerbsCommon.Get, "AzureSqlServerAuditingPolicy"), OutputType(typeof(ServerAuditingPolicyModel))] + [Alias("Get-AzureSqlDatabaseServerAuditingPolicy")] + public class GetAzureSqlServerAuditingPolicy : SqlDatabaseServerAuditingCmdletBase { /// /// No sending is needed as this is a Get cmdlet diff --git a/src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/RemoveSqlDatabaseAuditing.cs b/src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/RemoveSqlDatabaseAuditing.cs index 0a25619ccf61..089a329529c2 100644 --- a/src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/RemoveSqlDatabaseAuditing.cs +++ b/src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/RemoveSqlDatabaseAuditing.cs @@ -21,6 +21,7 @@ namespace Microsoft.Azure.Commands.Sql.Security.Cmdlet.Auditing /// Disables auditing on a specific database. /// [Cmdlet(VerbsCommon.Remove, "AzureSqlDatabaseAuditing"), OutputType(typeof(DatabaseAuditingPolicyModel))] + [Alias("Remove-AzureSqlDatabaseAuditing")] public class RemoveSqlDatabaseAuditing : SqlDatabaseAuditingCmdletBase { /// diff --git a/src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/RemoveSqlDatabaseServerAuditing.cs b/src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/RemoveSqlServerAuditing.cs similarity index 91% rename from src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/RemoveSqlDatabaseServerAuditing.cs rename to src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/RemoveSqlServerAuditing.cs index 4dbc40305c55..0dc30e39d0c1 100644 --- a/src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/RemoveSqlDatabaseServerAuditing.cs +++ b/src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/RemoveSqlServerAuditing.cs @@ -20,8 +20,9 @@ namespace Microsoft.Azure.Commands.Sql.Security.Cmdlet.Auditing /// /// Disables auditing on a specific database server. /// - [Cmdlet(VerbsCommon.Remove, "AzureSqlDatabaseServerAuditing"), OutputType(typeof(ServerAuditingPolicyModel))] - public class RemoveSqlDatabaseServerAuditing : SqlDatabaseServerAuditingCmdletBase + [Cmdlet(VerbsCommon.Remove, "AzureSqlServerAuditing"), OutputType(typeof(ServerAuditingPolicyModel))] + [Alias("Remove-AzureSqlDatabaseServerAuditing")] + public class RemoveSqlServerAuditing : SqlDatabaseServerAuditingCmdletBase { /// /// Defines whether the cmdlets will output the model object at the end of its execution diff --git a/src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/SetAzureSqlDatabaseServerAuditingPolicy.cs b/src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/SetAzureSqlServerAuditingPolicy.cs similarity index 96% rename from src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/SetAzureSqlDatabaseServerAuditingPolicy.cs rename to src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/SetAzureSqlServerAuditingPolicy.cs index 27610fed5b93..98204a3f743c 100644 --- a/src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/SetAzureSqlDatabaseServerAuditingPolicy.cs +++ b/src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/SetAzureSqlServerAuditingPolicy.cs @@ -26,8 +26,9 @@ namespace Microsoft.Azure.Commands.Sql.Security.Cmdlet.Auditing /// /// Sets the auditing policy properties for a specific database server. /// - [Cmdlet(VerbsCommon.Set, "AzureSqlDatabaseServerAuditingPolicy"), OutputType(typeof(ServerAuditingPolicyModel))] - public class SetAzureSqlDatabaseServerAuditingPolicy : SqlDatabaseServerAuditingCmdletBase + [Cmdlet(VerbsCommon.Set, "AzureSqlServerAuditingPolicy"), OutputType(typeof(ServerAuditingPolicyModel))] + [Alias("Set-AzureSqlDatabaseServerAuditingPolicy")] + public class SetAzureSqlServerAuditingPolicy : SqlDatabaseServerAuditingCmdletBase { [Parameter(Mandatory = false)] diff --git a/src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/UseAzureSqlDatabaseServerAuditingPolicy.cs b/src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/UseAzureSqlServerAuditingPolicy.cs similarity index 91% rename from src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/UseAzureSqlDatabaseServerAuditingPolicy.cs rename to src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/UseAzureSqlServerAuditingPolicy.cs index 0a62de00d151..42721d4751f7 100644 --- a/src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/UseAzureSqlDatabaseServerAuditingPolicy.cs +++ b/src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/UseAzureSqlServerAuditingPolicy.cs @@ -22,8 +22,9 @@ namespace Microsoft.Azure.Commands.Sql.Security.Cmdlet.Auditing /// /// Marks the given database as using its server's default policy instead of its own policy. /// - [Cmdlet(VerbsOther.Use, "AzureSqlDatabaseServerAuditingPolicy"), OutputType(typeof(DatabaseAuditingPolicyModel))] - public class UseAzureSqlDatabaseServerAuditingPolicy : SqlDatabaseAuditingCmdletBase + [Cmdlet(VerbsOther.Use, "AzureSqlServerAuditingPolicy"), OutputType(typeof(DatabaseAuditingPolicyModel))] + [Alias("Use-AzureSqlDatabaseServerAuditingPolicy")] + public class UseAzureSqlServerAuditingPolicy : SqlDatabaseAuditingCmdletBase { /// /// Defines whether the cmdlets will output the model object at the end of its execution diff --git a/src/ResourceManager/Sql/Commands.Sql/Server/Cmdlet/NewAzureSqlServer.cs b/src/ResourceManager/Sql/Commands.Sql/Server/Cmdlet/NewAzureSqlServer.cs index f0bf0a013f9c..515a6624f7af 100644 --- a/src/ResourceManager/Sql/Commands.Sql/Server/Cmdlet/NewAzureSqlServer.cs +++ b/src/ResourceManager/Sql/Commands.Sql/Server/Cmdlet/NewAzureSqlServer.cs @@ -41,7 +41,7 @@ public class NewAzureSqlServer : AzureSqlServerCmdletBase [Parameter(Mandatory = true, HelpMessage = "The SQL administrator credentials for the server")] [ValidateNotNull] - public PSCredential SqlAdminCredentials { get; set; } + public PSCredential SqlAdministratorCredentials { get; set; } /// /// The location in which to create the server @@ -108,8 +108,8 @@ public class NewAzureSqlServer : AzureSqlServerCmdletBase ResourceGroupName = this.ResourceGroupName, ServerName = this.ServerName, ServerVersion = this.ServerVersion, - SqlAdminPassword = this.SqlAdminCredentials.Password, - SqlAdminUserName = this.SqlAdminCredentials.UserName, + SqlAdministratorPassword = this.SqlAdministratorCredentials.Password, + SqlAdministratorLogin = this.SqlAdministratorCredentials.UserName, Tags = this.Tags }); return newEntity; diff --git a/src/ResourceManager/Sql/Commands.Sql/Server/Cmdlet/RemoveAzureSqlServer.cs b/src/ResourceManager/Sql/Commands.Sql/Server/Cmdlet/RemoveAzureSqlServer.cs index bbaec6783f0b..6b3d3e39cfc9 100644 --- a/src/ResourceManager/Sql/Commands.Sql/Server/Cmdlet/RemoveAzureSqlServer.cs +++ b/src/ResourceManager/Sql/Commands.Sql/Server/Cmdlet/RemoveAzureSqlServer.cs @@ -81,8 +81,8 @@ public class RemoveAzureSqlServer : AzureSqlServerCmdletBase public override void ExecuteCmdlet() { if (!Force.IsPresent && !ShouldProcess( - string.Format(CultureInfo.InvariantCulture, Resources.RemoveAzureSqlDatabaseServerDescription, this.ServerName), - string.Format(CultureInfo.InvariantCulture, Resources.RemoveAzureSqlDatabaseServerWarning, this.ServerName), + string.Format(CultureInfo.InvariantCulture, Resources.RemoveAzureSqlServerDescription, this.ServerName), + string.Format(CultureInfo.InvariantCulture, Resources.RemoveAzureSqlServerWarning, this.ServerName), Resources.ShouldProcessCaption)) { return; diff --git a/src/ResourceManager/Sql/Commands.Sql/Server/Cmdlet/SetAzureSqlServer.cs b/src/ResourceManager/Sql/Commands.Sql/Server/Cmdlet/SetAzureSqlServer.cs index 3924da750d49..88e2f689867f 100644 --- a/src/ResourceManager/Sql/Commands.Sql/Server/Cmdlet/SetAzureSqlServer.cs +++ b/src/ResourceManager/Sql/Commands.Sql/Server/Cmdlet/SetAzureSqlServer.cs @@ -43,7 +43,7 @@ public class SetAzureSqlServer : AzureSqlServerCmdletBase [Parameter(Mandatory = false, HelpMessage = "The new SQL administrator password for the server.")] [ValidateNotNull] - public SecureString SqlAdminPassword { get; set; } + public SecureString SqlAdministratorPassword { get; set; } /// /// The tags to associate with the server. @@ -89,7 +89,7 @@ public class SetAzureSqlServer : AzureSqlServerCmdletBase { ResourceGroupName = this.ResourceGroupName, ServerName = this.ServerName, - SqlAdminPassword = this.SqlAdminPassword, + SqlAdministratorPassword = this.SqlAdministratorPassword, Tags = this.Tags, ServerVersion = this.ServerVersion, Location = model.FirstOrDefault().Location, diff --git a/src/ResourceManager/Sql/Commands.Sql/Server/Model/AzureSqlServerModel.cs b/src/ResourceManager/Sql/Commands.Sql/Server/Model/AzureSqlServerModel.cs index 5396585c9a3f..ea514c9a28b0 100644 --- a/src/ResourceManager/Sql/Commands.Sql/Server/Model/AzureSqlServerModel.cs +++ b/src/ResourceManager/Sql/Commands.Sql/Server/Model/AzureSqlServerModel.cs @@ -40,12 +40,12 @@ public class AzureSqlServerModel /// /// Gets or sets the sql login credentials for the admin /// - public string SqlAdminUserName { get; set; } + public string SqlAdministratorLogin { get; set; } /// /// Gets or sets the password for the sql admin /// - public SecureString SqlAdminPassword { get; set; } + public SecureString SqlAdministratorPassword { get; set; } /// /// Gets or sets the server version diff --git a/src/ResourceManager/Sql/Commands.Sql/Server/Services/AzureSqlServerAdapter.cs b/src/ResourceManager/Sql/Commands.Sql/Server/Services/AzureSqlServerAdapter.cs index 85ec21ca21a8..9e1ca96a379c 100644 --- a/src/ResourceManager/Sql/Commands.Sql/Server/Services/AzureSqlServerAdapter.cs +++ b/src/ResourceManager/Sql/Commands.Sql/Server/Services/AzureSqlServerAdapter.cs @@ -93,8 +93,8 @@ public AzureSqlServerModel UpsertServer(AzureSqlServerModel model) Tags = model.Tags, Properties = new ServerCreateOrUpdateProperties() { - AdministratorLogin = model.SqlAdminUserName, - AdministratorLoginPassword = Decrypt(model.SqlAdminPassword), + AdministratorLogin = model.SqlAdministratorLogin, + AdministratorLoginPassword = Decrypt(model.SqlAdministratorPassword), Version = model.ServerVersion, } }); @@ -125,7 +125,7 @@ private static AzureSqlServerModel CreateServerModelFromResponse(string resource server.ResourceGroupName = resourceGroupName; server.ServerName = resp.Name; server.ServerVersion = resp.Properties.Version; - server.SqlAdminUserName = resp.Properties.AdministratorLogin; + server.SqlAdministratorLogin = resp.Properties.AdministratorLogin; server.Location = resp.Location; return server;