Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error creating/updating App Service Plan (Message="Property id '' at path 'properties.hostingEnvironmentProfile.id' is invalid) #5884

Closed
woeterman94 opened this issue Feb 25, 2020 · 10 comments · Fixed by #5915
Labels
Milestone

Comments

@woeterman94
Copy link

woeterman94 commented Feb 25, 2020

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 : hashicorp/terraform#24209 ? )

@woeterman94
Copy link
Author

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

@GregoryFrance
Copy link

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"
}

@woeterman94
Copy link
Author

woeterman94 commented Feb 25, 2020

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.

@woeterman94 woeterman94 changed the title Error creating/updating App Service Plan Failure sending request: StatusCode=400 Error creating/updating App Service Plan (Message="Property id '' at path 'properties.hostingEnvironmentProfile.id' is invalid) Feb 26, 2020
@woeterman94
Copy link
Author

I opened a pull request here: #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.

@woeterman94
Copy link
Author

v2.1.0? What about the older versions?

@rikkiprince
Copy link

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!

@woeterman94
Copy link
Author

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

@jackofallops
Copy link
Member

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

@ghost
Copy link

ghost commented Mar 11, 2020

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 ...

@ghost
Copy link

ghost commented Apr 3, 2020

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!

@ghost ghost locked and limited conversation to collaborators Apr 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
4 participants