From 54bab21951ce4c27caf2e1a877abd6292d054f11 Mon Sep 17 00:00:00 2001 From: Amol Agarwal Date: Wed, 26 Aug 2020 18:25:20 -0700 Subject: [PATCH 1/7] * Fix `Disable-AzSqlServerActiveDirectoryOnlyAuthentication` * Added cmdlet `Get-AzSqlServerActiveDirectoryOnlyAuthentication` * Added cmdlet `Enable-AzSqlServerActiveDirectoryOnlyAuthentication` --- .../Properties/Resources.Designer.cs | 2 +- .../Properties/Resources.Designer.cs | 158 +++++++++--------- src/Sql/Sql.Test/Sql.Test.csproj | 2 +- src/Sql/Sql/Az.Sql.psd1 | 4 +- src/Sql/Sql/ChangeLog.md | 2 + ...rverActiveDirectoryAdministratorAdapter.cs | 13 -- ...ctiveDirectoryAdministratorCommunicator.cs | 8 - ...veDirectoryOnlyAuthenticationCmdletBase.cs | 46 +++++ ...ServerActiveDirectoryOnlyAuthentication.cs | 46 +++-- ...ServerActiveDirectoryOnlyAuthentication.cs | 99 +++++++++++ ...ServerActiveDirectoryOnlyAuthentication.cs | 58 +++++++ ...rActiveDirectoryOnlyAuthenticationModel.cs | 39 +++++ ...ctiveDirectoryOnlyAuthenticationAdapter.cs | 113 +++++++++++++ ...DirectoryOnlyAuthenticationCommunicator.cs | 107 ++++++++++++ src/Sql/Sql/Sql.csproj | 2 +- src/Sql/Sql/help/Az.Sql.md | 6 + ...ServerActiveDirectoryOnlyAuthentication.md | 24 +-- 17 files changed, 600 insertions(+), 129 deletions(-) create mode 100644 src/Sql/Sql/ServerActiveDirectoryOnlyAuthentication/Cmdlet/AzureSqlServerActiveDirectoryOnlyAuthenticationCmdletBase.cs rename src/Sql/Sql/{ServerActiveDirectoryAdministrator => ServerActiveDirectoryOnlyAuthentication}/Cmdlet/DisableAzureSqlServerActiveDirectoryOnlyAuthentication.cs (52%) create mode 100644 src/Sql/Sql/ServerActiveDirectoryOnlyAuthentication/Cmdlet/EnableAzureSqlServerActiveDirectoryOnlyAuthentication.cs create mode 100644 src/Sql/Sql/ServerActiveDirectoryOnlyAuthentication/Cmdlet/GetAzureSqlServerActiveDirectoryOnlyAuthentication.cs create mode 100644 src/Sql/Sql/ServerActiveDirectoryOnlyAuthentication/Model/AzureSqlServerActiveDirectoryOnlyAuthenticationModel.cs create mode 100644 src/Sql/Sql/ServerActiveDirectoryOnlyAuthentication/Services/AzureSqlServerActiveDirectoryOnlyAuthenticationAdapter.cs create mode 100644 src/Sql/Sql/ServerActiveDirectoryOnlyAuthentication/Services/AzureSqlServerActiveDirectoryOnlyAuthenticationCommunicator.cs diff --git a/src/Accounts/Authentication.ResourceManager/Properties/Resources.Designer.cs b/src/Accounts/Authentication.ResourceManager/Properties/Resources.Designer.cs index 3b6b3b0f015f..c75e8d3911f2 100644 --- a/src/Accounts/Authentication.ResourceManager/Properties/Resources.Designer.cs +++ b/src/Accounts/Authentication.ResourceManager/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.Commands.Common.Authentication.ResourceManager.Propert // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { diff --git a/src/Accounts/Authentication/Properties/Resources.Designer.cs b/src/Accounts/Authentication/Properties/Resources.Designer.cs index a6e1dcc0edfc..5ea3374e45d8 100644 --- a/src/Accounts/Authentication/Properties/Resources.Designer.cs +++ b/src/Accounts/Authentication/Properties/Resources.Designer.cs @@ -19,10 +19,10 @@ namespace Microsoft.Azure.Commands.Common.Authentication.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class Resources { + internal class Resources { private static global::System.Resources.ResourceManager resourceMan; @@ -36,7 +36,7 @@ internal Resources() { /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager { + internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Azure.Commands.Common.Authentication.Properties.Resources", typeof(Resources).Assembly); @@ -51,7 +51,7 @@ internal Resources() { /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture { + internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } @@ -63,7 +63,7 @@ internal Resources() { /// /// Looks up a localized string similar to Cannot retrieve access token for resource '{0}'. Please ensure that you have provided the appropriate access tokens when using access token login.. /// - public static string AccessTokenResourceNotFound { + internal static string AccessTokenResourceNotFound { get { return ResourceManager.GetString("AccessTokenResourceNotFound", resourceCulture); } @@ -72,7 +72,7 @@ public static string AccessTokenResourceNotFound { /// /// Looks up a localized string similar to Account needs to be specified. /// - public static string AccountNeedsToBeSpecified { + internal static string AccountNeedsToBeSpecified { get { return ResourceManager.GetString("AccountNeedsToBeSpecified", resourceCulture); } @@ -81,16 +81,16 @@ public static string AccountNeedsToBeSpecified { /// /// Looks up a localized string similar to No account was found for this subscription. Please execute Clear-AzureProfile and then execute Add-AzureAccount.. /// - public static string AccountNotFound { + internal static string AccountNotFound { get { return ResourceManager.GetString("AccountNotFound", resourceCulture); } } /// - /// Looks up a localized string similar to [Common.Authentication]: Authenticating using configuration values: Domain: '{0}', Endpoint: '{1}', ClientId: '{2}', ClientRedirect: '{3}', ResourceClientUri: '{4}', ValidateAuthrity: '{5}'. + /// Looks up a localized string similar to [Common.Authentication]: Authenticating using configuration values: Domain: '{0}', Endpoint: '{1}', ClientId: '{2}', ClientRedirect: '{3}', ResourceClientUri: '{4}', ValidateAuthority: '{5}'. /// - public static string AdalAuthConfigurationTrace { + internal static string AdalAuthConfigurationTrace { get { return ResourceManager.GetString("AdalAuthConfigurationTrace", resourceCulture); } @@ -99,7 +99,7 @@ public static string AdalAuthConfigurationTrace { /// /// Looks up a localized string similar to [Common.Authentication]: Received exception {0}, while authenticating.. /// - public static string AdalAuthException { + internal static string AdalAuthException { get { return ResourceManager.GetString("AdalAuthException", resourceCulture); } @@ -108,7 +108,7 @@ public static string AdalAuthException { /// /// Looks up a localized string similar to Multiple tokens were found for this user. Please clear your token cache using, Clear-AzureProfile and try this command again.. /// - public static string AdalMultipleTokens { + internal static string AdalMultipleTokens { get { return ResourceManager.GetString("AdalMultipleTokens", resourceCulture); } @@ -117,7 +117,7 @@ public static string AdalMultipleTokens { /// /// Looks up a localized string similar to User Interaction is required to authenticate this user. Please authenticate using the log in dialog. In PowerShell, execute Connect-AzAccount.. /// - public static string AdalUserInteractionRequired { + internal static string AdalUserInteractionRequired { get { return ResourceManager.GetString("AdalUserInteractionRequired", resourceCulture); } @@ -126,7 +126,7 @@ public static string AdalUserInteractionRequired { /// /// Looks up a localized string similar to No account found in the context. Please login using Connect-AzAccount.. /// - public static string ArmAccountNotFound { + internal static string ArmAccountNotFound { get { return ResourceManager.GetString("ArmAccountNotFound", resourceCulture); } @@ -135,7 +135,7 @@ public static string ArmAccountNotFound { /// /// Looks up a localized string similar to User Interaction is required to authenticate this user. Please execute Connect-AzAccount without parameters and enter your credentials.. /// - public static string ArmUserInteractionRequired { + internal static string ArmUserInteractionRequired { get { return ResourceManager.GetString("ArmUserInteractionRequired", resourceCulture); } @@ -144,7 +144,7 @@ public static string ArmUserInteractionRequired { /// /// Looks up a localized string similar to [Common.Authentication]: Authenticating for account {0} with single tenant {1}. /// - public static string AuthenticatingForSingleTenant { + internal static string AuthenticatingForSingleTenant { get { return ResourceManager.GetString("AuthenticatingForSingleTenant", resourceCulture); } @@ -153,7 +153,7 @@ public static string AuthenticatingForSingleTenant { /// /// Looks up a localized string similar to .Azure. /// - public static string AzureDirectoryName { + internal static string AzureDirectoryName { get { return ResourceManager.GetString("AzureDirectoryName", resourceCulture); } @@ -162,7 +162,7 @@ public static string AzureDirectoryName { /// /// Looks up a localized string similar to Checking Cache request {0}. /// - public static string CacheCheck { + internal static string CacheCheck { get { return ResourceManager.GetString("CacheCheck", resourceCulture); } @@ -171,7 +171,7 @@ public static string CacheCheck { /// /// Looks up a localized string similar to Cache Hit. /// - public static string CacheHit { + internal static string CacheHit { get { return ResourceManager.GetString("CacheHit", resourceCulture); } @@ -180,16 +180,16 @@ public static string CacheHit { /// /// Looks up a localized string similar to No certificate was found in the certificate store with thumbprint {0}. /// - public static string CertificateNotFoundInStore { + internal static string CertificateNotFoundInStore { get { return ResourceManager.GetString("CertificateNotFoundInStore", resourceCulture); } } /// - /// Looks up a localized string similar to Changing public environment is not supported.. + /// Looks up a localized string similar to Changing built-in or discovered environment is not supported.. /// - public static string ChangingDefaultEnvironmentNotSupported { + internal static string ChangingDefaultEnvironmentNotSupported { get { return ResourceManager.GetString("ChangingDefaultEnvironmentNotSupported", resourceCulture); } @@ -198,7 +198,7 @@ public static string ChangingDefaultEnvironmentNotSupported { /// /// Looks up a localized string similar to -Credential parameter can only be used with Organization ID credentials. For more information, please refer to http://go.microsoft.com/fwlink/?linkid=331007&clcid=0x409 for more information about the difference between an organizational account and a Microsoft account.. /// - public static string CredentialOrganizationIdMessage { + internal static string CredentialOrganizationIdMessage { get { return ResourceManager.GetString("CredentialOrganizationIdMessage", resourceCulture); } @@ -207,7 +207,7 @@ public static string CredentialOrganizationIdMessage { /// /// Looks up a localized string similar to Environment name needs to be specified. /// - public static string EnvironmentNameNeedsToBeSpecified { + internal static string EnvironmentNameNeedsToBeSpecified { get { return ResourceManager.GetString("EnvironmentNameNeedsToBeSpecified", resourceCulture); } @@ -216,7 +216,7 @@ public static string EnvironmentNameNeedsToBeSpecified { /// /// Looks up a localized string similar to Environment needs to be specified. /// - public static string EnvironmentNeedsToBeSpecified { + internal static string EnvironmentNeedsToBeSpecified { get { return ResourceManager.GetString("EnvironmentNeedsToBeSpecified", resourceCulture); } @@ -225,7 +225,7 @@ public static string EnvironmentNeedsToBeSpecified { /// /// Looks up a localized string similar to The environment name '{0}' is not found.. /// - public static string EnvironmentNotFound { + internal static string EnvironmentNotFound { get { return ResourceManager.GetString("EnvironmentNotFound", resourceCulture); } @@ -234,7 +234,7 @@ public static string EnvironmentNotFound { /// /// Looks up a localized string similar to Your Microsoft Azure credential in the Windows PowerShell session has expired. Please log in again. In PowerShell, execute Connect-AzAccount.. /// - public static string ExpiredRefreshToken { + internal static string ExpiredRefreshToken { get { return ResourceManager.GetString("ExpiredRefreshToken", resourceCulture); } @@ -243,7 +243,7 @@ public static string ExpiredRefreshToken { /// /// Looks up a localized string similar to File path is not valid. /// - public static string FilePathIsNotValid { + internal static string FilePathIsNotValid { get { return ResourceManager.GetString("FilePathIsNotValid", resourceCulture); } @@ -252,7 +252,7 @@ public static string FilePathIsNotValid { /// /// Looks up a localized string similar to [HttpClientOperations]: Adding Header '{0}'. /// - public static string HttpClientAddingHeader { + internal static string HttpClientAddingHeader { get { return ResourceManager.GetString("HttpClientAddingHeader", resourceCulture); } @@ -261,7 +261,7 @@ public static string HttpClientAddingHeader { /// /// Looks up a localized string similar to [HttpClientOperations {0}]. /// - public static string HttpClientOperationsInvocationId { + internal static string HttpClientOperationsInvocationId { get { return ResourceManager.GetString("HttpClientOperationsInvocationId", resourceCulture); } @@ -270,7 +270,7 @@ public static string HttpClientOperationsInvocationId { /// /// Looks up a localized string similar to Unexpected response status code '{0}' received for request '{{{1} {2}}} Body: {{{3}}}. /// - public static string HttpRequestExceptionMessage { + internal static string HttpRequestExceptionMessage { get { return ResourceManager.GetString("HttpRequestExceptionMessage", resourceCulture); } @@ -279,7 +279,7 @@ public static string HttpRequestExceptionMessage { /// /// Looks up a localized string similar to Illegal characters in path.. /// - public static string IllegalPath { + internal static string IllegalPath { get { return ResourceManager.GetString("IllegalPath", resourceCulture); } @@ -288,7 +288,7 @@ public static string IllegalPath { /// /// Looks up a localized string similar to Your Azure credentials have not been set up or have expired, please run Connect-AzAccount to set up your Azure credentials.. /// - public static string InvalidArmContext { + internal static string InvalidArmContext { get { return ResourceManager.GetString("InvalidArmContext", resourceCulture); } @@ -297,7 +297,7 @@ public static string InvalidArmContext { /// /// Looks up a localized string similar to Invalid certificate format. Publish settings may be corrupted. Use Get-AzurePublishSettingsFile to download updated settings. /// - public static string InvalidCertificate { + internal static string InvalidCertificate { get { return ResourceManager.GetString("InvalidCertificate", resourceCulture); } @@ -306,7 +306,7 @@ public static string InvalidCertificate { /// /// Looks up a localized string similar to Credential type invalid, only handles '{0}'. /// - public static string InvalidCredentialType { + internal static string InvalidCredentialType { get { return ResourceManager.GetString("InvalidCredentialType", resourceCulture); } @@ -315,7 +315,7 @@ public static string InvalidCredentialType { /// /// Looks up a localized string similar to No default subscription has been designated. Use Select-AzureSubscription -Default <subscriptionName> to set the default subscription.. /// - public static string InvalidDefaultSubscription { + internal static string InvalidDefaultSubscription { get { return ResourceManager.GetString("InvalidDefaultSubscription", resourceCulture); } @@ -324,7 +324,7 @@ public static string InvalidDefaultSubscription { /// /// Looks up a localized string similar to "{0}" is an invalid DNS name for {1}. /// - public static string InvalidDnsName { + internal static string InvalidDnsName { get { return ResourceManager.GetString("InvalidDnsName", resourceCulture); } @@ -333,7 +333,7 @@ public static string InvalidDnsName { /// /// Looks up a localized string similar to The provided file in {0} must be have {1} extension. /// - public static string InvalidFileExtension { + internal static string InvalidFileExtension { get { return ResourceManager.GetString("InvalidFileExtension", resourceCulture); } @@ -342,7 +342,7 @@ public static string InvalidFileExtension { /// /// Looks up a localized string similar to No value was specified for the token audience for the graph endpoint in environment '{0}'. Please use Set-AzEnvironment -Name {0} -GraphAudience token-audience-value. /// - public static string InvalidGraphTokenAudience { + internal static string InvalidGraphTokenAudience { get { return ResourceManager.GetString("InvalidGraphTokenAudience", resourceCulture); } @@ -351,7 +351,7 @@ public static string InvalidGraphTokenAudience { /// /// Looks up a localized string similar to Cannot create instance of management client type {0}. It does not have the expected constructor.. /// - public static string InvalidManagementClientType { + internal static string InvalidManagementClientType { get { return ResourceManager.GetString("InvalidManagementClientType", resourceCulture); } @@ -360,7 +360,7 @@ public static string InvalidManagementClientType { /// /// Looks up a localized string similar to No value was specified for the token audience for the management endpoint in environment '{0}'. Please use Set-AzEnvironment -Name {0} -ActiveDirectoryServiceEndpointResourceId token-audience-value. /// - public static string InvalidManagementTokenAudience { + internal static string InvalidManagementTokenAudience { get { return ResourceManager.GetString("InvalidManagementTokenAudience", resourceCulture); } @@ -369,7 +369,7 @@ public static string InvalidManagementTokenAudience { /// /// Looks up a localized string similar to {0} is invalid or empty. /// - public static string InvalidOrEmptyArgumentMessage { + internal static string InvalidOrEmptyArgumentMessage { get { return ResourceManager.GetString("InvalidOrEmptyArgumentMessage", resourceCulture); } @@ -378,7 +378,7 @@ public static string InvalidOrEmptyArgumentMessage { /// /// Looks up a localized string similar to Must specify a non-null subscription name.. /// - public static string InvalidSubscriptionName { + internal static string InvalidSubscriptionName { get { return ResourceManager.GetString("InvalidSubscriptionName", resourceCulture); } @@ -387,7 +387,7 @@ public static string InvalidSubscriptionName { /// /// Looks up a localized string similar to Your Azure credentials have not been set up or have expired, please run Add-AzureAccount to set up your Azure credentials.. /// - public static string InvalidSubscriptionState { + internal static string InvalidSubscriptionState { get { return ResourceManager.GetString("InvalidSubscriptionState", resourceCulture); } @@ -396,7 +396,7 @@ public static string InvalidSubscriptionState { /// /// Looks up a localized string similar to There was an error retrieving the managed service access token for resource '{0}' using the URI '{1}'. Please check that this managed service is configured to emit tokens at this address and that the associated managed service identity has the appropriate role assignment and try logging in again.. /// - public static string MSITokenRequestFailed { + internal static string MSITokenRequestFailed { get { return ResourceManager.GetString("MSITokenRequestFailed", resourceCulture); } @@ -405,7 +405,7 @@ public static string MSITokenRequestFailed { /// /// Looks up a localized string similar to [Common.Authentication]: No matching account record for account {0} in subscription {1}. /// - public static string NoAccountInContext { + internal static string NoAccountInContext { get { return ResourceManager.GetString("NoAccountInContext", resourceCulture); } @@ -414,7 +414,7 @@ public static string NoAccountInContext { /// /// Looks up a localized string similar to [Common.Authentication]: No matching environment record for environment {0} in subscription {1}, using AzureCloud environment instead. /// - public static string NoEnvironmentInContext { + internal static string NoEnvironmentInContext { get { return ResourceManager.GetString("NoEnvironmentInContext", resourceCulture); } @@ -423,7 +423,7 @@ public static string NoEnvironmentInContext { /// /// Looks up a localized string similar to Please connect to internet before executing this cmdlet. /// - public static string NoInternetConnection { + internal static string NoInternetConnection { get { return ResourceManager.GetString("NoInternetConnection", resourceCulture); } @@ -432,7 +432,7 @@ public static string NoInternetConnection { /// /// Looks up a localized string similar to No subscription found in the context. Please ensure that the credentials you provided are authorized to access an Azure subscription, then run Connect-AzAccount to login.. /// - public static string NoSubscriptionInContext { + internal static string NoSubscriptionInContext { get { return ResourceManager.GetString("NoSubscriptionInContext", resourceCulture); } @@ -441,7 +441,7 @@ public static string NoSubscriptionInContext { /// /// Looks up a localized string similar to No tenant found in the context. Please ensure that the credentials you provided are authorized to access an Azure subscription, then run Connect-AzAccount to login.. /// - public static string NoTenantInContext { + internal static string NoTenantInContext { get { return ResourceManager.GetString("NoTenantInContext", resourceCulture); } @@ -450,7 +450,7 @@ public static string NoTenantInContext { /// /// Looks up a localized string similar to Windows Azure Powershell. /// - public static string OldAzureDirectoryName { + internal static string OldAzureDirectoryName { get { return ResourceManager.GetString("OldAzureDirectoryName", resourceCulture); } @@ -459,7 +459,7 @@ public static string OldAzureDirectoryName { /// /// Looks up a localized string similar to Path {0} doesn't exist.. /// - public static string PathDoesNotExist { + internal static string PathDoesNotExist { get { return ResourceManager.GetString("PathDoesNotExist", resourceCulture); } @@ -468,7 +468,7 @@ public static string PathDoesNotExist { /// /// Looks up a localized string similar to Path for {0} doesn't exist in {1}.. /// - public static string PathDoesNotExistForElement { + internal static string PathDoesNotExistForElement { get { return ResourceManager.GetString("PathDoesNotExistForElement", resourceCulture); } @@ -477,16 +477,16 @@ public static string PathDoesNotExistForElement { /// /// Looks up a localized string similar to &whr={0}. /// - public static string PublishSettingsFileRealmFormat { + internal static string PublishSettingsFileRealmFormat { get { return ResourceManager.GetString("PublishSettingsFileRealmFormat", resourceCulture); } } /// - /// Looks up a localized string similar to Removing public environment is not supported.. + /// Looks up a localized string similar to Removing built-in or discovered environment is not supported.. /// - public static string RemovingDefaultEnvironmentsNotSupported { + internal static string RemovingDefaultEnvironmentsNotSupported { get { return ResourceManager.GetString("RemovingDefaultEnvironmentsNotSupported", resourceCulture); } @@ -495,7 +495,7 @@ public static string RemovingDefaultEnvironmentsNotSupported { /// /// Looks up a localized string similar to Unable to retrieve service key for ServicePrincipal account {0}. Please log in again to supply the credentials for this service principal. In PowerShell, execute Connect-AzAccount.. /// - public static string ServiceKeyNotFound { + internal static string ServiceKeyNotFound { get { return ResourceManager.GetString("ServiceKeyNotFound", resourceCulture); } @@ -504,7 +504,7 @@ public static string ServiceKeyNotFound { /// /// Looks up a localized string similar to The provided service name {0} already exists, please pick another name. /// - public static string ServiceNameExists { + internal static string ServiceNameExists { get { return ResourceManager.GetString("ServiceNameExists", resourceCulture); } @@ -513,7 +513,7 @@ public static string ServiceNameExists { /// /// Looks up a localized string similar to [Common.Authentication]: Renewing token using AppId: '{0}', AdalConfiguration with ADDomain: '{1}', AdEndpoint: '{2}', ClientId: '{3}', RedirectUri: '{4}'. /// - public static string SPNRenewTokenTrace { + internal static string SPNRenewTokenTrace { get { return ResourceManager.GetString("SPNRenewTokenTrace", resourceCulture); } @@ -522,7 +522,7 @@ public static string SPNRenewTokenTrace { /// /// Looks up a localized string similar to [Common.Authentication]: Checking token expiration, token expires '{0}' Comparing to '{1}' With threshold '{2}', calculated time until token expiry: '{3}'. /// - public static string SPNTokenExpirationCheckTrace { + internal static string SPNTokenExpirationCheckTrace { get { return ResourceManager.GetString("SPNTokenExpirationCheckTrace", resourceCulture); } @@ -531,7 +531,7 @@ public static string SPNTokenExpirationCheckTrace { /// /// Looks up a localized string similar to The subscription id {0} doesn't exist.. /// - public static string SubscriptionIdNotFoundMessage { + internal static string SubscriptionIdNotFoundMessage { get { return ResourceManager.GetString("SubscriptionIdNotFoundMessage", resourceCulture); } @@ -540,7 +540,7 @@ public static string SubscriptionIdNotFoundMessage { /// /// Looks up a localized string similar to Subscription name needs to be specified. /// - public static string SubscriptionNameNeedsToBeSpecified { + internal static string SubscriptionNameNeedsToBeSpecified { get { return ResourceManager.GetString("SubscriptionNameNeedsToBeSpecified", resourceCulture); } @@ -549,7 +549,7 @@ public static string SubscriptionNameNeedsToBeSpecified { /// /// Looks up a localized string similar to The subscription name {0} doesn't exist.. /// - public static string SubscriptionNameNotFoundMessage { + internal static string SubscriptionNameNotFoundMessage { get { return ResourceManager.GetString("SubscriptionNameNotFoundMessage", resourceCulture); } @@ -558,7 +558,7 @@ public static string SubscriptionNameNotFoundMessage { /// /// Looks up a localized string similar to Subscription needs to be specified. /// - public static string SubscriptionNeedsToBeSpecified { + internal static string SubscriptionNeedsToBeSpecified { get { return ResourceManager.GetString("SubscriptionNeedsToBeSpecified", resourceCulture); } @@ -567,7 +567,7 @@ public static string SubscriptionNeedsToBeSpecified { /// /// Looks up a localized string similar to No tenant was found for this subscription. Please execute Clear-AzureProfile and then execute Add-AzureAccount.. /// - public static string TenantNotFound { + internal static string TenantNotFound { get { return ResourceManager.GetString("TenantNotFound", resourceCulture); } @@ -576,7 +576,7 @@ public static string TenantNotFound { /// /// Looks up a localized string similar to [Common.Authentication]: Parsed token '{0}' with json value '{1}' and decoded issuer '{2}'.. /// - public static string TokenIssuerTrace { + internal static string TokenIssuerTrace { get { return ResourceManager.GetString("TokenIssuerTrace", resourceCulture); } @@ -585,7 +585,7 @@ public static string TokenIssuerTrace { /// /// Looks up a localized string similar to Unable to update mismatching Json structured: {0} {1}.. /// - public static string UnableToPatchJson { + internal static string UnableToPatchJson { get { return ResourceManager.GetString("UnableToPatchJson", resourceCulture); } @@ -594,7 +594,7 @@ public static string UnableToPatchJson { /// /// Looks up a localized string similar to Illegal credential type. /// - public static string UnknownCredentialType { + internal static string UnknownCredentialType { get { return ResourceManager.GetString("UnknownCredentialType", resourceCulture); } @@ -603,7 +603,7 @@ public static string UnknownCredentialType { /// /// Looks up a localized string similar to Certificate authentication is not supported for account type {0}.. /// - public static string UnsupportedCredentialType { + internal static string UnsupportedCredentialType { get { return ResourceManager.GetString("UnsupportedCredentialType", resourceCulture); } @@ -612,7 +612,7 @@ public static string UnsupportedCredentialType { /// /// Looks up a localized string similar to [Common.Authentication]: Acquiring token using AdalConfiguration with Domain: '{0}', AdEndpoint: '{1}', ClientId: '{2}', ClientRedirectUri: {3}. /// - public static string UPNAcquireTokenConfigTrace { + internal static string UPNAcquireTokenConfigTrace { get { return ResourceManager.GetString("UPNAcquireTokenConfigTrace", resourceCulture); } @@ -621,7 +621,7 @@ public static string UPNAcquireTokenConfigTrace { /// /// Looks up a localized string similar to [Common.Authentication]: Acquiring token using context with Authority '{0}', CorrelationId: '{1}', ValidateAuthority: '{2}'. /// - public static string UPNAcquireTokenContextTrace { + internal static string UPNAcquireTokenContextTrace { get { return ResourceManager.GetString("UPNAcquireTokenContextTrace", resourceCulture); } @@ -630,7 +630,7 @@ public static string UPNAcquireTokenContextTrace { /// /// Looks up a localized string similar to [Common.Authentication]: Received token with LoginType '{0}', Tenant: '{1}', UserId: '{2}'. /// - public static string UPNAuthenticationTokenTrace { + internal static string UPNAuthenticationTokenTrace { get { return ResourceManager.GetString("UPNAuthenticationTokenTrace", resourceCulture); } @@ -639,7 +639,7 @@ public static string UPNAuthenticationTokenTrace { /// /// Looks up a localized string similar to [Common.Authentication]: Authenticating using Account: '{0}', environment: '{1}', tenant: '{2}'. /// - public static string UPNAuthenticationTrace { + internal static string UPNAuthenticationTrace { get { return ResourceManager.GetString("UPNAuthenticationTrace", resourceCulture); } @@ -648,7 +648,7 @@ public static string UPNAuthenticationTrace { /// /// Looks up a localized string similar to [Common.Authentication]: Token is expired. /// - public static string UPNExpiredTokenTrace { + internal static string UPNExpiredTokenTrace { get { return ResourceManager.GetString("UPNExpiredTokenTrace", resourceCulture); } @@ -657,7 +657,7 @@ public static string UPNExpiredTokenTrace { /// /// Looks up a localized string similar to [Common.Authentication]: Renewing Token with Type: '{0}', Expiry: '{1}', MultipleResource? '{2}', Tenant: '{3}', UserId: '{4}'. /// - public static string UPNRenewTokenTrace { + internal static string UPNRenewTokenTrace { get { return ResourceManager.GetString("UPNRenewTokenTrace", resourceCulture); } @@ -666,7 +666,7 @@ public static string UPNRenewTokenTrace { /// /// Looks up a localized string similar to [Common.Authentication]: User info for token DisplayId: '{0}', Name: {2} {1}, IdProvider: '{3}', Uid: '{4}'. /// - public static string UPNRenewTokenUserInfoTrace { + internal static string UPNRenewTokenUserInfoTrace { get { return ResourceManager.GetString("UPNRenewTokenUserInfoTrace", resourceCulture); } @@ -675,7 +675,7 @@ public static string UPNRenewTokenUserInfoTrace { /// /// Looks up a localized string similar to [Common.Authentication]: Checking token expiration, token expires '{0}' Comparing to '{1}' With threshold '{2}', calculated time until token expiry: '{3}'. /// - public static string UPNTokenExpirationCheckTrace { + internal static string UPNTokenExpirationCheckTrace { get { return ResourceManager.GetString("UPNTokenExpirationCheckTrace", resourceCulture); } @@ -684,7 +684,7 @@ public static string UPNTokenExpirationCheckTrace { /// /// Looks up a localized string similar to User name is not valid. /// - public static string UserNameIsNotValid { + internal static string UserNameIsNotValid { get { return ResourceManager.GetString("UserNameIsNotValid", resourceCulture); } @@ -693,7 +693,7 @@ public static string UserNameIsNotValid { /// /// Looks up a localized string similar to User name needs to be specified. /// - public static string UserNameNeedsToBeSpecified { + internal static string UserNameNeedsToBeSpecified { get { return ResourceManager.GetString("UserNameNeedsToBeSpecified", resourceCulture); } @@ -702,7 +702,7 @@ public static string UserNameNeedsToBeSpecified { /// /// Looks up a localized string similar to (x86). /// - public static string x86InProgramFiles { + internal static string x86InProgramFiles { get { return ResourceManager.GetString("x86InProgramFiles", resourceCulture); } diff --git a/src/Sql/Sql.Test/Sql.Test.csproj b/src/Sql/Sql.Test/Sql.Test.csproj index d0d7ca5ea11a..caa5c2799b10 100644 --- a/src/Sql/Sql.Test/Sql.Test.csproj +++ b/src/Sql/Sql.Test/Sql.Test.csproj @@ -19,7 +19,7 @@ - + diff --git a/src/Sql/Sql/Az.Sql.psd1 b/src/Sql/Sql/Az.Sql.psd1 index a28a783b6a9d..dea480bb1e51 100644 --- a/src/Sql/Sql/Az.Sql.psd1 +++ b/src/Sql/Sql/Az.Sql.psd1 @@ -259,7 +259,9 @@ CmdletsToExport = 'Get-AzSqlDatabaseTransparentDataEncryption', 'Get-AzSqlInstanceDatabaseBackupLongTermRetentionPolicy', 'Set-AzSqlInstanceDatabaseBackupLongTermRetentionPolicy', 'Disable-AzSqlServerActiveDirectoryOnlyAuthentication', - 'Invoke-AzSqlInstanceFailover' + 'Invoke-AzSqlInstanceFailover', + 'Enable-AzSqlServerActiveDirectoryOnlyAuthentication', + 'Get-AzSqlServerActiveDirectoryOnlyAuthentication' # Variables to export from this module # VariablesToExport = @() diff --git a/src/Sql/Sql/ChangeLog.md b/src/Sql/Sql/ChangeLog.md index 92549aa6764b..71b33c798219 100644 --- a/src/Sql/Sql/ChangeLog.md +++ b/src/Sql/Sql/ChangeLog.md @@ -18,6 +18,8 @@ - Additional information about change #1 --> ## Upcoming Release +* Added cmdlet `Get-AzSqlServerActiveDirectoryOnlyAuthentication` +* Added cmdlet `Enable-AzSqlServerActiveDirectoryOnlyAuthentication` ## Version 2.9.1 * Fixed potential server name case insensitive error in `New-AzSqlServer` and `Set-AzSqlServer` diff --git a/src/Sql/Sql/ServerActiveDirectoryAdministrator/Services/AzureSqlServerActiveDirectoryAdministratorAdapter.cs b/src/Sql/Sql/ServerActiveDirectoryAdministrator/Services/AzureSqlServerActiveDirectoryAdministratorAdapter.cs index 4f1b74a7eaf5..c125770ac555 100644 --- a/src/Sql/Sql/ServerActiveDirectoryAdministrator/Services/AzureSqlServerActiveDirectoryAdministratorAdapter.cs +++ b/src/Sql/Sql/ServerActiveDirectoryAdministrator/Services/AzureSqlServerActiveDirectoryAdministratorAdapter.cs @@ -129,19 +129,6 @@ public void RemoveServerActiveDirectoryAdministrator(string resourceGroupName, s Communicator.Remove(resourceGroupName, serverName); } - /// - /// Disable Azure Active Directory only authentication on a Azure SQL Server - /// - /// The name of the resource group - /// The name of the Azure Sql ServerActiveDirectoryAdministrator Server - /// The upserted Azure SQL Server Active Directory administrator - internal AzureSqlServerActiveDirectoryAdministratorModel DisableAzureADOnlyAuthenticaion(string resourceGroup, string serverName) - { - var resp = Communicator.Disable(resourceGroup, serverName); - - return CreateServerActiveDirectoryAdministratorModelFromResponse(resourceGroup, serverName, resp); - } - /// /// Converts the response from the service to a powershell database object /// diff --git a/src/Sql/Sql/ServerActiveDirectoryAdministrator/Services/AzureSqlServerActiveDirectoryAdministratorCommunicator.cs b/src/Sql/Sql/ServerActiveDirectoryAdministrator/Services/AzureSqlServerActiveDirectoryAdministratorCommunicator.cs index c8c2556733c3..6a14dff5b7fc 100644 --- a/src/Sql/Sql/ServerActiveDirectoryAdministrator/Services/AzureSqlServerActiveDirectoryAdministratorCommunicator.cs +++ b/src/Sql/Sql/ServerActiveDirectoryAdministrator/Services/AzureSqlServerActiveDirectoryAdministratorCommunicator.cs @@ -97,14 +97,6 @@ public void Remove(string resourceGroupName, string serverName) GetCurrentSqlClient().ServerAzureADAdministrators.DeleteWithHttpMessagesAsync(resourceGroupName, serverName); } - /// - /// Disables Azure Active Directory only authentication on a Azure SQL Server - /// - public Management.Sql.Models.ServerAzureADAdministrator Disable(string resourceGroupName, string serverName) - { - return GetCurrentSqlClient().ServerAzureADAdministrators.DisableAzureADOnlyAuthenticationAsync(resourceGroupName, serverName).Result; - } - /// /// Retrieve the SQL Management client for the currently selected subscription, adding the session and request /// id tracing headers for the current cmdlet invocation. diff --git a/src/Sql/Sql/ServerActiveDirectoryOnlyAuthentication/Cmdlet/AzureSqlServerActiveDirectoryOnlyAuthenticationCmdletBase.cs b/src/Sql/Sql/ServerActiveDirectoryOnlyAuthentication/Cmdlet/AzureSqlServerActiveDirectoryOnlyAuthenticationCmdletBase.cs new file mode 100644 index 000000000000..3212c0aaf4f9 --- /dev/null +++ b/src/Sql/Sql/ServerActiveDirectoryOnlyAuthentication/Cmdlet/AzureSqlServerActiveDirectoryOnlyAuthenticationCmdletBase.cs @@ -0,0 +1,46 @@ +// ---------------------------------------------------------------------------------- +// +// 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. +// ---------------------------------------------------------------------------------- + +using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; +using Microsoft.Azure.Commands.Sql.Common; +using Microsoft.Azure.Commands.Sql.ServerActiveDirectoryOnlyAuthentication.Model; +using Microsoft.Azure.Commands.Sql.ServerActiveDirectoryOnlyAuthentication.Services; +using System.Collections.Generic; +using System.Management.Automation; + +namespace Microsoft.Azure.Commands.Sql.ServerActiveDirectoryOnlyAuthentication.Cmdlet +{ + public abstract class AzureSqlServerActiveDirectoryOnlyAuthenticationCmdletBase : AzureSqlCmdletBase, AzureSqlServerActiveDirectoryOnlyAuthenticationAdapter> + { + /// + /// Gets or sets the name of the Azure SQL Server that contains the Azure Active Directory administrator. + /// + [Parameter(Mandatory = true, + ValueFromPipelineByPropertyName = true, + Position = 1, + HelpMessage = "The name of the Azure SQL Server the Azure Active Directory only authentication is in.")] + [ResourceNameCompleter("Microsoft.Sql/servers", "ResourceGroupName")] + [ValidateNotNullOrEmpty] + public string ServerName { get; set; } + + /// + /// Initializes the adapter + /// + /// + protected override AzureSqlServerActiveDirectoryOnlyAuthenticationAdapter InitModelAdapter() + { + return new AzureSqlServerActiveDirectoryOnlyAuthenticationAdapter(DefaultProfile.DefaultContext); + } + } +} diff --git a/src/Sql/Sql/ServerActiveDirectoryAdministrator/Cmdlet/DisableAzureSqlServerActiveDirectoryOnlyAuthentication.cs b/src/Sql/Sql/ServerActiveDirectoryOnlyAuthentication/Cmdlet/DisableAzureSqlServerActiveDirectoryOnlyAuthentication.cs similarity index 52% rename from src/Sql/Sql/ServerActiveDirectoryAdministrator/Cmdlet/DisableAzureSqlServerActiveDirectoryOnlyAuthentication.cs rename to src/Sql/Sql/ServerActiveDirectoryOnlyAuthentication/Cmdlet/DisableAzureSqlServerActiveDirectoryOnlyAuthentication.cs index 4c56c30767c5..07f2b4f6ce0f 100644 --- a/src/Sql/Sql/ServerActiveDirectoryAdministrator/Cmdlet/DisableAzureSqlServerActiveDirectoryOnlyAuthentication.cs +++ b/src/Sql/Sql/ServerActiveDirectoryOnlyAuthentication/Cmdlet/DisableAzureSqlServerActiveDirectoryOnlyAuthentication.cs @@ -12,38 +12,39 @@ // limitations under the License. // ---------------------------------------------------------------------------------- -using Microsoft.Azure.Commands.Sql.ServerActiveDirectoryAdministrator.Model; +using Microsoft.Azure.Commands.Sql.ServerActiveDirectoryOnlyAuthentication.Model; using Microsoft.Rest.Azure; using System; using System.Collections.Generic; using System.Linq; using System.Management.Automation; -namespace Microsoft.Azure.Commands.Sql.ServerActiveDirectoryAdministrator.Cmdlet + +namespace Microsoft.Azure.Commands.Sql.ServerActiveDirectoryOnlyAuthentication.Cmdlet { /// /// Disables the Azure Active Directory only authentication of a specific SQL server. /// [Cmdlet("Disable", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "SqlServerActiveDirectoryOnlyAuthentication", ConfirmImpact = ConfirmImpact.None, SupportsShouldProcess = true)] - [OutputType(typeof(AzureSqlServerActiveDirectoryAdministratorModel))] - public class DisableAzureSqlServerActiveDirectoryOnlyAuthentication : AzureSqlServerActiveDirectoryAdministratorCmdletBase + [OutputType(typeof(AzureSqlServerActiveDirectoryOnlyAuthenticationModel))] + public class DisableAzureSqlServerActiveDirectoryOnlyAuthentication : AzureSqlServerActiveDirectoryOnlyAuthenticationCmdletBase { /// /// Get the entities from the service /// /// The list of entities - protected override IEnumerable GetEntity() + protected override IEnumerable GetEntity() { - List currentActiveDirectoryAdmins = null; + List currentActiveDirectoryOnlyAuthentications = null; try { - AzureSqlServerActiveDirectoryAdministratorModel model = ModelAdapter.GetServerActiveDirectoryAdministrator(this.ResourceGroupName, this.ServerName); + AzureSqlServerActiveDirectoryOnlyAuthenticationModel model = ModelAdapter.GetServerActiveDirectoryOnlyAuthentication(this.ResourceGroupName, this.ServerName); if (model != null) { - currentActiveDirectoryAdmins = new List(); - currentActiveDirectoryAdmins.Add(model); + currentActiveDirectoryOnlyAuthentications = new List(); + currentActiveDirectoryOnlyAuthentications.Add(model); } } catch (CloudException ex) @@ -63,18 +64,35 @@ protected override IEnumerable } } - return currentActiveDirectoryAdmins; + return currentActiveDirectoryOnlyAuthentications; + } + + /// + /// Create the list of models from a list of user input + /// + /// A IEnumerable of models retrieved from service + /// A list of models that was passed in + protected override IEnumerable ApplyUserInputToModel(IEnumerable model) + { + List newEntity = new List(); + newEntity.Add(new AzureSqlServerActiveDirectoryOnlyAuthenticationModel() + { + ResourceGroupName = ResourceGroupName, + ServerName = ServerName, + AzureADOnlyAuthentication = false + }); + return newEntity; } /// - /// Update the Azure SQL Server Active Directory administrator + /// Update the Azure SQL Server Active Directory only authentication /// /// A list of models to update the list /// A list of the persisted entities - protected override IEnumerable PersistChanges(IEnumerable entity) + protected override IEnumerable PersistChanges(IEnumerable entity) { - return new List() { - ModelAdapter.DisableAzureADOnlyAuthenticaion(this.ResourceGroupName, this.ServerName) + return new List() { + ModelAdapter.UpsertAzureADOnlyAuthenticaion(this.ResourceGroupName, this.ServerName, entity.FirstOrDefault()) }; } } diff --git a/src/Sql/Sql/ServerActiveDirectoryOnlyAuthentication/Cmdlet/EnableAzureSqlServerActiveDirectoryOnlyAuthentication.cs b/src/Sql/Sql/ServerActiveDirectoryOnlyAuthentication/Cmdlet/EnableAzureSqlServerActiveDirectoryOnlyAuthentication.cs new file mode 100644 index 000000000000..996104fe4896 --- /dev/null +++ b/src/Sql/Sql/ServerActiveDirectoryOnlyAuthentication/Cmdlet/EnableAzureSqlServerActiveDirectoryOnlyAuthentication.cs @@ -0,0 +1,99 @@ +// ---------------------------------------------------------------------------------- +// +// 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. +// ---------------------------------------------------------------------------------- + +using Microsoft.Azure.Commands.Sql.ServerActiveDirectoryOnlyAuthentication.Model; +using Microsoft.Rest.Azure; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; + + +namespace Microsoft.Azure.Commands.Sql.ServerActiveDirectoryOnlyAuthentication.Cmdlet +{ + /// + /// Disables the Azure Active Directory only authentication of a specific SQL server. + /// + [Cmdlet("Enable", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "SqlServerActiveDirectoryOnlyAuthentication", ConfirmImpact = ConfirmImpact.None, SupportsShouldProcess = true)] + [OutputType(typeof(AzureSqlServerActiveDirectoryOnlyAuthenticationModel))] + public class EnableAzureSqlServerActiveDirectoryOnlyAuthentication : AzureSqlServerActiveDirectoryOnlyAuthenticationCmdletBase + { + /// + /// Get the entities from the service + /// + /// The list of entities + protected override IEnumerable GetEntity() + { + List currentActiveDirectoryOnlyAuthentications = null; + + try + { + AzureSqlServerActiveDirectoryOnlyAuthenticationModel model = ModelAdapter.GetServerActiveDirectoryOnlyAuthentication(this.ResourceGroupName, this.ServerName); + + if (model != null) + { + currentActiveDirectoryOnlyAuthentications = new List(); + currentActiveDirectoryOnlyAuthentications.Add(model); + } + } + catch (CloudException ex) + { + if (ex.Response.StatusCode != System.Net.HttpStatusCode.NotFound) + { + // Unexpected exception encountered + throw; + } + } + catch (Exception ex) + { + if ((ex.InnerException is CloudException ex1) && + ex1.Response.StatusCode != System.Net.HttpStatusCode.NotFound) + { + throw ex.InnerException ?? ex; + } + } + + return currentActiveDirectoryOnlyAuthentications; + } + + /// + /// Create the list of models from a list of user input + /// + /// A IEnumerable of models retrieved from service + /// A list of models that was passed in + protected override IEnumerable ApplyUserInputToModel(IEnumerable model) + { + List newEntity = new List(); + newEntity.Add(new AzureSqlServerActiveDirectoryOnlyAuthenticationModel() + { + ResourceGroupName = ResourceGroupName, + ServerName = ServerName, + AzureADOnlyAuthentication = true + }); + return newEntity; + } + + /// + /// Update the Azure SQL Server Active Directory only authentication + /// + /// A list of models to update the list + /// A list of the persisted entities + protected override IEnumerable PersistChanges(IEnumerable entity) + { + return new List() { + ModelAdapter.UpsertAzureADOnlyAuthenticaion(this.ResourceGroupName, this.ServerName, entity.FirstOrDefault()) + }; + } + } +} diff --git a/src/Sql/Sql/ServerActiveDirectoryOnlyAuthentication/Cmdlet/GetAzureSqlServerActiveDirectoryOnlyAuthentication.cs b/src/Sql/Sql/ServerActiveDirectoryOnlyAuthentication/Cmdlet/GetAzureSqlServerActiveDirectoryOnlyAuthentication.cs new file mode 100644 index 000000000000..6f8868519f80 --- /dev/null +++ b/src/Sql/Sql/ServerActiveDirectoryOnlyAuthentication/Cmdlet/GetAzureSqlServerActiveDirectoryOnlyAuthentication.cs @@ -0,0 +1,58 @@ +// ---------------------------------------------------------------------------------- +// +// 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. +// ---------------------------------------------------------------------------------- + +using Microsoft.Azure.Commands.Sql.ServerActiveDirectoryOnlyAuthentication.Model; +using System.Collections.Generic; +using System.Management.Automation; + +namespace Microsoft.Azure.Commands.Sql.ServerActiveDirectoryOnlyAuthentication.Cmdlet +{ + [Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "SqlServerActiveDirectoryOnlyAuthentication", ConfirmImpact = ConfirmImpact.None, SupportsShouldProcess = true)] + [OutputType(typeof(AzureSqlServerActiveDirectoryOnlyAuthenticationModel))] + public class GetAzureSqlServerActiveDirectoryOnlyAuthentication : AzureSqlServerActiveDirectoryOnlyAuthenticationCmdletBase + { + /// + /// Get the entities from the service + /// + /// The list of entities + protected override IEnumerable GetEntity() + { + ICollection results; + + results = ModelAdapter.ListServerActiveDirectoryOnlyAuthentications(this.ResourceGroupName, this.ServerName); + + return results; + } + + /// + /// No user input to apply to model + /// + /// Model retrieved from service + /// The model that was passed in + protected override IEnumerable ApplyUserInputToModel(IEnumerable model) + { + return model; + } + + /// + /// No changes to persist to server + /// + /// The output of apply user input to model + /// The input entity + protected override IEnumerable PersistChanges(IEnumerable entity) + { + return entity; + } + } +} diff --git a/src/Sql/Sql/ServerActiveDirectoryOnlyAuthentication/Model/AzureSqlServerActiveDirectoryOnlyAuthenticationModel.cs b/src/Sql/Sql/ServerActiveDirectoryOnlyAuthentication/Model/AzureSqlServerActiveDirectoryOnlyAuthenticationModel.cs new file mode 100644 index 000000000000..e085817cbd87 --- /dev/null +++ b/src/Sql/Sql/ServerActiveDirectoryOnlyAuthentication/Model/AzureSqlServerActiveDirectoryOnlyAuthenticationModel.cs @@ -0,0 +1,39 @@ +// ---------------------------------------------------------------------------------- +// +// 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. +// ---------------------------------------------------------------------------------- + +using System; + +namespace Microsoft.Azure.Commands.Sql.ServerActiveDirectoryOnlyAuthentication.Model +{ + /// + /// Represents an Azure SQL Server Active Directory only authentication + /// + public class AzureSqlServerActiveDirectoryOnlyAuthenticationModel + { + /// + /// Gets or sets the name of the resource group + /// + public string ResourceGroupName { get; set; } + + /// + /// Gets or sets the name of the server + /// + public string ServerName { get; set; } + + /// + /// Gets or sets the value to indicate Azure AD Only authentication + /// + public bool AzureADOnlyAuthentication { get; set; } + } +} diff --git a/src/Sql/Sql/ServerActiveDirectoryOnlyAuthentication/Services/AzureSqlServerActiveDirectoryOnlyAuthenticationAdapter.cs b/src/Sql/Sql/ServerActiveDirectoryOnlyAuthentication/Services/AzureSqlServerActiveDirectoryOnlyAuthenticationAdapter.cs new file mode 100644 index 000000000000..e02f410cdd26 --- /dev/null +++ b/src/Sql/Sql/ServerActiveDirectoryOnlyAuthentication/Services/AzureSqlServerActiveDirectoryOnlyAuthenticationAdapter.cs @@ -0,0 +1,113 @@ +// ---------------------------------------------------------------------------------- +// +// 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. +// ---------------------------------------------------------------------------------- + +using Microsoft.Azure.Commands.Common.Authentication.Abstractions; +using Microsoft.Azure.Commands.Sql.ServerActiveDirectoryOnlyAuthentication.Model; +using Microsoft.Azure.Management.Sql.Models; +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Commands.Sql.ServerActiveDirectoryOnlyAuthentication.Services +{ + /// + /// Adapter for Azure SQL Server Active Directory administrator operations + /// + public class AzureSqlServerActiveDirectoryOnlyAuthenticationAdapter + { + /// + /// Gets or sets the AzureSqlServerActiveDirectoryOnlyAuthenticationCommunicator which has all the needed management clients + /// + private AzureSqlServerActiveDirectoryOnlyAuthenticationCommunicator Communicator { get; set; } + + /// + /// Gets or sets the Azure profile + /// + public IAzureContext Context { get; set; } + + /// + /// Constructs a Azure SQL Server Active Directory administrator adapter + /// + /// The current azure profile + /// The current azure subscription + public AzureSqlServerActiveDirectoryOnlyAuthenticationAdapter(IAzureContext context) + { + Context = context; + Communicator = new AzureSqlServerActiveDirectoryOnlyAuthenticationCommunicator(Context); + } + + /// + /// Gets an Azure SQL Server Active Directory only authentication by name. + /// + /// The name of the resource group + /// The name of the Azure SQL Server that contains the Azure Active Directory only authentication + /// The Azure Sql ServerActiveDirectoryAdministrator object + internal AzureSqlServerActiveDirectoryOnlyAuthenticationModel GetServerActiveDirectoryOnlyAuthentication(string resourceGroupName, string serverName) + { + var resp = Communicator.Get(resourceGroupName, serverName); + return CreateServerActiveDirectoryOnlyAuthenticationModelFromResponse(resourceGroupName, serverName, resp); + } + + /// + /// Gets a list of Azure SQL Server Active Directory only authentications. + /// + /// The name of the resource group + /// The name of the Azure SQL Server that contains the Azure Active Directory only authentication + /// A list of Azure SQL Server Active Directory only authentication objects + internal ICollection ListServerActiveDirectoryOnlyAuthentications(string resourceGroupName, string serverName) + { + var resp = Communicator.List(resourceGroupName, serverName); + + return resp.Select((activeDirectoryOnlyAuth) => + { + return CreateServerActiveDirectoryOnlyAuthenticationModelFromResponse(resourceGroupName, serverName, activeDirectoryOnlyAuth); + }).ToList(); + } + + /// + /// Enable\Disable Azure Active Directory only authentication on a Azure SQL Server + /// + /// The name of the resource group + /// The name of the Azure Sql ServerActiveDirectoryAdministrator Server + /// The upserted Azure SQL Server Active Directory administrator + internal AzureSqlServerActiveDirectoryOnlyAuthenticationModel UpsertAzureADOnlyAuthenticaion(string resourceGroup, string serverName, AzureSqlServerActiveDirectoryOnlyAuthenticationModel model) + { + var resp = Communicator.CreateOrUpdate(resourceGroup, serverName, new ServerAzureADOnlyAuthentication(model.AzureADOnlyAuthentication)); + + return CreateServerActiveDirectoryOnlyAuthenticationModelFromResponse(resourceGroup, serverName, resp); + } + + /// + /// Converts the response from the service to a powershell database object + /// + /// The resource group the server is in + /// The name of the Azure Sql ServerActiveDirectoryAdministrator Server + /// The service response + /// The converted model + public static AzureSqlServerActiveDirectoryOnlyAuthenticationModel CreateServerActiveDirectoryOnlyAuthenticationModelFromResponse(string resourceGroup, string serverName, Management.Sql.Models.ServerAzureADOnlyAuthentication serverAzureADOnlyAuthentication) + { + if (serverAzureADOnlyAuthentication != null) + { + AzureSqlServerActiveDirectoryOnlyAuthenticationModel model = new AzureSqlServerActiveDirectoryOnlyAuthenticationModel(); + + model.ResourceGroupName = resourceGroup; + model.ServerName = serverName; + model.AzureADOnlyAuthentication = serverAzureADOnlyAuthentication.AzureADOnlyAuthentication; + return model; + } + + return null; + } + } +} diff --git a/src/Sql/Sql/ServerActiveDirectoryOnlyAuthentication/Services/AzureSqlServerActiveDirectoryOnlyAuthenticationCommunicator.cs b/src/Sql/Sql/ServerActiveDirectoryOnlyAuthentication/Services/AzureSqlServerActiveDirectoryOnlyAuthenticationCommunicator.cs new file mode 100644 index 000000000000..5466700cc8af --- /dev/null +++ b/src/Sql/Sql/ServerActiveDirectoryOnlyAuthentication/Services/AzureSqlServerActiveDirectoryOnlyAuthenticationCommunicator.cs @@ -0,0 +1,107 @@ +// ---------------------------------------------------------------------------------- +// +// 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. +// ---------------------------------------------------------------------------------- + +using Microsoft.Azure.Commands.Common.Authentication; +using Microsoft.Azure.Commands.Common.Authentication.Abstractions; +using Microsoft.Azure.Management.Sql; +using Microsoft.Azure.Management.Sql.Models; +using System.Collections.Generic; + +namespace Microsoft.Azure.Commands.Sql.ServerActiveDirectoryOnlyAuthentication.Services +{ + /// + /// This class is responsible for all the REST communication with the audit REST endpoints + /// + public class AzureSqlServerActiveDirectoryOnlyAuthenticationCommunicator + { + /// + /// The Sql client to be used by this end points communicator + /// + private static SqlManagementClient SqlClient { get; set; } + + /// + /// The Sql client default name for the active directory only authentication + /// + private static string ActiveDirectoryOnlyAuthenticationDefaultName { get { return "Default"; } } + + /// + /// The Sql client default type for the active directory only authentication + /// + private static string ActiveDirectoryOnlyAuthenticationDefaultType { get { return "default"; } } + + /// + /// Gets or set the Azure subscription + /// + private static IAzureSubscription Subscription { get; set; } + + /// + /// Gets or sets the Azure profile + /// + public IAzureContext Context { get; set; } + + /// + /// Creates a communicator for Azure SQL Server Active Directory administrator + /// + /// + /// + public AzureSqlServerActiveDirectoryOnlyAuthenticationCommunicator(IAzureContext context) + { + Context = context; + if (context?.Subscription != Subscription) + { + Subscription = context?.Subscription; + SqlClient = null; + } + } + + /// + /// Gets the Azure SQL Server Active Directory only authentication + /// + public Management.Sql.Models.ServerAzureADOnlyAuthentication Get(string resourceGroupName, string serverName) + { + return GetCurrentSqlClient().ServerAzureADOnlyAuthentications.GetAsync(resourceGroupName, serverName).Result; + } + + /// + /// Disables Azure Active Directory only authentication on a Azure SQL Server + /// + public Management.Sql.Models.ServerAzureADOnlyAuthentication CreateOrUpdate(string resourceGroupName, string serverName, ServerAzureADOnlyAuthentication parameters) + { + return GetCurrentSqlClient().ServerAzureADOnlyAuthentications.CreateOrUpdate(resourceGroupName, serverName, parameters); + } + + /// + /// Lists Azure SQL Server Active Directory only authenctications + /// + public IEnumerable List(string resourceGroupName, string serverName) + { + return GetCurrentSqlClient().ServerAzureADOnlyAuthentications.ListByServer(resourceGroupName, serverName); + } + + /// + /// Retrieve the SQL Management client for the currently selected subscription, adding the session and request + /// id tracing headers for the current cmdlet invocation. + /// + /// The SQL Management client for the currently selected subscription. + private SqlManagementClient GetCurrentSqlClient() + { + // Get the SQL management client for the current subscription + if (SqlClient == null) + { + SqlClient = AzureSession.Instance.ClientFactory.CreateArmClient(Context, AzureEnvironment.Endpoint.ResourceManager); + } + return SqlClient; + } + } +} diff --git a/src/Sql/Sql/Sql.csproj b/src/Sql/Sql/Sql.csproj index a070564762a4..99e3d5abccce 100644 --- a/src/Sql/Sql/Sql.csproj +++ b/src/Sql/Sql/Sql.csproj @@ -21,7 +21,7 @@ - + diff --git a/src/Sql/Sql/help/Az.Sql.md b/src/Sql/Sql/help/Az.Sql.md index 2f980697c867..d422ace5ab88 100644 --- a/src/Sql/Sql/help/Az.Sql.md +++ b/src/Sql/Sql/help/Az.Sql.md @@ -77,6 +77,12 @@ Disables Azure AD only authentication for a specific SQL Server. ### [Disable-AzSqlServerAdvancedDataSecurity](Disable-AzSqlServerAdvancedDataSecurity.md) Disables Advanced Data Security on a server. +### [Enable-AzSqlServerActiveDirectoryOnlyAuthentication](Enable-AzSqlServerActiveDirectoryOnlyAuthentication.md) +Enables Azure AD only authentication for a specific SQL Server. + +### [Get-AzSqlServerActiveDirectoryOnlyAuthentication](Get-AzSqlServerActiveDirectoryOnlyAuthentication.md) +Gets Azure AD only authentication for a specific SQL Server. + ### [Disable-AzSqlServerAdvancedThreatProtection](Disable-AzSqlServerAdvancedThreatProtection.md) Disables Advanced Threat Protection on a server. diff --git a/src/Sql/Sql/help/Disable-AzSqlServerActiveDirectoryOnlyAuthentication.md b/src/Sql/Sql/help/Disable-AzSqlServerActiveDirectoryOnlyAuthentication.md index 9412b526e601..f0a1e265304d 100644 --- a/src/Sql/Sql/help/Disable-AzSqlServerActiveDirectoryOnlyAuthentication.md +++ b/src/Sql/Sql/help/Disable-AzSqlServerActiveDirectoryOnlyAuthentication.md @@ -25,9 +25,9 @@ The **Disable-AzSqlServerActiveDirectoryOnlyAuthentication** cmdlet disables Azu ### Example 1 ```powershell PS C:\>Disable-AzSqlServerActiveDirectoryOnlyAuthentication -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -ResourceGroupName ServerName DisplayName ObjectId IsAzureADOnlyAuthentication +ResourceGroupName ServerName AzureADOnlyAuthentication ----------------- ---------- ----------- -------- ----------- -ResourceGroup01 Server01 DBAs 40b79501-b343-44ed-9ce7-da4c8cc7353b False +ResourceGroup01 Server01 False ``` This command disables Azure Active Directory (Azure AD) only authentication requirement for an AzureSQL server named Server01 that is associated with a resource group named ResourceGroup01. @@ -38,7 +38,7 @@ This command disables Azure Active Directory (Azure AD) only authentication requ The credentials, account, tenant, and subscription used for communication with Azure. ```yaml -Type: IAzureContextContainer +Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer Parameter Sets: (All) Aliases: AzContext, AzureRmContext, AzureCredential @@ -53,7 +53,7 @@ Accept wildcard characters: False The name of the resource group. ```yaml -Type: String +Type: System.String Parameter Sets: (All) Aliases: @@ -65,10 +65,10 @@ Accept wildcard characters: False ``` ### -ServerName -The name of the Azure SQL Server the Azure Active Directory administrator is in. +The name of the Azure SQL Server the Azure Active Directory only authentication is in. ```yaml -Type: String +Type: System.String Parameter Sets: (All) Aliases: @@ -83,7 +83,7 @@ Accept wildcard characters: False Prompts you for confirmation before running the cmdlet. ```yaml -Type: SwitchParameter +Type: System.Management.Automation.SwitchParameter Parameter Sets: (All) Aliases: cf @@ -99,7 +99,7 @@ Shows what would happen if the cmdlet runs. The cmdlet is not run. ```yaml -Type: SwitchParameter +Type: System.Management.Automation.SwitchParameter Parameter Sets: (All) Aliases: wi @@ -119,16 +119,18 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS -### Microsoft.Azure.Commands.Sql.ServerActiveDirectoryAdministrator.Model.AzureSqlServerActiveDirectoryAdministratorModel +### Microsoft.Azure.Commands.Sql.ServerActiveDirectoryAdministrator.Model.AzureSqlServerActiveDirectoryOnlyAuthenticationModel ## NOTES ## RELATED LINKS -[Remove-AzSqlServerActiveDirectoryAdministrator](./Remove-AzSqlServerActiveDirectoryAdministrator.md) +[Enable-AzSqlServerActiveDirectoryOnlyAuthentication](./Enable-AzSqlServerActiveDirectoryOnlyAuthentication.md) + +[Get-AzSqlServerActiveDirectoryOnlyAuthentication](./Get-AzSqlServerActiveDirectoryOnlyAuthentication.md) [Set-AzSqlServerActiveDirectoryAdministrator](./Set-AzSqlServerActiveDirectoryAdministrator.md) [Get-AzSqlServerActiveDirectoryAdministrator](./Get-AzSqlServerActiveDirectoryAdministrator.md) -[SQL Database Documentation](https://docs.microsoft.com/azure/sql-database/) +[SQL Database Documentation](https://docs.microsoft.com/azure/sql-database/) \ No newline at end of file From 7db3a74adae9d64f6f70aacd7cabaf61db21c915 Mon Sep 17 00:00:00 2001 From: Amol Agarwal Date: Wed, 26 Aug 2020 19:47:21 -0700 Subject: [PATCH 2/7] Revert changes in authentication --- .../Properties/Resources.Designer.cs | 4 +- .../Properties/Resources.Designer.cs | 627 +++++++++++------- 2 files changed, 392 insertions(+), 239 deletions(-) diff --git a/src/Accounts/Authentication.ResourceManager/Properties/Resources.Designer.cs b/src/Accounts/Authentication.ResourceManager/Properties/Resources.Designer.cs index c75e8d3911f2..5cfa07047f46 100644 --- a/src/Accounts/Authentication.ResourceManager/Properties/Resources.Designer.cs +++ b/src/Accounts/Authentication.ResourceManager/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.Commands.Common.Authentication.ResourceManager.Propert // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { @@ -259,4 +259,4 @@ internal static string UnwritableStream { } } } -} +} \ No newline at end of file diff --git a/src/Accounts/Authentication/Properties/Resources.Designer.cs b/src/Accounts/Authentication/Properties/Resources.Designer.cs index 5ea3374e45d8..311a7d1a759a 100644 --- a/src/Accounts/Authentication/Properties/Resources.Designer.cs +++ b/src/Accounts/Authentication/Properties/Resources.Designer.cs @@ -8,10 +8,11 @@ // //------------------------------------------------------------------------------ -namespace Microsoft.Azure.Commands.Common.Authentication.Properties { +namespace Microsoft.Azure.Commands.Common.Authentication.Properties +{ using System; - - + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -19,693 +20,845 @@ namespace Microsoft.Azure.Commands.Common.Authentication.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - + public class Resources + { + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { + internal Resources() + { } - + /// /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { + public static global::System.Resources.ResourceManager ResourceManager + { + get + { + if (object.ReferenceEquals(resourceMan, null)) + { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Azure.Commands.Common.Authentication.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { + public static global::System.Globalization.CultureInfo Culture + { + get + { return resourceCulture; } - set { + set + { resourceCulture = value; } } - + /// /// Looks up a localized string similar to Cannot retrieve access token for resource '{0}'. Please ensure that you have provided the appropriate access tokens when using access token login.. /// - internal static string AccessTokenResourceNotFound { - get { + public static string AccessTokenResourceNotFound + { + get + { return ResourceManager.GetString("AccessTokenResourceNotFound", resourceCulture); } } - + /// /// Looks up a localized string similar to Account needs to be specified. /// - internal static string AccountNeedsToBeSpecified { - get { + public static string AccountNeedsToBeSpecified + { + get + { return ResourceManager.GetString("AccountNeedsToBeSpecified", resourceCulture); } } - + /// /// Looks up a localized string similar to No account was found for this subscription. Please execute Clear-AzureProfile and then execute Add-AzureAccount.. /// - internal static string AccountNotFound { - get { + public static string AccountNotFound + { + get + { return ResourceManager.GetString("AccountNotFound", resourceCulture); } } - + /// - /// Looks up a localized string similar to [Common.Authentication]: Authenticating using configuration values: Domain: '{0}', Endpoint: '{1}', ClientId: '{2}', ClientRedirect: '{3}', ResourceClientUri: '{4}', ValidateAuthority: '{5}'. + /// Looks up a localized string similar to [Common.Authentication]: Authenticating using configuration values: Domain: '{0}', Endpoint: '{1}', ClientId: '{2}', ClientRedirect: '{3}', ResourceClientUri: '{4}', ValidateAuthrity: '{5}'. /// - internal static string AdalAuthConfigurationTrace { - get { + public static string AdalAuthConfigurationTrace + { + get + { return ResourceManager.GetString("AdalAuthConfigurationTrace", resourceCulture); } } - + /// /// Looks up a localized string similar to [Common.Authentication]: Received exception {0}, while authenticating.. /// - internal static string AdalAuthException { - get { + public static string AdalAuthException + { + get + { return ResourceManager.GetString("AdalAuthException", resourceCulture); } } - + /// /// Looks up a localized string similar to Multiple tokens were found for this user. Please clear your token cache using, Clear-AzureProfile and try this command again.. /// - internal static string AdalMultipleTokens { - get { + public static string AdalMultipleTokens + { + get + { return ResourceManager.GetString("AdalMultipleTokens", resourceCulture); } } - + /// /// Looks up a localized string similar to User Interaction is required to authenticate this user. Please authenticate using the log in dialog. In PowerShell, execute Connect-AzAccount.. /// - internal static string AdalUserInteractionRequired { - get { + public static string AdalUserInteractionRequired + { + get + { return ResourceManager.GetString("AdalUserInteractionRequired", resourceCulture); } } - + /// /// Looks up a localized string similar to No account found in the context. Please login using Connect-AzAccount.. /// - internal static string ArmAccountNotFound { - get { + public static string ArmAccountNotFound + { + get + { return ResourceManager.GetString("ArmAccountNotFound", resourceCulture); } } - + /// /// Looks up a localized string similar to User Interaction is required to authenticate this user. Please execute Connect-AzAccount without parameters and enter your credentials.. /// - internal static string ArmUserInteractionRequired { - get { + public static string ArmUserInteractionRequired + { + get + { return ResourceManager.GetString("ArmUserInteractionRequired", resourceCulture); } } - + /// /// Looks up a localized string similar to [Common.Authentication]: Authenticating for account {0} with single tenant {1}. /// - internal static string AuthenticatingForSingleTenant { - get { + public static string AuthenticatingForSingleTenant + { + get + { return ResourceManager.GetString("AuthenticatingForSingleTenant", resourceCulture); } } - + /// /// Looks up a localized string similar to .Azure. /// - internal static string AzureDirectoryName { - get { + public static string AzureDirectoryName + { + get + { return ResourceManager.GetString("AzureDirectoryName", resourceCulture); } } - + /// /// Looks up a localized string similar to Checking Cache request {0}. /// - internal static string CacheCheck { - get { + public static string CacheCheck + { + get + { return ResourceManager.GetString("CacheCheck", resourceCulture); } } - + /// /// Looks up a localized string similar to Cache Hit. /// - internal static string CacheHit { - get { + public static string CacheHit + { + get + { return ResourceManager.GetString("CacheHit", resourceCulture); } } - + /// /// Looks up a localized string similar to No certificate was found in the certificate store with thumbprint {0}. /// - internal static string CertificateNotFoundInStore { - get { + public static string CertificateNotFoundInStore + { + get + { return ResourceManager.GetString("CertificateNotFoundInStore", resourceCulture); } } - + /// - /// Looks up a localized string similar to Changing built-in or discovered environment is not supported.. + /// Looks up a localized string similar to Changing public environment is not supported.. /// - internal static string ChangingDefaultEnvironmentNotSupported { - get { + public static string ChangingDefaultEnvironmentNotSupported + { + get + { return ResourceManager.GetString("ChangingDefaultEnvironmentNotSupported", resourceCulture); } } - + /// /// Looks up a localized string similar to -Credential parameter can only be used with Organization ID credentials. For more information, please refer to http://go.microsoft.com/fwlink/?linkid=331007&clcid=0x409 for more information about the difference between an organizational account and a Microsoft account.. /// - internal static string CredentialOrganizationIdMessage { - get { + public static string CredentialOrganizationIdMessage + { + get + { return ResourceManager.GetString("CredentialOrganizationIdMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to Environment name needs to be specified. /// - internal static string EnvironmentNameNeedsToBeSpecified { - get { + public static string EnvironmentNameNeedsToBeSpecified + { + get + { return ResourceManager.GetString("EnvironmentNameNeedsToBeSpecified", resourceCulture); } } - + /// /// Looks up a localized string similar to Environment needs to be specified. /// - internal static string EnvironmentNeedsToBeSpecified { - get { + public static string EnvironmentNeedsToBeSpecified + { + get + { return ResourceManager.GetString("EnvironmentNeedsToBeSpecified", resourceCulture); } } - + /// /// Looks up a localized string similar to The environment name '{0}' is not found.. /// - internal static string EnvironmentNotFound { - get { + public static string EnvironmentNotFound + { + get + { return ResourceManager.GetString("EnvironmentNotFound", resourceCulture); } } - + /// /// Looks up a localized string similar to Your Microsoft Azure credential in the Windows PowerShell session has expired. Please log in again. In PowerShell, execute Connect-AzAccount.. /// - internal static string ExpiredRefreshToken { - get { + public static string ExpiredRefreshToken + { + get + { return ResourceManager.GetString("ExpiredRefreshToken", resourceCulture); } } - + /// /// Looks up a localized string similar to File path is not valid. /// - internal static string FilePathIsNotValid { - get { + public static string FilePathIsNotValid + { + get + { return ResourceManager.GetString("FilePathIsNotValid", resourceCulture); } } - + /// /// Looks up a localized string similar to [HttpClientOperations]: Adding Header '{0}'. /// - internal static string HttpClientAddingHeader { - get { + public static string HttpClientAddingHeader + { + get + { return ResourceManager.GetString("HttpClientAddingHeader", resourceCulture); } } - + /// /// Looks up a localized string similar to [HttpClientOperations {0}]. /// - internal static string HttpClientOperationsInvocationId { - get { + public static string HttpClientOperationsInvocationId + { + get + { return ResourceManager.GetString("HttpClientOperationsInvocationId", resourceCulture); } } - + /// /// Looks up a localized string similar to Unexpected response status code '{0}' received for request '{{{1} {2}}} Body: {{{3}}}. /// - internal static string HttpRequestExceptionMessage { - get { + public static string HttpRequestExceptionMessage + { + get + { return ResourceManager.GetString("HttpRequestExceptionMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to Illegal characters in path.. /// - internal static string IllegalPath { - get { + public static string IllegalPath + { + get + { return ResourceManager.GetString("IllegalPath", resourceCulture); } } - + /// /// Looks up a localized string similar to Your Azure credentials have not been set up or have expired, please run Connect-AzAccount to set up your Azure credentials.. /// - internal static string InvalidArmContext { - get { + public static string InvalidArmContext + { + get + { return ResourceManager.GetString("InvalidArmContext", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid certificate format. Publish settings may be corrupted. Use Get-AzurePublishSettingsFile to download updated settings. /// - internal static string InvalidCertificate { - get { + public static string InvalidCertificate + { + get + { return ResourceManager.GetString("InvalidCertificate", resourceCulture); } } - + /// /// Looks up a localized string similar to Credential type invalid, only handles '{0}'. /// - internal static string InvalidCredentialType { - get { + public static string InvalidCredentialType + { + get + { return ResourceManager.GetString("InvalidCredentialType", resourceCulture); } } - + /// /// Looks up a localized string similar to No default subscription has been designated. Use Select-AzureSubscription -Default <subscriptionName> to set the default subscription.. /// - internal static string InvalidDefaultSubscription { - get { + public static string InvalidDefaultSubscription + { + get + { return ResourceManager.GetString("InvalidDefaultSubscription", resourceCulture); } } - + /// /// Looks up a localized string similar to "{0}" is an invalid DNS name for {1}. /// - internal static string InvalidDnsName { - get { + public static string InvalidDnsName + { + get + { return ResourceManager.GetString("InvalidDnsName", resourceCulture); } } - + /// /// Looks up a localized string similar to The provided file in {0} must be have {1} extension. /// - internal static string InvalidFileExtension { - get { + public static string InvalidFileExtension + { + get + { return ResourceManager.GetString("InvalidFileExtension", resourceCulture); } } - + /// /// Looks up a localized string similar to No value was specified for the token audience for the graph endpoint in environment '{0}'. Please use Set-AzEnvironment -Name {0} -GraphAudience token-audience-value. /// - internal static string InvalidGraphTokenAudience { - get { + public static string InvalidGraphTokenAudience + { + get + { return ResourceManager.GetString("InvalidGraphTokenAudience", resourceCulture); } } - + /// /// Looks up a localized string similar to Cannot create instance of management client type {0}. It does not have the expected constructor.. /// - internal static string InvalidManagementClientType { - get { + public static string InvalidManagementClientType + { + get + { return ResourceManager.GetString("InvalidManagementClientType", resourceCulture); } } - + /// /// Looks up a localized string similar to No value was specified for the token audience for the management endpoint in environment '{0}'. Please use Set-AzEnvironment -Name {0} -ActiveDirectoryServiceEndpointResourceId token-audience-value. /// - internal static string InvalidManagementTokenAudience { - get { + public static string InvalidManagementTokenAudience + { + get + { return ResourceManager.GetString("InvalidManagementTokenAudience", resourceCulture); } } - + /// /// Looks up a localized string similar to {0} is invalid or empty. /// - internal static string InvalidOrEmptyArgumentMessage { - get { + public static string InvalidOrEmptyArgumentMessage + { + get + { return ResourceManager.GetString("InvalidOrEmptyArgumentMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to Must specify a non-null subscription name.. /// - internal static string InvalidSubscriptionName { - get { + public static string InvalidSubscriptionName + { + get + { return ResourceManager.GetString("InvalidSubscriptionName", resourceCulture); } } - + /// /// Looks up a localized string similar to Your Azure credentials have not been set up or have expired, please run Add-AzureAccount to set up your Azure credentials.. /// - internal static string InvalidSubscriptionState { - get { + public static string InvalidSubscriptionState + { + get + { return ResourceManager.GetString("InvalidSubscriptionState", resourceCulture); } } - + /// /// Looks up a localized string similar to There was an error retrieving the managed service access token for resource '{0}' using the URI '{1}'. Please check that this managed service is configured to emit tokens at this address and that the associated managed service identity has the appropriate role assignment and try logging in again.. /// - internal static string MSITokenRequestFailed { - get { + public static string MSITokenRequestFailed + { + get + { return ResourceManager.GetString("MSITokenRequestFailed", resourceCulture); } } - + /// /// Looks up a localized string similar to [Common.Authentication]: No matching account record for account {0} in subscription {1}. /// - internal static string NoAccountInContext { - get { + public static string NoAccountInContext + { + get + { return ResourceManager.GetString("NoAccountInContext", resourceCulture); } } - + /// /// Looks up a localized string similar to [Common.Authentication]: No matching environment record for environment {0} in subscription {1}, using AzureCloud environment instead. /// - internal static string NoEnvironmentInContext { - get { + public static string NoEnvironmentInContext + { + get + { return ResourceManager.GetString("NoEnvironmentInContext", resourceCulture); } } - + /// /// Looks up a localized string similar to Please connect to internet before executing this cmdlet. /// - internal static string NoInternetConnection { - get { + public static string NoInternetConnection + { + get + { return ResourceManager.GetString("NoInternetConnection", resourceCulture); } } - + /// /// Looks up a localized string similar to No subscription found in the context. Please ensure that the credentials you provided are authorized to access an Azure subscription, then run Connect-AzAccount to login.. /// - internal static string NoSubscriptionInContext { - get { + public static string NoSubscriptionInContext + { + get + { return ResourceManager.GetString("NoSubscriptionInContext", resourceCulture); } } - + /// /// Looks up a localized string similar to No tenant found in the context. Please ensure that the credentials you provided are authorized to access an Azure subscription, then run Connect-AzAccount to login.. /// - internal static string NoTenantInContext { - get { + public static string NoTenantInContext + { + get + { return ResourceManager.GetString("NoTenantInContext", resourceCulture); } } - + /// /// Looks up a localized string similar to Windows Azure Powershell. /// - internal static string OldAzureDirectoryName { - get { + public static string OldAzureDirectoryName + { + get + { return ResourceManager.GetString("OldAzureDirectoryName", resourceCulture); } } - + /// /// Looks up a localized string similar to Path {0} doesn't exist.. /// - internal static string PathDoesNotExist { - get { + public static string PathDoesNotExist + { + get + { return ResourceManager.GetString("PathDoesNotExist", resourceCulture); } } - + /// /// Looks up a localized string similar to Path for {0} doesn't exist in {1}.. /// - internal static string PathDoesNotExistForElement { - get { + public static string PathDoesNotExistForElement + { + get + { return ResourceManager.GetString("PathDoesNotExistForElement", resourceCulture); } } - + /// /// Looks up a localized string similar to &whr={0}. /// - internal static string PublishSettingsFileRealmFormat { - get { + public static string PublishSettingsFileRealmFormat + { + get + { return ResourceManager.GetString("PublishSettingsFileRealmFormat", resourceCulture); } } - + /// - /// Looks up a localized string similar to Removing built-in or discovered environment is not supported.. + /// Looks up a localized string similar to Removing public environment is not supported.. /// - internal static string RemovingDefaultEnvironmentsNotSupported { - get { + public static string RemovingDefaultEnvironmentsNotSupported + { + get + { return ResourceManager.GetString("RemovingDefaultEnvironmentsNotSupported", resourceCulture); } } - + /// /// Looks up a localized string similar to Unable to retrieve service key for ServicePrincipal account {0}. Please log in again to supply the credentials for this service principal. In PowerShell, execute Connect-AzAccount.. /// - internal static string ServiceKeyNotFound { - get { + public static string ServiceKeyNotFound + { + get + { return ResourceManager.GetString("ServiceKeyNotFound", resourceCulture); } } - + /// /// Looks up a localized string similar to The provided service name {0} already exists, please pick another name. /// - internal static string ServiceNameExists { - get { + public static string ServiceNameExists + { + get + { return ResourceManager.GetString("ServiceNameExists", resourceCulture); } } - + /// /// Looks up a localized string similar to [Common.Authentication]: Renewing token using AppId: '{0}', AdalConfiguration with ADDomain: '{1}', AdEndpoint: '{2}', ClientId: '{3}', RedirectUri: '{4}'. /// - internal static string SPNRenewTokenTrace { - get { + public static string SPNRenewTokenTrace + { + get + { return ResourceManager.GetString("SPNRenewTokenTrace", resourceCulture); } } - + /// /// Looks up a localized string similar to [Common.Authentication]: Checking token expiration, token expires '{0}' Comparing to '{1}' With threshold '{2}', calculated time until token expiry: '{3}'. /// - internal static string SPNTokenExpirationCheckTrace { - get { + public static string SPNTokenExpirationCheckTrace + { + get + { return ResourceManager.GetString("SPNTokenExpirationCheckTrace", resourceCulture); } } - + /// /// Looks up a localized string similar to The subscription id {0} doesn't exist.. /// - internal static string SubscriptionIdNotFoundMessage { - get { + public static string SubscriptionIdNotFoundMessage + { + get + { return ResourceManager.GetString("SubscriptionIdNotFoundMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to Subscription name needs to be specified. /// - internal static string SubscriptionNameNeedsToBeSpecified { - get { + public static string SubscriptionNameNeedsToBeSpecified + { + get + { return ResourceManager.GetString("SubscriptionNameNeedsToBeSpecified", resourceCulture); } } - + /// /// Looks up a localized string similar to The subscription name {0} doesn't exist.. /// - internal static string SubscriptionNameNotFoundMessage { - get { + public static string SubscriptionNameNotFoundMessage + { + get + { return ResourceManager.GetString("SubscriptionNameNotFoundMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to Subscription needs to be specified. /// - internal static string SubscriptionNeedsToBeSpecified { - get { + public static string SubscriptionNeedsToBeSpecified + { + get + { return ResourceManager.GetString("SubscriptionNeedsToBeSpecified", resourceCulture); } } - + /// /// Looks up a localized string similar to No tenant was found for this subscription. Please execute Clear-AzureProfile and then execute Add-AzureAccount.. /// - internal static string TenantNotFound { - get { + public static string TenantNotFound + { + get + { return ResourceManager.GetString("TenantNotFound", resourceCulture); } } - + /// /// Looks up a localized string similar to [Common.Authentication]: Parsed token '{0}' with json value '{1}' and decoded issuer '{2}'.. /// - internal static string TokenIssuerTrace { - get { + public static string TokenIssuerTrace + { + get + { return ResourceManager.GetString("TokenIssuerTrace", resourceCulture); } } - + /// /// Looks up a localized string similar to Unable to update mismatching Json structured: {0} {1}.. /// - internal static string UnableToPatchJson { - get { + public static string UnableToPatchJson + { + get + { return ResourceManager.GetString("UnableToPatchJson", resourceCulture); } } - + /// /// Looks up a localized string similar to Illegal credential type. /// - internal static string UnknownCredentialType { - get { + public static string UnknownCredentialType + { + get + { return ResourceManager.GetString("UnknownCredentialType", resourceCulture); } } - + /// /// Looks up a localized string similar to Certificate authentication is not supported for account type {0}.. /// - internal static string UnsupportedCredentialType { - get { + public static string UnsupportedCredentialType + { + get + { return ResourceManager.GetString("UnsupportedCredentialType", resourceCulture); } } - + /// /// Looks up a localized string similar to [Common.Authentication]: Acquiring token using AdalConfiguration with Domain: '{0}', AdEndpoint: '{1}', ClientId: '{2}', ClientRedirectUri: {3}. /// - internal static string UPNAcquireTokenConfigTrace { - get { + public static string UPNAcquireTokenConfigTrace + { + get + { return ResourceManager.GetString("UPNAcquireTokenConfigTrace", resourceCulture); } } - + /// /// Looks up a localized string similar to [Common.Authentication]: Acquiring token using context with Authority '{0}', CorrelationId: '{1}', ValidateAuthority: '{2}'. /// - internal static string UPNAcquireTokenContextTrace { - get { + public static string UPNAcquireTokenContextTrace + { + get + { return ResourceManager.GetString("UPNAcquireTokenContextTrace", resourceCulture); } } - + /// /// Looks up a localized string similar to [Common.Authentication]: Received token with LoginType '{0}', Tenant: '{1}', UserId: '{2}'. /// - internal static string UPNAuthenticationTokenTrace { - get { + public static string UPNAuthenticationTokenTrace + { + get + { return ResourceManager.GetString("UPNAuthenticationTokenTrace", resourceCulture); } } - + /// /// Looks up a localized string similar to [Common.Authentication]: Authenticating using Account: '{0}', environment: '{1}', tenant: '{2}'. /// - internal static string UPNAuthenticationTrace { - get { + public static string UPNAuthenticationTrace + { + get + { return ResourceManager.GetString("UPNAuthenticationTrace", resourceCulture); } } - + /// /// Looks up a localized string similar to [Common.Authentication]: Token is expired. /// - internal static string UPNExpiredTokenTrace { - get { + public static string UPNExpiredTokenTrace + { + get + { return ResourceManager.GetString("UPNExpiredTokenTrace", resourceCulture); } } - + /// /// Looks up a localized string similar to [Common.Authentication]: Renewing Token with Type: '{0}', Expiry: '{1}', MultipleResource? '{2}', Tenant: '{3}', UserId: '{4}'. /// - internal static string UPNRenewTokenTrace { - get { + public static string UPNRenewTokenTrace + { + get + { return ResourceManager.GetString("UPNRenewTokenTrace", resourceCulture); } } - + /// /// Looks up a localized string similar to [Common.Authentication]: User info for token DisplayId: '{0}', Name: {2} {1}, IdProvider: '{3}', Uid: '{4}'. /// - internal static string UPNRenewTokenUserInfoTrace { - get { + public static string UPNRenewTokenUserInfoTrace + { + get + { return ResourceManager.GetString("UPNRenewTokenUserInfoTrace", resourceCulture); } } - + /// /// Looks up a localized string similar to [Common.Authentication]: Checking token expiration, token expires '{0}' Comparing to '{1}' With threshold '{2}', calculated time until token expiry: '{3}'. /// - internal static string UPNTokenExpirationCheckTrace { - get { + public static string UPNTokenExpirationCheckTrace + { + get + { return ResourceManager.GetString("UPNTokenExpirationCheckTrace", resourceCulture); } } - + /// /// Looks up a localized string similar to User name is not valid. /// - internal static string UserNameIsNotValid { - get { + public static string UserNameIsNotValid + { + get + { return ResourceManager.GetString("UserNameIsNotValid", resourceCulture); } } - + /// /// Looks up a localized string similar to User name needs to be specified. /// - internal static string UserNameNeedsToBeSpecified { - get { + public static string UserNameNeedsToBeSpecified + { + get + { return ResourceManager.GetString("UserNameNeedsToBeSpecified", resourceCulture); } } - + /// /// Looks up a localized string similar to (x86). /// - internal static string x86InProgramFiles { - get { + public static string x86InProgramFiles + { + get + { return ResourceManager.GetString("x86InProgramFiles", resourceCulture); } } } -} +} \ No newline at end of file From d5fe6b552106496c5a5cdd4f014cadbf86237616 Mon Sep 17 00:00:00 2001 From: Amol Agarwal Date: Wed, 26 Aug 2020 19:52:14 -0700 Subject: [PATCH 3/7] Fix files in Accounts --- .../Properties/Resources.Designer.cs | 2 +- .../Properties/Resources.Designer.cs | 619 +++++++----------- 2 files changed, 234 insertions(+), 387 deletions(-) diff --git a/src/Accounts/Authentication.ResourceManager/Properties/Resources.Designer.cs b/src/Accounts/Authentication.ResourceManager/Properties/Resources.Designer.cs index 5cfa07047f46..cb377d344f0f 100644 --- a/src/Accounts/Authentication.ResourceManager/Properties/Resources.Designer.cs +++ b/src/Accounts/Authentication.ResourceManager/Properties/Resources.Designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.42000 diff --git a/src/Accounts/Authentication/Properties/Resources.Designer.cs b/src/Accounts/Authentication/Properties/Resources.Designer.cs index 311a7d1a759a..189db97f9731 100644 --- a/src/Accounts/Authentication/Properties/Resources.Designer.cs +++ b/src/Accounts/Authentication/Properties/Resources.Designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.42000 @@ -8,11 +8,10 @@ // //------------------------------------------------------------------------------ -namespace Microsoft.Azure.Commands.Common.Authentication.Properties -{ +namespace Microsoft.Azure.Commands.Common.Authentication.Properties { using System; - - + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -23,840 +22,688 @@ namespace Microsoft.Azure.Commands.Common.Authentication.Properties [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class Resources - { - + public class Resources { + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { + internal Resources() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager - { - get - { - if (object.ReferenceEquals(resourceMan, null)) - { + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Azure.Commands.Common.Authentication.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture - { - get - { + public static global::System.Globalization.CultureInfo Culture { + get { return resourceCulture; } - set - { + set { resourceCulture = value; } } - + /// /// Looks up a localized string similar to Cannot retrieve access token for resource '{0}'. Please ensure that you have provided the appropriate access tokens when using access token login.. /// - public static string AccessTokenResourceNotFound - { - get - { + public static string AccessTokenResourceNotFound { + get { return ResourceManager.GetString("AccessTokenResourceNotFound", resourceCulture); } } - + /// /// Looks up a localized string similar to Account needs to be specified. /// - public static string AccountNeedsToBeSpecified - { - get - { + public static string AccountNeedsToBeSpecified { + get { return ResourceManager.GetString("AccountNeedsToBeSpecified", resourceCulture); } } - + /// /// Looks up a localized string similar to No account was found for this subscription. Please execute Clear-AzureProfile and then execute Add-AzureAccount.. /// - public static string AccountNotFound - { - get - { + public static string AccountNotFound { + get { return ResourceManager.GetString("AccountNotFound", resourceCulture); } } - + /// /// Looks up a localized string similar to [Common.Authentication]: Authenticating using configuration values: Domain: '{0}', Endpoint: '{1}', ClientId: '{2}', ClientRedirect: '{3}', ResourceClientUri: '{4}', ValidateAuthrity: '{5}'. /// - public static string AdalAuthConfigurationTrace - { - get - { + public static string AdalAuthConfigurationTrace { + get { return ResourceManager.GetString("AdalAuthConfigurationTrace", resourceCulture); } } - + /// /// Looks up a localized string similar to [Common.Authentication]: Received exception {0}, while authenticating.. /// - public static string AdalAuthException - { - get - { + public static string AdalAuthException { + get { return ResourceManager.GetString("AdalAuthException", resourceCulture); } } - + /// /// Looks up a localized string similar to Multiple tokens were found for this user. Please clear your token cache using, Clear-AzureProfile and try this command again.. /// - public static string AdalMultipleTokens - { - get - { + public static string AdalMultipleTokens { + get { return ResourceManager.GetString("AdalMultipleTokens", resourceCulture); } } - + /// /// Looks up a localized string similar to User Interaction is required to authenticate this user. Please authenticate using the log in dialog. In PowerShell, execute Connect-AzAccount.. /// - public static string AdalUserInteractionRequired - { - get - { + public static string AdalUserInteractionRequired { + get { return ResourceManager.GetString("AdalUserInteractionRequired", resourceCulture); } } - + /// /// Looks up a localized string similar to No account found in the context. Please login using Connect-AzAccount.. /// - public static string ArmAccountNotFound - { - get - { + public static string ArmAccountNotFound { + get { return ResourceManager.GetString("ArmAccountNotFound", resourceCulture); } } - + /// /// Looks up a localized string similar to User Interaction is required to authenticate this user. Please execute Connect-AzAccount without parameters and enter your credentials.. /// - public static string ArmUserInteractionRequired - { - get - { + public static string ArmUserInteractionRequired { + get { return ResourceManager.GetString("ArmUserInteractionRequired", resourceCulture); } } - + /// /// Looks up a localized string similar to [Common.Authentication]: Authenticating for account {0} with single tenant {1}. /// - public static string AuthenticatingForSingleTenant - { - get - { + public static string AuthenticatingForSingleTenant { + get { return ResourceManager.GetString("AuthenticatingForSingleTenant", resourceCulture); } } - + /// /// Looks up a localized string similar to .Azure. /// - public static string AzureDirectoryName - { - get - { + public static string AzureDirectoryName { + get { return ResourceManager.GetString("AzureDirectoryName", resourceCulture); } } - + /// /// Looks up a localized string similar to Checking Cache request {0}. /// - public static string CacheCheck - { - get - { + public static string CacheCheck { + get { return ResourceManager.GetString("CacheCheck", resourceCulture); } } - + /// /// Looks up a localized string similar to Cache Hit. /// - public static string CacheHit - { - get - { + public static string CacheHit { + get { return ResourceManager.GetString("CacheHit", resourceCulture); } } - + /// /// Looks up a localized string similar to No certificate was found in the certificate store with thumbprint {0}. /// - public static string CertificateNotFoundInStore - { - get - { + public static string CertificateNotFoundInStore { + get { return ResourceManager.GetString("CertificateNotFoundInStore", resourceCulture); } } - + /// /// Looks up a localized string similar to Changing public environment is not supported.. /// - public static string ChangingDefaultEnvironmentNotSupported - { - get - { + public static string ChangingDefaultEnvironmentNotSupported { + get { return ResourceManager.GetString("ChangingDefaultEnvironmentNotSupported", resourceCulture); } } - + /// /// Looks up a localized string similar to -Credential parameter can only be used with Organization ID credentials. For more information, please refer to http://go.microsoft.com/fwlink/?linkid=331007&clcid=0x409 for more information about the difference between an organizational account and a Microsoft account.. /// - public static string CredentialOrganizationIdMessage - { - get - { + public static string CredentialOrganizationIdMessage { + get { return ResourceManager.GetString("CredentialOrganizationIdMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to Environment name needs to be specified. /// - public static string EnvironmentNameNeedsToBeSpecified - { - get - { + public static string EnvironmentNameNeedsToBeSpecified { + get { return ResourceManager.GetString("EnvironmentNameNeedsToBeSpecified", resourceCulture); } } - + /// /// Looks up a localized string similar to Environment needs to be specified. /// - public static string EnvironmentNeedsToBeSpecified - { - get - { + public static string EnvironmentNeedsToBeSpecified { + get { return ResourceManager.GetString("EnvironmentNeedsToBeSpecified", resourceCulture); } } - + /// /// Looks up a localized string similar to The environment name '{0}' is not found.. /// - public static string EnvironmentNotFound - { - get - { + public static string EnvironmentNotFound { + get { return ResourceManager.GetString("EnvironmentNotFound", resourceCulture); } } - + /// /// Looks up a localized string similar to Your Microsoft Azure credential in the Windows PowerShell session has expired. Please log in again. In PowerShell, execute Connect-AzAccount.. /// - public static string ExpiredRefreshToken - { - get - { + public static string ExpiredRefreshToken { + get { return ResourceManager.GetString("ExpiredRefreshToken", resourceCulture); } } - + /// /// Looks up a localized string similar to File path is not valid. /// - public static string FilePathIsNotValid - { - get - { + public static string FilePathIsNotValid { + get { return ResourceManager.GetString("FilePathIsNotValid", resourceCulture); } } - + /// /// Looks up a localized string similar to [HttpClientOperations]: Adding Header '{0}'. /// - public static string HttpClientAddingHeader - { - get - { + public static string HttpClientAddingHeader { + get { return ResourceManager.GetString("HttpClientAddingHeader", resourceCulture); } } - + /// /// Looks up a localized string similar to [HttpClientOperations {0}]. /// - public static string HttpClientOperationsInvocationId - { - get - { + public static string HttpClientOperationsInvocationId { + get { return ResourceManager.GetString("HttpClientOperationsInvocationId", resourceCulture); } } - + /// /// Looks up a localized string similar to Unexpected response status code '{0}' received for request '{{{1} {2}}} Body: {{{3}}}. /// - public static string HttpRequestExceptionMessage - { - get - { + public static string HttpRequestExceptionMessage { + get { return ResourceManager.GetString("HttpRequestExceptionMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to Illegal characters in path.. /// - public static string IllegalPath - { - get - { + public static string IllegalPath { + get { return ResourceManager.GetString("IllegalPath", resourceCulture); } } - + /// /// Looks up a localized string similar to Your Azure credentials have not been set up or have expired, please run Connect-AzAccount to set up your Azure credentials.. /// - public static string InvalidArmContext - { - get - { + public static string InvalidArmContext { + get { return ResourceManager.GetString("InvalidArmContext", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid certificate format. Publish settings may be corrupted. Use Get-AzurePublishSettingsFile to download updated settings. /// - public static string InvalidCertificate - { - get - { + public static string InvalidCertificate { + get { return ResourceManager.GetString("InvalidCertificate", resourceCulture); } } - + /// /// Looks up a localized string similar to Credential type invalid, only handles '{0}'. /// - public static string InvalidCredentialType - { - get - { + public static string InvalidCredentialType { + get { return ResourceManager.GetString("InvalidCredentialType", resourceCulture); } } - + /// /// Looks up a localized string similar to No default subscription has been designated. Use Select-AzureSubscription -Default <subscriptionName> to set the default subscription.. /// - public static string InvalidDefaultSubscription - { - get - { + public static string InvalidDefaultSubscription { + get { return ResourceManager.GetString("InvalidDefaultSubscription", resourceCulture); } } - + /// /// Looks up a localized string similar to "{0}" is an invalid DNS name for {1}. /// - public static string InvalidDnsName - { - get - { + public static string InvalidDnsName { + get { return ResourceManager.GetString("InvalidDnsName", resourceCulture); } } - + /// /// Looks up a localized string similar to The provided file in {0} must be have {1} extension. /// - public static string InvalidFileExtension - { - get - { + public static string InvalidFileExtension { + get { return ResourceManager.GetString("InvalidFileExtension", resourceCulture); } } - + /// /// Looks up a localized string similar to No value was specified for the token audience for the graph endpoint in environment '{0}'. Please use Set-AzEnvironment -Name {0} -GraphAudience token-audience-value. /// - public static string InvalidGraphTokenAudience - { - get - { + public static string InvalidGraphTokenAudience { + get { return ResourceManager.GetString("InvalidGraphTokenAudience", resourceCulture); } } - + /// /// Looks up a localized string similar to Cannot create instance of management client type {0}. It does not have the expected constructor.. /// - public static string InvalidManagementClientType - { - get - { + public static string InvalidManagementClientType { + get { return ResourceManager.GetString("InvalidManagementClientType", resourceCulture); } } - + /// /// Looks up a localized string similar to No value was specified for the token audience for the management endpoint in environment '{0}'. Please use Set-AzEnvironment -Name {0} -ActiveDirectoryServiceEndpointResourceId token-audience-value. /// - public static string InvalidManagementTokenAudience - { - get - { + public static string InvalidManagementTokenAudience { + get { return ResourceManager.GetString("InvalidManagementTokenAudience", resourceCulture); } } - + /// /// Looks up a localized string similar to {0} is invalid or empty. /// - public static string InvalidOrEmptyArgumentMessage - { - get - { + public static string InvalidOrEmptyArgumentMessage { + get { return ResourceManager.GetString("InvalidOrEmptyArgumentMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to Must specify a non-null subscription name.. /// - public static string InvalidSubscriptionName - { - get - { + public static string InvalidSubscriptionName { + get { return ResourceManager.GetString("InvalidSubscriptionName", resourceCulture); } } - + /// /// Looks up a localized string similar to Your Azure credentials have not been set up or have expired, please run Add-AzureAccount to set up your Azure credentials.. /// - public static string InvalidSubscriptionState - { - get - { + public static string InvalidSubscriptionState { + get { return ResourceManager.GetString("InvalidSubscriptionState", resourceCulture); } } - + /// /// Looks up a localized string similar to There was an error retrieving the managed service access token for resource '{0}' using the URI '{1}'. Please check that this managed service is configured to emit tokens at this address and that the associated managed service identity has the appropriate role assignment and try logging in again.. /// - public static string MSITokenRequestFailed - { - get - { + public static string MSITokenRequestFailed { + get { return ResourceManager.GetString("MSITokenRequestFailed", resourceCulture); } } - + /// /// Looks up a localized string similar to [Common.Authentication]: No matching account record for account {0} in subscription {1}. /// - public static string NoAccountInContext - { - get - { + public static string NoAccountInContext { + get { return ResourceManager.GetString("NoAccountInContext", resourceCulture); } } - + /// /// Looks up a localized string similar to [Common.Authentication]: No matching environment record for environment {0} in subscription {1}, using AzureCloud environment instead. /// - public static string NoEnvironmentInContext - { - get - { + public static string NoEnvironmentInContext { + get { return ResourceManager.GetString("NoEnvironmentInContext", resourceCulture); } } - + /// /// Looks up a localized string similar to Please connect to internet before executing this cmdlet. /// - public static string NoInternetConnection - { - get - { + public static string NoInternetConnection { + get { return ResourceManager.GetString("NoInternetConnection", resourceCulture); } } - + /// /// Looks up a localized string similar to No subscription found in the context. Please ensure that the credentials you provided are authorized to access an Azure subscription, then run Connect-AzAccount to login.. /// - public static string NoSubscriptionInContext - { - get - { + public static string NoSubscriptionInContext { + get { return ResourceManager.GetString("NoSubscriptionInContext", resourceCulture); } } - + /// /// Looks up a localized string similar to No tenant found in the context. Please ensure that the credentials you provided are authorized to access an Azure subscription, then run Connect-AzAccount to login.. /// - public static string NoTenantInContext - { - get - { + public static string NoTenantInContext { + get { return ResourceManager.GetString("NoTenantInContext", resourceCulture); } } - + /// /// Looks up a localized string similar to Windows Azure Powershell. /// - public static string OldAzureDirectoryName - { - get - { + public static string OldAzureDirectoryName { + get { return ResourceManager.GetString("OldAzureDirectoryName", resourceCulture); } } - + /// /// Looks up a localized string similar to Path {0} doesn't exist.. /// - public static string PathDoesNotExist - { - get - { + public static string PathDoesNotExist { + get { return ResourceManager.GetString("PathDoesNotExist", resourceCulture); } } - + /// /// Looks up a localized string similar to Path for {0} doesn't exist in {1}.. /// - public static string PathDoesNotExistForElement - { - get - { + public static string PathDoesNotExistForElement { + get { return ResourceManager.GetString("PathDoesNotExistForElement", resourceCulture); } } - + /// /// Looks up a localized string similar to &whr={0}. /// - public static string PublishSettingsFileRealmFormat - { - get - { + public static string PublishSettingsFileRealmFormat { + get { return ResourceManager.GetString("PublishSettingsFileRealmFormat", resourceCulture); } } - + /// /// Looks up a localized string similar to Removing public environment is not supported.. /// - public static string RemovingDefaultEnvironmentsNotSupported - { - get - { + public static string RemovingDefaultEnvironmentsNotSupported { + get { return ResourceManager.GetString("RemovingDefaultEnvironmentsNotSupported", resourceCulture); } } - + /// /// Looks up a localized string similar to Unable to retrieve service key for ServicePrincipal account {0}. Please log in again to supply the credentials for this service principal. In PowerShell, execute Connect-AzAccount.. /// - public static string ServiceKeyNotFound - { - get - { + public static string ServiceKeyNotFound { + get { return ResourceManager.GetString("ServiceKeyNotFound", resourceCulture); } } - + /// /// Looks up a localized string similar to The provided service name {0} already exists, please pick another name. /// - public static string ServiceNameExists - { - get - { + public static string ServiceNameExists { + get { return ResourceManager.GetString("ServiceNameExists", resourceCulture); } } - + /// /// Looks up a localized string similar to [Common.Authentication]: Renewing token using AppId: '{0}', AdalConfiguration with ADDomain: '{1}', AdEndpoint: '{2}', ClientId: '{3}', RedirectUri: '{4}'. /// - public static string SPNRenewTokenTrace - { - get - { + public static string SPNRenewTokenTrace { + get { return ResourceManager.GetString("SPNRenewTokenTrace", resourceCulture); } } - + /// /// Looks up a localized string similar to [Common.Authentication]: Checking token expiration, token expires '{0}' Comparing to '{1}' With threshold '{2}', calculated time until token expiry: '{3}'. /// - public static string SPNTokenExpirationCheckTrace - { - get - { + public static string SPNTokenExpirationCheckTrace { + get { return ResourceManager.GetString("SPNTokenExpirationCheckTrace", resourceCulture); } } - + /// /// Looks up a localized string similar to The subscription id {0} doesn't exist.. /// - public static string SubscriptionIdNotFoundMessage - { - get - { + public static string SubscriptionIdNotFoundMessage { + get { return ResourceManager.GetString("SubscriptionIdNotFoundMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to Subscription name needs to be specified. /// - public static string SubscriptionNameNeedsToBeSpecified - { - get - { + public static string SubscriptionNameNeedsToBeSpecified { + get { return ResourceManager.GetString("SubscriptionNameNeedsToBeSpecified", resourceCulture); } } - + /// /// Looks up a localized string similar to The subscription name {0} doesn't exist.. /// - public static string SubscriptionNameNotFoundMessage - { - get - { + public static string SubscriptionNameNotFoundMessage { + get { return ResourceManager.GetString("SubscriptionNameNotFoundMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to Subscription needs to be specified. /// - public static string SubscriptionNeedsToBeSpecified - { - get - { + public static string SubscriptionNeedsToBeSpecified { + get { return ResourceManager.GetString("SubscriptionNeedsToBeSpecified", resourceCulture); } } - + /// /// Looks up a localized string similar to No tenant was found for this subscription. Please execute Clear-AzureProfile and then execute Add-AzureAccount.. /// - public static string TenantNotFound - { - get - { + public static string TenantNotFound { + get { return ResourceManager.GetString("TenantNotFound", resourceCulture); } } - + /// /// Looks up a localized string similar to [Common.Authentication]: Parsed token '{0}' with json value '{1}' and decoded issuer '{2}'.. /// - public static string TokenIssuerTrace - { - get - { + public static string TokenIssuerTrace { + get { return ResourceManager.GetString("TokenIssuerTrace", resourceCulture); } } - + /// /// Looks up a localized string similar to Unable to update mismatching Json structured: {0} {1}.. /// - public static string UnableToPatchJson - { - get - { + public static string UnableToPatchJson { + get { return ResourceManager.GetString("UnableToPatchJson", resourceCulture); } } - + /// /// Looks up a localized string similar to Illegal credential type. /// - public static string UnknownCredentialType - { - get - { + public static string UnknownCredentialType { + get { return ResourceManager.GetString("UnknownCredentialType", resourceCulture); } } - + /// /// Looks up a localized string similar to Certificate authentication is not supported for account type {0}.. /// - public static string UnsupportedCredentialType - { - get - { + public static string UnsupportedCredentialType { + get { return ResourceManager.GetString("UnsupportedCredentialType", resourceCulture); } } - + /// /// Looks up a localized string similar to [Common.Authentication]: Acquiring token using AdalConfiguration with Domain: '{0}', AdEndpoint: '{1}', ClientId: '{2}', ClientRedirectUri: {3}. /// - public static string UPNAcquireTokenConfigTrace - { - get - { + public static string UPNAcquireTokenConfigTrace { + get { return ResourceManager.GetString("UPNAcquireTokenConfigTrace", resourceCulture); } } - + /// /// Looks up a localized string similar to [Common.Authentication]: Acquiring token using context with Authority '{0}', CorrelationId: '{1}', ValidateAuthority: '{2}'. /// - public static string UPNAcquireTokenContextTrace - { - get - { + public static string UPNAcquireTokenContextTrace { + get { return ResourceManager.GetString("UPNAcquireTokenContextTrace", resourceCulture); } } - + /// /// Looks up a localized string similar to [Common.Authentication]: Received token with LoginType '{0}', Tenant: '{1}', UserId: '{2}'. /// - public static string UPNAuthenticationTokenTrace - { - get - { + public static string UPNAuthenticationTokenTrace { + get { return ResourceManager.GetString("UPNAuthenticationTokenTrace", resourceCulture); } } - + /// /// Looks up a localized string similar to [Common.Authentication]: Authenticating using Account: '{0}', environment: '{1}', tenant: '{2}'. /// - public static string UPNAuthenticationTrace - { - get - { + public static string UPNAuthenticationTrace { + get { return ResourceManager.GetString("UPNAuthenticationTrace", resourceCulture); } } - + /// /// Looks up a localized string similar to [Common.Authentication]: Token is expired. /// - public static string UPNExpiredTokenTrace - { - get - { + public static string UPNExpiredTokenTrace { + get { return ResourceManager.GetString("UPNExpiredTokenTrace", resourceCulture); } } - + /// /// Looks up a localized string similar to [Common.Authentication]: Renewing Token with Type: '{0}', Expiry: '{1}', MultipleResource? '{2}', Tenant: '{3}', UserId: '{4}'. /// - public static string UPNRenewTokenTrace - { - get - { + public static string UPNRenewTokenTrace { + get { return ResourceManager.GetString("UPNRenewTokenTrace", resourceCulture); } } - + /// /// Looks up a localized string similar to [Common.Authentication]: User info for token DisplayId: '{0}', Name: {2} {1}, IdProvider: '{3}', Uid: '{4}'. /// - public static string UPNRenewTokenUserInfoTrace - { - get - { + public static string UPNRenewTokenUserInfoTrace { + get { return ResourceManager.GetString("UPNRenewTokenUserInfoTrace", resourceCulture); } } - + /// /// Looks up a localized string similar to [Common.Authentication]: Checking token expiration, token expires '{0}' Comparing to '{1}' With threshold '{2}', calculated time until token expiry: '{3}'. /// - public static string UPNTokenExpirationCheckTrace - { - get - { + public static string UPNTokenExpirationCheckTrace { + get { return ResourceManager.GetString("UPNTokenExpirationCheckTrace", resourceCulture); } } - + /// /// Looks up a localized string similar to User name is not valid. /// - public static string UserNameIsNotValid - { - get - { + public static string UserNameIsNotValid { + get { return ResourceManager.GetString("UserNameIsNotValid", resourceCulture); } } - + /// /// Looks up a localized string similar to User name needs to be specified. /// - public static string UserNameNeedsToBeSpecified - { - get - { + public static string UserNameNeedsToBeSpecified { + get { return ResourceManager.GetString("UserNameNeedsToBeSpecified", resourceCulture); } } - + /// /// Looks up a localized string similar to (x86). /// - public static string x86InProgramFiles - { - get - { + public static string x86InProgramFiles { + get { return ResourceManager.GetString("x86InProgramFiles", resourceCulture); } } From f4c4bb9982de438f9be77a87fc9b0ecd9d488cac Mon Sep 17 00:00:00 2001 From: Amol Agarwal <57109831+amolagar5@users.noreply.github.com> Date: Wed, 26 Aug 2020 19:54:08 -0700 Subject: [PATCH 4/7] Update Resources.Designer.cs --- .../Properties/Resources.Designer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Accounts/Authentication.ResourceManager/Properties/Resources.Designer.cs b/src/Accounts/Authentication.ResourceManager/Properties/Resources.Designer.cs index cb377d344f0f..ff04b4974e2e 100644 --- a/src/Accounts/Authentication.ResourceManager/Properties/Resources.Designer.cs +++ b/src/Accounts/Authentication.ResourceManager/Properties/Resources.Designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.42000 @@ -259,4 +259,4 @@ internal static string UnwritableStream { } } } -} \ No newline at end of file +} From e1b90eac846f3125eb0d588c793b715e58bab336 Mon Sep 17 00:00:00 2001 From: Amol Agarwal Date: Wed, 26 Aug 2020 21:01:30 -0700 Subject: [PATCH 5/7] Add help files --- ...ServerActiveDirectoryOnlyAuthentication.md | 136 ++++++++++++++++++ ...ServerActiveDirectoryOnlyAuthentication.md | 136 ++++++++++++++++++ 2 files changed, 272 insertions(+) create mode 100644 src/Sql/Sql/help/Enable-AzSqlServerActiveDirectoryOnlyAuthentication.md create mode 100644 src/Sql/Sql/help/Get-AzSqlServerActiveDirectoryOnlyAuthentication.md diff --git a/src/Sql/Sql/help/Enable-AzSqlServerActiveDirectoryOnlyAuthentication.md b/src/Sql/Sql/help/Enable-AzSqlServerActiveDirectoryOnlyAuthentication.md new file mode 100644 index 000000000000..49e80cbc56ea --- /dev/null +++ b/src/Sql/Sql/help/Enable-AzSqlServerActiveDirectoryOnlyAuthentication.md @@ -0,0 +1,136 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.Sql.dll-Help.xml +Module Name: Az.Sql +online version: https://docs.microsoft.com/en-us/powershell/module/az.sql/enable-azsqlserveractivedirectoryonlyauthentication +schema: 2.0.0 +--- + +# Enable-AzSqlServerActiveDirectoryOnlyAuthentication + +## SYNOPSIS +Enables Azure AD only authentication for a specific SQL Server. + +## SYNTAX + +``` +Enable-AzSqlServerActiveDirectoryOnlyAuthentication [-ServerName] [-ResourceGroupName] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +The **Enable-AzSqlServerActiveDirectoryOnlyAuthentication** cmdlet enables Azure Active Directory (Azure AD) only authentication requirement for an AzureSQL Server in the current subscription. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\>Enable-AzSqlServerActiveDirectoryOnlyAuthentication -ResourceGroupName "ResourceGroup01" -ServerName "Server01" +ResourceGroupName ServerName AzureADOnlyAuthentication +----------------- ---------- ----------- -------- ----------- +ResourceGroup01 Server01 True +``` + +This command enables Azure Active Directory (Azure AD) only authentication requirement for an AzureSQL server named Server01 that is associated with a resource group named ResourceGroup01. + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -ServerName +The name of the Azure SQL Server the Azure Active Directory only authentication is in. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String + +## OUTPUTS + +### Microsoft.Azure.Commands.Sql.ServerActiveDirectoryAdministrator.Model.AzureSqlServerActiveDirectoryOnlyAuthenticationModel + +## NOTES + +## RELATED LINKS + +[Disable-AzSqlServerActiveDirectoryOnlyAuthentication](./Disable-AzSqlServerActiveDirectoryOnlyAuthentication.md) + +[Get-AzSqlServerActiveDirectoryOnlyAuthentication](./Get-AzSqlServerActiveDirectoryOnlyAuthentication.md) + +[Set-AzSqlServerActiveDirectoryAdministrator](./Set-AzSqlServerActiveDirectoryAdministrator.md) + +[Get-AzSqlServerActiveDirectoryAdministrator](./Get-AzSqlServerActiveDirectoryAdministrator.md) + +[SQL Database Documentation](https://docs.microsoft.com/azure/sql-database/) \ No newline at end of file diff --git a/src/Sql/Sql/help/Get-AzSqlServerActiveDirectoryOnlyAuthentication.md b/src/Sql/Sql/help/Get-AzSqlServerActiveDirectoryOnlyAuthentication.md new file mode 100644 index 000000000000..a2b4d4ba7d3c --- /dev/null +++ b/src/Sql/Sql/help/Get-AzSqlServerActiveDirectoryOnlyAuthentication.md @@ -0,0 +1,136 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.Sql.dll-Help.xml +Module Name: Az.Sql +online version: https://docs.microsoft.com/en-us/powershell/module/az.sql/get-azsqlserveractivedirectoryonlyauthentication +schema: 2.0.0 +--- + +# Get-AzSqlServerActiveDirectoryOnlyAuthentication + +## SYNOPSIS +Gets Azure AD only authentication for a specific SQL Server. + +## SYNTAX + +``` +Get-AzSqlServerActiveDirectoryOnlyAuthentication [-ServerName] [-ResourceGroupName] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +The **Get-AzSqlServerActiveDirectoryOnlyAuthentication** cmdlet gets Azure Active Directory (Azure AD) only authentication requirement for an AzureSQL Server in the current subscription. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\>Get-AzSqlServerActiveDirectoryOnlyAuthentication -ResourceGroupName "ResourceGroup01" -ServerName "Server01" +ResourceGroupName ServerName AzureADOnlyAuthentication +----------------- ---------- ----------- -------- ----------- +ResourceGroup01 Server01 True +``` + +This command gets Azure Active Directory (Azure AD) only authentication requirement for an AzureSQL server named Server01 that is associated with a resource group named ResourceGroup01. + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -ServerName +The name of the Azure SQL Server the Azure Active Directory only authentication is in. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String + +## OUTPUTS + +### Microsoft.Azure.Commands.Sql.ServerActiveDirectoryAdministrator.Model.AzureSqlServerActiveDirectoryOnlyAuthenticationModel + +## NOTES + +## RELATED LINKS + +[Enable-AzSqlServerActiveDirectoryOnlyAuthentication](./Enable-AzSqlServerActiveDirectoryOnlyAuthentication.md) + +[Disable-AzSqlServerActiveDirectoryOnlyAuthentication](./Disable-AzSqlServerActiveDirectoryOnlyAuthentication.md) + +[Set-AzSqlServerActiveDirectoryAdministrator](./Set-AzSqlServerActiveDirectoryAdministrator.md) + +[Get-AzSqlServerActiveDirectoryAdministrator](./Get-AzSqlServerActiveDirectoryAdministrator.md) + +[SQL Database Documentation](https://docs.microsoft.com/azure/sql-database/) \ No newline at end of file From 43b0c97f87815450fe25d547fea945eab2853b90 Mon Sep 17 00:00:00 2001 From: Amol Agarwal Date: Fri, 28 Aug 2020 16:27:23 -0700 Subject: [PATCH 6/7] Adding breaking change to Exceptions/Az.Sql/BreakingChangeIssues.csv --- .../StaticAnalysis/Exceptions/Az.Sql/BreakingChangeIssues.csv | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/StaticAnalysis/Exceptions/Az.Sql/BreakingChangeIssues.csv b/tools/StaticAnalysis/Exceptions/Az.Sql/BreakingChangeIssues.csv index f85231ecb1ee..a8c7d3f774bb 100644 --- a/tools/StaticAnalysis/Exceptions/Az.Sql/BreakingChangeIssues.csv +++ b/tools/StaticAnalysis/Exceptions/Az.Sql/BreakingChangeIssues.csv @@ -1,3 +1,7 @@ "AssemblyFileName","ClassName","Target","Severity","ProblemId","Description","Remediation" "Microsoft.Azure.PowerShell.Cmdlets.Sql.dll","Microsoft.Azure.Commands.Sql.ServerActiveDirectoryAdministrator.Cmdlet.SetAzureSqlServerActiveDirectoryAdministrator","Set-AzSqlServerActiveDirectoryAdministrator","0","2000","The cmdlet 'Set-AzSqlServerActiveDirectoryAdministrator' no longer supports the parameter 'IsAzureADOnlyAuthentication' and no alias was found for the original parameter name.","Add the parameter 'IsAzureADOnlyAuthentication' back to the cmdlet 'Set-AzSqlServerActiveDirectoryAdministrator', or add an alias to the original parameter name." "Microsoft.Azure.PowerShell.Cmdlets.Sql.dll","Microsoft.Azure.Commands.Sql.ServerActiveDirectoryAdministrator.Cmdlet.SetAzureSqlServerActiveDirectoryAdministrator","Set-AzSqlServerActiveDirectoryAdministrator","0","1050","The parameter set '__AllParameterSets' for cmdlet 'Set-AzSqlServerActiveDirectoryAdministrator' has been removed.","Add parameter set '__AllParameterSets' back to cmdlet 'Set-AzSqlServerActiveDirectoryAdministrator'." +"Microsoft.Azure.PowerShell.Cmdlets.Sql.dll","Microsoft.Azure.Commands.Sql.ServerActiveDirectoryAdministrator.Cmdlet.DisableAzureSqlServerActiveDirectoryOnlyAuthentication","Disable-AzSqlServerActiveDirectoryOnlyAuthentication","0","1020","The cmdlet 'Disable-AzSqlServerActiveDirectoryOnlyAuthentication' no longer has output type 'Microsoft.Azure.Commands.Sql.ServerActiveDirectoryAdministrator.Model.AzureSqlServerActiveDirectoryAdministratorModel'.","Make cmdlet 'Disable-AzSqlServerActiveDirectoryOnlyAuthentication' return type 'Microsoft.Azure.Commands.Sql.ServerActiveDirectoryAdministrator.Model.AzureSqlServerActiveDirectoryAdministratorModel'." + + + From a9349a3fae637f3d798d44d437bf7770c04ba358 Mon Sep 17 00:00:00 2001 From: Amol Agarwal Date: Fri, 28 Aug 2020 20:23:24 -0700 Subject: [PATCH 7/7] Removing empty lines --- .../Exceptions/Az.Sql/BreakingChangeIssues.csv | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/StaticAnalysis/Exceptions/Az.Sql/BreakingChangeIssues.csv b/tools/StaticAnalysis/Exceptions/Az.Sql/BreakingChangeIssues.csv index a8c7d3f774bb..2429f0782eef 100644 --- a/tools/StaticAnalysis/Exceptions/Az.Sql/BreakingChangeIssues.csv +++ b/tools/StaticAnalysis/Exceptions/Az.Sql/BreakingChangeIssues.csv @@ -1,7 +1,4 @@ "AssemblyFileName","ClassName","Target","Severity","ProblemId","Description","Remediation" "Microsoft.Azure.PowerShell.Cmdlets.Sql.dll","Microsoft.Azure.Commands.Sql.ServerActiveDirectoryAdministrator.Cmdlet.SetAzureSqlServerActiveDirectoryAdministrator","Set-AzSqlServerActiveDirectoryAdministrator","0","2000","The cmdlet 'Set-AzSqlServerActiveDirectoryAdministrator' no longer supports the parameter 'IsAzureADOnlyAuthentication' and no alias was found for the original parameter name.","Add the parameter 'IsAzureADOnlyAuthentication' back to the cmdlet 'Set-AzSqlServerActiveDirectoryAdministrator', or add an alias to the original parameter name." "Microsoft.Azure.PowerShell.Cmdlets.Sql.dll","Microsoft.Azure.Commands.Sql.ServerActiveDirectoryAdministrator.Cmdlet.SetAzureSqlServerActiveDirectoryAdministrator","Set-AzSqlServerActiveDirectoryAdministrator","0","1050","The parameter set '__AllParameterSets' for cmdlet 'Set-AzSqlServerActiveDirectoryAdministrator' has been removed.","Add parameter set '__AllParameterSets' back to cmdlet 'Set-AzSqlServerActiveDirectoryAdministrator'." -"Microsoft.Azure.PowerShell.Cmdlets.Sql.dll","Microsoft.Azure.Commands.Sql.ServerActiveDirectoryAdministrator.Cmdlet.DisableAzureSqlServerActiveDirectoryOnlyAuthentication","Disable-AzSqlServerActiveDirectoryOnlyAuthentication","0","1020","The cmdlet 'Disable-AzSqlServerActiveDirectoryOnlyAuthentication' no longer has output type 'Microsoft.Azure.Commands.Sql.ServerActiveDirectoryAdministrator.Model.AzureSqlServerActiveDirectoryAdministratorModel'.","Make cmdlet 'Disable-AzSqlServerActiveDirectoryOnlyAuthentication' return type 'Microsoft.Azure.Commands.Sql.ServerActiveDirectoryAdministrator.Model.AzureSqlServerActiveDirectoryAdministratorModel'." - - - +"Microsoft.Azure.PowerShell.Cmdlets.Sql.dll","Microsoft.Azure.Commands.Sql.ServerActiveDirectoryAdministrator.Cmdlet.DisableAzureSqlServerActiveDirectoryOnlyAuthentication","Disable-AzSqlServerActiveDirectoryOnlyAuthentication","0","1020","The cmdlet 'Disable-AzSqlServerActiveDirectoryOnlyAuthentication' no longer has output type 'Microsoft.Azure.Commands.Sql.ServerActiveDirectoryAdministrator.Model.AzureSqlServerActiveDirectoryAdministratorModel'.","Make cmdlet 'Disable-AzSqlServerActiveDirectoryOnlyAuthentication' return type 'Microsoft.Azure.Commands.Sql.ServerActiveDirectoryAdministrator.Model.AzureSqlServerActiveDirectoryAdministratorModel'." \ No newline at end of file