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
Azure | The host of the Azure Active Directory authority for tenants in the Azure China Cloud. |
Azure | The host of the Azure Active Directory authority for tenants in the Azure German Cloud. |
Azure | The host of the Azure Active Directory authority for tenants in the Azure US Government Cloud. |
Azure | 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
Post a Comment