如何解决Azure授权失败
当我在azure环境中运行python脚本来管理虚拟机时,由于 AuthorizationFailed 消息而失败。出现以下异常以及错误消息。
CloudError(“具有对象ID为'bdafca09-d426-4924-b63c-dff61c034187'的客户端'bdafca09-d426-4924-b63c-dff61c034187'无权执行操作'Microsoft.Resources / subscriptions / resourcegroups / write'over scope'/ subscriptions / 49ec57ce-8a6f-4cdf-95bf-8163b231edf6 / resourcegroups / azure-sample-group-virtual-machines'或该范围无效。如果最近授予访问权限,请刷新您的凭据。”)
解决方法
您需要为在门户网站的Azure AD中创建的应用程序添加//current pipeline:
pipeline {
agent any
parameters {
string(description: "The full ssh repo URL",name: "REPO_URL")
string(description: "The branch name",name: "BRANCH")
}
stages {
stage('Checkout Git Repository') {
steps {
git branch: "${params.BRANCH}",url: 'git@github.com/myrepo.git',credentialsId: 'my-credentials'
}
}
stage('Running the first Job') {
steps {
build job: 'util-first-job',parameters: [] //I expected myrepo source to be available in this job.
}
}
}
}
角色。
- 在订阅(搜索订阅)中选择您的订阅 在顶部栏中)
- 在访问控制 中添加角色分配
- 选择并为您的应用添加贡献者角色。
- 如果添加成功,您将在角色分配列表中看到您的应用程序。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。