Prisma Cloud:Azure 入职 Terraform“错误:从 Azure CLI获取授权令牌时出错”
4820
Created On 09/15/22 13:17 PM - Last Modified 07/29/25 14:55 PM
Objective
"Error: Error obtaining Authorization Token from the Azure CLI: Error parsing json result from the Azure CLI: Error waiting for the Azure CLI: exit status 1: ERROR: Tenant shouldn't be specified for Cloud Shell account"
with provider["registry.terraform.io/hashicorp/azuread"],
? on terraform (1).tf line 91, in provider "azuread":
? 91: provider "azuread" {
When running the terraform commands in your Azure Cloud shell during the onboarding process.Environment
- Prisma Cloud
- Azure 入职
Procedure
这似乎是微软的问题。当用户运行 Terraform 时, CLI (命令行界面)不会解析令牌信息并出现错误。
解决此问题的步骤:
- 在 Azure 中打开CLI (Cloud Shell)并运行以下命令登录到 Azure
$ az login
- 它将提示链接? https://microsoft.com/devicelogin ?和验证码
- 使用浏览器打开链接并输入代码进行身份验证
- 现在我们可以运行 Terraform 命令进行入职培训
$ terraform init $ terraform apply
Additional Information
查看此处的文档,以通过 terraform 加入您的 Azure 帐户。