Terraform-provider-azurerm: Error creating/updating App Service Plan (Message="Property id '' at path 'properties.hostingEnvironmentProfile.id' is invalid)

Created on 25 Feb 2020  ·  10Comments  ·  Source: terraform-providers/terraform-provider-azurerm

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

Hello,
Since today terraform refuses to deploy our .NET core web application to azure using terraform. Everything worked fine yesterday, we didn't change anything.

Relevant terraform config

resource "azurerm_resource_group" "rgnetwork" {
    name = var.ResourceGroupNameNetwork
    location = "West europe"
}

resource "azurerm_app_service_plan" "asp" {
    name = var.asp-name
    resource_group_name = azurerm_resource_group.rg.name
    location = azurerm_resource_group.rg.location
    kind = "Windows"

    sku {
        size = var.asp-sku-size
        tier = var.asp-sku-tier
    }
}

Debug Output


Message="Property id '' at path 'properties.hostingEnvironmentProfile.id' is invalid
https://gist.github.com/woeterman94/8abb5a9706c8cc101bacd07f1330905d

Expected Behavior

Create / update the resource

Actual Behavior


The step crashed.

(same issue as : https://github.com/hashicorp/terraform/issues/24209 ? )

bug

All 10 comments

Put

provider "azurerm" {
  version = "~> 1.44"
}

On top of my terraform file, app service plan steps keep failing

2020-02-25T14:24:54.7056150Z �[0m�[1mazurerm_app_service_plan.asp: Modifying... [id=/subscriptions/xx/resourceGroups/xx-web/providers/Microsoft.Web/serverfarms/xx]�[0m�[0m
2020-02-25T14:24:54.8389984Z �[31m
2020-02-25T14:24:54.8392064Z �[1m�[31mError: �[0m�[0m�[1mError creating/updating App Service Plan "xxx" (Resource Group "xxx"): web.AppServicePlansClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="LinkedInvalidPropertyId" Message="Property id '' at path 'properties.hostingEnvironmentProfile.id' is invalid. Expect fully qualified resource Id that start with '/subscriptions/{subscriptionId}' or '/providers/{resourceProviderNamespace}/'."�[0m

Maybe this issue is only about azurem v 2.0.0
If you can stay on version 1.44, may be you can try to force version:

provider "azurerm" {
version = "=1.44.0"
}

Maybe this issue is only about azurem v 2.0.0
If you can stay on version 1.44, may be you can try to force version:

provider "azurerm" {
version = "=1.44.0"
}

Thanks, but see above. I did set the version to 1.44.

I opened a pull request here: https://github.com/terraform-providers/terraform-provider-azurerm/pull/5910

I'm not sure that this is the reason why the step keeps failing, but it's my best guess since that line was changed 3 days ago.

v2.1.0? What about the older versions?

My temporary solution to get us unblocked was to manually delete the affected resources, then re-run the terraform at 1.44. Luckily this was just affecting our development environment.

This is less than ideal, but if you're totally stuck, and it's safe to temporarily delete your app service, then recreate it, this might help you!

This issue will be fixed in the next version. Looks like people stuck on 1.44 are forced to upgrade.

Hi @woeterman94
As far as I am aware, this issue was introduced in 2.0, and was not present in 1.44. However, if you have run Terraform with version 2.0 of the AzureRM provider against your configuration(s) then your state will have likely been modified. Terraform prevents earlier versions modifying the state, so you'd not be able to simply drop back to 1.44 without either restoring an earlier version of the state (assuming you're on remote state with versioning) or by modifying the state yourself (possibly remove and import, or manually). I'm afraid I can't advise on which would be the appropriate option in your situation.

Ste

This has been released in version 2.1.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.1.0"
}
# ... other configuration ...

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!

Was this page helpful?
0 / 5 - 0 ratings