gpt4 book ai didi

azure - Terraform 无法列出提供商注册状态

转载 作者:行者123 更新时间:2023-12-04 16:07:14 25 4
gpt4 key购买 nike

在运行 init 后,我​​尝试在包含 tf 文件的文件夹上运行 terraform apply。

但是,我收到以下错误:

Error running plan: 1 error(s) occurred:

  • provider.azurerm: Unable to list provider registration status, it is possible that this is due to invalid credentials or the serviceprincipal does not have permission to use the Resource Manager API,Azure error: resources.ProvidersClien t#List: Failure responding torequest: StatusCode=403 -- Original Error: autorest/azure: Servicereturned an error. Stat us=403 Code="AuthorizationFailed" Message="Theclient '17cd0b64-08fb-48db-ad9f-4dd56361bb47' with object id'17cd0b64-08 fb-48db-ad9f-4dd56361bb47' does not have authorization toperform action 'Microsoft.Resources/subscriptions/providers/re ad'over scope '/subscriptions/9a305d25-7f89-43d4-a691-62ad0f63c5c8'."

tf 文件包含我的租户 ID、订阅 ID 以及所有其他必填字段,但错误不断发生。请指教?

编辑:下面是我的 tf 文件

  provider "azurerm" {
subscription_id = "****"
client_id = "**client_id**"
client_secret = "****"
tenant_id = "**+*"
}



# Create a resource group
resource "azurerm_resource_group" "production" {
name = "productiongs"
location = "West US"
}

最佳答案

服务主体似乎没有分配Contributor 角色。

只需转到门户中的订阅,选择访问控制 (IAM)添加角色分配>、服务主体的贡献者

enter image description here

Or follow these instructions

关于azure - Terraform 无法列出提供商注册状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46720266/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com