在运行 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 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 = "****"
client_id = "**client_id**"
client_secret = "****"
tenant_id = "**+*"
}
# Create a resource group
resource "azurerm_resource_group" "production" {
name = "productiongs"
location = "West US"
}
最佳答案
关于azure - Terraform 无法列出提供商注册状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46720266/