我将使用 Azure Function App 的 key 保管库。
我正在使用 .NET SDK。
- Azure.Security.KeyVault.Secrets
- Azure.Identity
示例:
string keyVaultUrl = configuration["KeyVaultSettings:Url"];
TokenCredential credential = new DefaultAzureCredential();
#if DEBUG
credential = new ClientSecretCredential(configuration["AZURE_TENANT_ID"],
configuration["AZURE_CLIENT_ID"],
configuration["AZURE_CLIENT_SECRET"]);
#endif
var secretClient = new SecretClient(new Uri(keyVaultUrl), credential);
要在本地调试,我需要
tenant_id, client_id, and client_secret.
我怎样才能得到这个?
最佳答案
关于azure - 我们如何获取 Azure Function App 的租户 ID、客户端 ID 和客户端 key ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63776418/