由于提供了无效的客户秘密,Azure Cli无法连接

发布于 2025-01-30 04:46:40 字数 432 浏览 3 评论 0 原文

管道错误代码AADSTS7000215-提供了无效的客户端秘密。但是,提供的客户端秘密是正确的,因为当我本地运行脚本并在.env文件中提供client necret时。但是,使用Azurecli创建YAML文件,我会发现错误。

- task: AzureCLI@2
  inputs:
    azureSubscription: 'Subscription'
    scriptType: 'pscore'
    scriptLocation: 'inlineScript'
    inlineScript: 'python script.py'
    workingDirectory: 'workingdirectory'

完整错误:AADSTS7000215:提供了无效的客户端秘密。确保在请求中发送的秘密是客户的秘密值,而不是客户的秘密ID,用于添加到应用程序中的秘密

Pipeline error code AADSTS7000215- Invalid client secret is provided. however, the client secret provided is correct because when I run the script locally and provide client secret in .env file it runs. However, creating a yaml file with azurecli I get the error.

- task: AzureCLI@2
  inputs:
    azureSubscription: 'Subscription'
    scriptType: 'pscore'
    scriptLocation: 'inlineScript'
    inlineScript: 'python script.py'
    workingDirectory: 'workingdirectory'

Full ERROR: AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

余生再见 2025-02-06 04:46:40

客户端秘密错误可能与您使用的服务连接有关。
您是否验证了适当配置服务连接和相关SPN?

Client secret error might be related to service connection you use.
Did you verify that service connection and related SPN are properly configured?

灰色世界里的红玫瑰 2025-02-06 04:46:40

服务原理的客户秘密最长的寿命为两年,

有必要不时更新。由于它不是完全直接的,因此,这是关于如何进行“ Azure Resource Manager”连接的快速分步指南。

  • 进入azure devops =>项目设置=>服务连接并找到断裂的连接。

  • (此步骤是不需要的)从那里选择“管理服务主管”,将您重定向到Azure门户。在Azure Portal中,请转到证书&秘密。在这里,创建一个新的
    客户秘密并删除过期的秘密。

  • 在Azure DevOps中返回您的服务连接上的“编辑”。验证按钮仍将显示错误。

  • 更改描述文本框并保存,而无需再次验证新秘密以注册。

  • 现在,编辑窗格中的“验证”按钮应表明您的连接已修复。有时需要一秒钟的尝试,

但最终每次都对我有用。

来源:
学分:Thomas Pentenrieder

Client secrets for Service Principals have a maximum lifetime of two years

it’s necessary to update those from time to time. As it’s not completely straight-forward here’s a quick step-by-step guide on how to do it for connections of the type “Azure Resource Manager”.

  • Go into Azure DevOps => Project settings => Service connections and find your broken connection.

  • (this step is sometime not needed) From there select “Manage Service Principal” which will redirect you to the Azure Portal. In the Azure Portal go to Certificates & secrets. Here, create a new
    client secret and delete the expired secret.

  • Back in Azure DevOps click “Edit” on your service connection. The verify button will still show an error.

  • Make a change to the Description textbox and save without verifying again for the new secret to get registered.

  • Now the verify button in the Edit pane should show that your connection has been fixed. Sometimes it takes a second and a few tries,

but eventually this has worked for me everytime.

Source: Azure DevOps: Renew expired Service Connection Secret
Credit: Thomas Pentenrieder

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文