我试图在运行init后运行terraform应用于具有tf文件的文件夹。Terraform无法列出提供者注册状态
不过,我得到以下错误:
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 service principal does not have permission to use the Resource Manager API, Azure error: resources.ProvidersClien t#List: Failure responding to request: StatusCode=403 -- Original Error: autorest/azure: Service returned an error. Stat us=403 Code="AuthorizationFailed" Message="The client '17cd0b64-08fb-48db-ad9f-4dd56361bb47' with object id '17cd0b64-08 fb-48db-ad9f-4dd56361bb47' does not have authorization to perform action 'Microsoft.Resources/subscriptions/providers/re ad' over scope '/subscriptions/9a305d25-7f89-43d4-a691-62ad0f63c5c8'."
的TF文件有我的租户ID,订阅ID,所有其他必填字段,但这个错误持续发生。请指教?
编辑:下面是我的TF文件
provider "azurerm" {
subscription_id = "9a305d25-7f89-43d4-a691-62ad0f63c5c8"
client_id = "b5c92e75-9609-40d4-a64c-8d09be8b3a26"
client_secret = "CO5FufAOpH!j0r*Rlf0gi^[email protected]{}A=zUZRbsf"
tenant_id = "4da92a32-54f3-4287-bbdb-bafbf8b87840"
}
# Create a resource group
resource "azurerm_resource_group" "production" {
name = "productiongs"
location = "West US"
}
你是21K用户#1,但你问的问题不任何细节,但错误消息,你可以提供的其他东西,比如代码,如何运行命令,设置的环境变量等等? – BMW
你真的发布了你的秘密凭证吗?如果是这种情况,请撤销它们并审核您的设置,以了解使用给定信用完成的任何更改。 –