gpt4 book ai didi

azure - MSINotEnabled - 无法在 Azure Function 中使用 KeyVault 引用

转载 作者:行者123 更新时间:2023-12-03 07:00:27 24 4
gpt4 key购买 nike

我正在尝试使用用户分配托管标识来检索 Azure Functions 中 KeyVault 引用的访问权限。

enter image description here

我正在关注此文档 https://learn.microsoft.com/en-us/azure/app-service/app-service-key-vault-references?tabs=azure-cli#:~:text=you%20haven%27t%20already.-,Configure,-the%20app%20to在应用程序配置中引用 keyvault。

我按照以下步骤操作:

  1. 已创建用户分配托管身份。

  2. 在 Keyvault 中创建策略并向用户分配托管身份授予 GET 和 LIST 权限。

  3. 在 Azure Function Identity 中设置用户分配托管标识

  4. 像这样设置属性应用程序设置:

  • mysecureapp - @Microsoft.KeyVault(SecretUri=https://mykv.vault.azure.net/secrets/mysecret/id)
  • keyVaultReferenceIdentity -/subscriptions/subsid/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/mgid

对此有什么想法吗?

最佳答案

我意识到,除了通过应用程序设置设置属性keyVaultReferenceIdentity之外,我们还需要在资源函数中更改这个同名属性。如果启用,默认值为SystemAssign。不幸的是,MS 文档对此并不清楚。

我在terraform文档中找到了可以使用的属性,请点击链接:https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/function_app#:~:text=key_vault_reference_identity_id

将此属性设置为“用户分配托管身份”的值后,效果很好。

关于azure - MSINotEnabled - 无法在 Azure Function 中使用 KeyVault 引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72448905/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com