我已将服务连接转换为工作负载身份,现在我收到以下授权错误:
我根据文档添加了 use_oidc = true 选项:
- https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/guides/service_principal_oidc
我已将 use_oidc = true 选项添加到提供程序“azurerm”部分。我还尝试按照文档将其添加到后端,但没有任何配置对我来说是成功的。有人解决这个问题了吗?非常感谢任何帮助:)
PS,我正在使用 TerraformTaskV4@4 任务
要使用服务主体进行身份验证,您需要在后端块中提供所需的参数
client_id
、client_secret
、subscription_id
和 tenant_id
。
terraform {
backend "azurerm" {
resource_group_name = "v-vallepuv-Mindtree"
storage_account_name = "venkatstorage"
container_name = "venkat"
key = "prod.terraform.tfstate"
use_oidc = true
client_id = "xxxxxx"
subscription_id = "xxxxx"
tenant_id = "xxxxxxxx"
client_secret = "xxxxxxx"
use_azuread_auth = true
}
}
provider "azurerm"{
features {}
skip_provider_registration = "true"
subscription_id = "1234566-c5b6-44fb-b5ba-2b83a074c23f"
use_oidc = true
use_cli = false
}
输出:
如果您使用任何管道,请确保按照quadroid
的Stack Link在环境中设置服务主体详细信息
参考:堆栈链接1