Versions 11.0 and 11.3 exhibit the behaviour
Extract of the script element (based on terraform reference script) :
resource "azurerm_container_service" "acs" {
  name                   = "${var.resource_name}-acs1"
  location               = "${azurerm_resource_group.rg.location}"
  resource_group_name    = "${azurerm_resource_group.rg.name}"
  orchestration_platform = "Kubernetes"
master_profile {
    count      = 1
    dns_prefix = "${var.resource_name}-master1"
  }
The creation of an ACS cluster with one master and using Kubernetes as the orchestrator. The script had previously worked.
A new script was created, and the old one re-initialised during troubleshooting. Both resulted in the following error:
using the standard terraform script for ACS (https://www.terraform.io/docs/providers/azurerm/r/container_service.html), copy into a new folder and 'terraform init' with no version specified within the azurerm provider. The error will then occur when you apply the script.
Specifying the version within the Azurerm provider, I've found the error does not appear if version = 1.0.1 is set. All later versions appear to be affected.
hey @stutyr
Thanks for opening this issue - apologies that this bug slipped through.
It appears this only occurs when updating an existing Container Service - which we're currently missing tests for (which is why we missed this). Given our existing create tests aren't failing, it appears this gets defaulted if not specified at the Azure side, but is then required for updates  - as part of fixing this we'll need to add a new Optional + Computed field for vm_size.
Thanks!
Thanks for this Stu
I came across this while creating a new Container Service inside an existing Resource Group. I can provide more info if it helps.
EDIT: Deleted the resource group and ran again resulting in this error. (Empty subscription otherwise)
+1 first time using ACS with a blank subscription and seeing this as well.
@Dan-Wolfy Hi Dan. there is a work around for this. In your providers section of your Terraform script add the following line:
version = "1.0.1"
your providers section should look something like this
provider "azurerm" {
  version = "1.0.1"
  subscription_id = "${var.subscription_id}"
  client_id = "${var.client_id}"
  client_secret = "${var.client_secret}"
 tenant_id       = "${var.tenant_id}"
}
Hope this helps
+1 same issue with
Terraform v0.11.8
provider.azurerm v1.9.0
Any traction on this? To get around this bug, I have to use an ARM template which is...less than ideal.
hi @stutyr @mikedbrook @carterwilliamson @Dan-Wolfy @ljmsc @bcline760
Apologies for the delayed update here!
Microsoft's recently announced the deprecation of Azure Container Service in favour of Azure (Managed) Kubernetes Service.
In preparation for this we're deprecating the azurerm_container_service resource in version 1.20 of the AzureRM Provider - as such when using a 1.x version of the AzureRM Provider the azurerm_container_service will continue to function until the API is removed on the 31st January 2020.
We plan to remove support for the azurerm_container_service resource in version 2.0 of the AzureRM Provider - should you wish to continue using the AzureRM Provider past this date you'll need to ensure your Provider block is pinned to a 1.x version, for example:
provider "azurerm" {
  version = ">= 1.0.0, <= 2.0.0"
}
alternatively you can pin the Provider block to a specific version (more information about version pinning can be found on the Provider page):
provider "azurerm" {
  version = "=1.19.0"
}
If you're using ACS with Kubernetes Microsoft's recommendation is to migrate to using Azure (Managed) Kubernetes Service (AKS) which is available as the azurerm_kubernetes_cluster resource within Terraform.
Since the azurerm_container_service resource is being deprecated, I'm going to close this issue for the moment.
Thanks!
I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!
Most helpful comment
@Dan-Wolfy Hi Dan. there is a work around for this. In your providers section of your Terraform script add the following line:
version = "1.0.1"
your providers section should look something like this
provider "azurerm" {
version = "1.0.1"
subscription_id = "${var.subscription_id}"
client_id = "${var.client_id}"
client_secret = "${var.client_secret}"
tenant_id = "${var.tenant_id}"
}
Hope this helps