0
votes

I worked with Terraform for AWS before successfully. Now I am trying to work with Azure and facing a few challenges. I have successfully authenticated to my azure account using Azure CLI. When I run the basic terraform provider arm .tf and do a terraform init it just works. But when I put in any additional code like container creation or blob creation .tfs, the init is not working and is giving me the below message :

No available provider "azure" plugins are compatible with this Terraform version.

Error: no available version is compatible with this version of Terraform

Terraform version :

bash-3.2$ terraform -v
Terraform v0.12.19
+ provider.azurerm v1.38.0

I used version 1.38.0 and tried many others but it still continues to give me error.

1
What does your Terraform code look like?ydaetskcoR
bash-3.2$ cat main.tf provider "azurerm" { version = "~> 1.27" } bash-3.2$ cat container.tf resource "azure_storage_container" "stor-cont" { name = "terraform-storage-container" container_access_type = "blob" storage_service_name = "abcycentralstorage" }azdevad1
You should have edited your question to include it with formatted code blocks. But it's a simple typo anyway. That should be azurerm_storage_container.ydaetskcoR
Thanks for the response. Changing the resource from azure_storage_container to azurerm_storage_container made it work. Also there was another change that I had to do - from 'storage_service_name' to 'storage_account_name'.azdevad1
A quick follow up to the above is that I got the template from the below location : terraform.io/docs/providers/azure/r/storage_container.html but it appears the syntax when using azurerm is different. Is there someplace else that I should be looking for to get the accurate syntax ?azdevad1

1 Answers

0
votes

They are the two providers for the different Azure models.

Azure Service Management Provider model is the classic model in Azure and is not recommended to use now. It provides the resources with format azure_xxx.

Azure Resource Manager Provider model is the Resource Manager model which calls ARM and is recommended to use and supported well. It provides the resources with format azurerm_xxx.

You can also learn more about the ASM and ARM model in document Azure Resource Manager vs. classic deployment: Understand deployment models and the state of your resources.