当我在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'或该范围无效。如果最近授予访问权限,请刷新您的凭据。”)
答案 0 :(得分:0)
您需要为在门户网站的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.
}
}
}
}
角色。