我試圖在運行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
你真的發佈了你的祕密憑證嗎?如果是這種情況,請撤銷它們並審覈您的設置,以瞭解使用給定信用完成的任何更改。 –