Azure DevOps - 服务主体不工作

标签 azure azure-devops azure-service-principal

我有一个 Azure DevOps,并尝试使用服务原理连接到 Azure Key Vault。

我已在 Azure KeyVault 的访问策略中添加了服务原则,并将 Secret 权限设置为“获取和列出”

但是当我为变量组添加库时,我收到此错误消息,我已经完成了。

不确定我的设置是否遗漏了任何内容。

Specified Azure service connection needs to have "Get, List" secret management permissions on the selected key vault. Set these secret permissions in Azure portal or run the following commands in powershell window.


$ErrorActionPreference="Stop";Login-AzureRmAccount -SubscriptionId XXXXXXXXXXXXXXXX;$spn=(Get-AzureRmADServicePrincipal -SPN YYYYYYYYYYYYYYYYYYYYYY);$spnObjectId=$spn.Id;Set-AzureRmKeyVaultAccessPolicy -VaultName keyvault -ObjectId $spnObjectId -PermissionsToSecrets get,list;

最佳答案

我猜测是否是 DevOps 服务连接缺少权限。您可以从控制台检查保管库的访问策略。

您应该将您的服务连接视为一个应用程序;它需要 GET 和 LIST 权限,正如您下面的文档所述。您可以通过导航到 keyvault 下的访问策略来设置它

关于Azure DevOps - 服务主体不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65125485/

相关文章:

asp.net-core - 在 Azure DevOps 管道中设置连接字符串

azure - 使用 powershell 重置 Azure 服务主体的客户端 key

azure - 从 Azure 管道任务访问 Microsoft.Azure.WebSites 资源提供程序(Microsoft Azure 应用服务)的服务主体

c# - 如何保护 Web API 和应用程序 (Azure AD) 使用的 Azure SQL 数据库的安全

azure - 我可以使用 Azure Active Directory 库 (ADAL) 从 Azure AD 获取 SAML 响应吗?

azure - 无法在 Azure DevOps 管道中运行嵌套的 az cli 命令

azure-devops - 如何使用 Rest API 在测试用例工作项中添加测试步骤

Azure Devops 持续部署管道 "Job is pending..."错误,没有任何日志

json - 在查询 JMESPATH 上实现条件

c# - 如何将 Microsoft.WindowsAzure.Storage 替换为 Microsoft.Azure.Storage.Blob