Connect Azure KeyVault in Azure China or other Azure Version

 https://stackoverflow.com/questions/71846554/connect-to-keyvault-in-azure-china

https://learn.microsoft.com/en-us/dotnet/api/azure.identity.azureauthorityhosts?view=azure-dotnet


AzureChina

The host of the Azure Active Directory authority for tenants in the Azure China Cloud.

AzureGermany

The host of the Azure Active Directory authority for tenants in the Azure German Cloud.

AzureGovernment

The host of the Azure Active Directory authority for tenants in the Azure US Government Cloud.

AzurePublicCloud

The host of the Azure Active Directory authority for tenants in the Azure Public Cloud.


var clientSecretCredentialOptions = new ClientSecretCredentialOptions()
{
    AuthorityHost =  AzureAuthorityHosts.AzureChina
};

ClientSecretCredential clientCredential = new(options.KeyVaultTenantId, options.KeyVaultClientId, options.KeyVaultClientSecret, clientSecretCredentialOptions);
KeyVaultCertificateWithPolicy rootCertificate = new CertificateClient(vaultUri, _clientCredential).GetCertificate(_rootCertificateId).Value;


Comments

Popular posts from this blog

Command Line tool for Android and iOS [ adb and cfgutil ]

Convert Chrome recording to Vugen Script

Jmeter-CheatSheet