Example 1:Add-SqlAzureAuthenticationContext -DefaultAzureCredential
This command acquires token using the following credential types, if enabled, will be tried, in order: EnvironmentCredential, WorkloadIdentityCredential, ManagedIdentityCredential, SharedTokenCacheCredential, VisualStudioCredential, VisualStudioCodeCredential, AzureCliCredential, AzurePowerShellCredential, AzureDeveloperCliCredential, InteractiveBrowserCredential.
Example 2:
Users will have option to exclude a credential type. For instance, if users do not want to include VisualStudioCredential & AzureDeveloperCliCredential while using DefaultAzureCredential, they can specify the cmdlet parameters as below.
Example 3:
Users cannot exclude all the credential types. Specifying all exclude credential options would result in an exception - "Add-SqlAzureAuthenticationContext: At least one credential type must be allowed when using the -DefaultAzureCredential parameter."
Currently, Add-SqlAzureAuthenticationContext supports only interactive browser login. We would be supporting all credential types supported by DefaultAzureCredential - EnvironmentCredential WorkloadIdentityCredential ManagedIdentityCredential SharedTokenCacheCredential VisualStudioCredential VisualStudioCodeCredential AzureCliCredential AzurePowerShellCredential AzureDeveloperCliCredential InteractiveBrowserCredential
Example 1: Add-SqlAzureAuthenticationContext -DefaultAzureCredential This command acquires token using the following credential types, if enabled, will be tried, in order: EnvironmentCredential, WorkloadIdentityCredential, ManagedIdentityCredential, SharedTokenCacheCredential, VisualStudioCredential, VisualStudioCodeCredential, AzureCliCredential, AzurePowerShellCredential, AzureDeveloperCliCredential, InteractiveBrowserCredential.
Example 2: Users will have option to exclude a credential type. For instance, if users do not want to include VisualStudioCredential & AzureDeveloperCliCredential while using DefaultAzureCredential, they can specify the cmdlet parameters as below.
Add-SqlAzureAuthenticationContext -DefaultAzureCredential -ExcludeCredentials VisualStudioCredential, AzureDeveloperCliCredential
Example 3: Users cannot exclude all the credential types. Specifying all exclude credential options would result in an exception - "Add-SqlAzureAuthenticationContext: At least one credential type must be allowed when using the -DefaultAzureCredential parameter."
Add-SqlAzureAuthenticationContext -DefaultAzureCredential -ExcludeCredentials EnvironmentCredential, WorkloadIdentityCredential, ManagedIdentityCredential, SharedTokenCacheCredential, VisualStudioCredential, VisualStudioCodeCredential, AzureCliCredential, AzurePowerShellCredential, AzureDeveloperCliCredential, InteractiveBrowserCredential