2017-10-12 10 views
0

initを実行した後、tfファイルのあるフォルダでterraformを実行しようとしています。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、他のすべての必須フィールドがありますが、エラーが起こって続けます。お知らせ下さい?

EDIT:以下は、あなたのテラフォームの設定を見ることなく、私の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" 
 
}

+0

からあなたはstackoverflowので21Kのユーザーですが、あなたはせずに質問をお願いし、また

https://www.terraform.io/docs/providers/azurerm/

で与えられた指示に従って資格情報を作成しましたエラーメッセージ、エラーコード、コードの実行方法、設定した環境変数、その他の情報 – BMW

+0

本当にあなたの秘密の資格情報を投稿しましたか?それが事実なら、それらを取り消して、与えられた信用を使って行われた変更についてあなたのセットアップを監査してください。 –

答えて

1

であることは、問題を正確に知ることは難しいのですが、私はあなたのclient_idとclient_secretが欠落している推測しています。

は、だからあなたのプロバイダは、このようになります:

provider "azurerm" { 
    subscription_id = "..." 
    client_id  = "..." 
    client_secret = "..." 
    tenant_id  = "..." 
} 
ここ

詳細情報:https://www.terraform.io/docs/providers/azurerm/

+0

ええ、私はそれを指定しました。私は今日のコードを自宅から共有することができます。 – dotnetdev

0

与えられたエラーメッセージを見て、私は与えられた資格情報が言った以上必要な権限を持っていないと言うでしょうリソース。

perform action 'Microsoft.Resources/subscriptions/providers/read' 
over scope '/subscriptions/9a305d25-7f89-43d4-a691-62ad0f63c5c8'." 

あなたはhttps://github.com/Azure/vagrant-azure/issues/127#issuecomment-226659944

"To enable the application for use with Azure RM, you now need to switch to the 'New' Portal:" and further. You need to add that app credential to the Azure portal and give permission. Trick is about adding by name manually as "Type in the name of the application added in the 'Classic' Portal. You need to type this as it won't be shown in the user list. Click on the appropriate user in the list and then click Select"

関連する問題