Terraform v0.11.7
# Redacted for brevity
resource "azurerm_app_service_plan" "frontend_westeurope" {
name = "appserviceplannamehere"
location = "West Europe"
resource_group_name = "${azurerm_resource_group.frontend_westeurope.name}"
sku {
tier = "Isolated"
size = "I1"
capacity = 1
}
properties {
app_service_environment_id = "${azurerm_template_deployment.ase_westeurope.outputs["environmentId"]}"
}
}
App Service Plan created that is tied to an App Service Environment.
Unable to create App Service Plan:
* azurerm_app_service_plan.frontend_westeurope: web.AppServicePlansClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="BadRequest" Message="The parameter GeoRegion has an invalid value." Details=[{"Message":"The parameter GeoRegion has an invalid value."},{"Code":"BadRequest"},{"ErrorEntity":{"Code":"BadRequest","ExtendedCode":"51008","Message":"The parameter GeoRegion has an invalid value.","MessageTemplate":"The parameter {0} has an invalid value.","Parameters":["GeoRegion"]}}]
Seems this issue might be related. ASE ARM template specifies "West Europe" literal as the location, but when "West Europe" is hard-coded into location it gets overwritten with "westeurope" which causes the deployment to fail.
hi @CryptonZylog
Thanks for opening this issue :)
Taking a quick look into this this appears to be a bug in the App Service API where the API isn't handling that the values for these fields are the same underlying value (technically one is the raw value West Europe and one is the Enum value WestEurope) - but given these values are normalized in every other API I believe this should be fixed in the API rather than Terraform. I've opened this issue on the Azure Rest API Specs repository which I'd recommend following for updates.
Thanks!
@tombuildsstuff Hi! While I totally agree that this is an ARM API issue rather than a Terraform issue, there has been no development since this issue was first reported to Microsoft in 2016. The answer from Microsoft Unified support (given last friday) might also indicate that this issue is not of the highest priority:
While this is an ongoing request both on GitHub and in our workload, there is no official ETA that we can provide at this point. The best solution would be to monitor such a request either on feedback.azure.com where our Product Group team is directly involved or on GitHub.
On our side, the soonest we could implement such an update would be on the next Antares update, but without any official confirmation.
Is it acceptable to submit a pull request that omits the regular azureRMNormalizeLocation for resource_arm_app_service_plan and looks for a _azureRMNormalizeHumanReadableLocation_ format instead if the app_service_environment_id field is set?
Am I correct that this bug means it is impossible to provision an App Service Plan using the azurerm_app_service_plan resource right now? There is no work around is there?
I'm running into the same errors as in the original issue description.
@eoly this resource seems to get more broken as we go along. I have never been able to make the azurerm_app_service_plan resource work but previously it was failing for returning what was deemed an undocumented return code. It would at least create the App Service Plan but Terraform would see it as a fail because of the unexpected return code. Now, the exact same code won't even create the App Service Plan and fails for the Invalid GeoRegion error. I have been deploying App Service Plans with Terraform using an ARM template resource. I have not done one in a while but today I tried using the code that has worked with no issues in the past and it failed for the Invalid GeoRegion error. This was an ARM template resource. I wound up going to the portal, creating one manually and grabbing the ARM template from it. To my surprise...this template used an older version of the API that I had previously used in my working Terraform code. I updated the ARM template in my Terraform config using the info from the manually built ASP ARM template and now my Terraform code is working again. Palm 2 4-Head
๐
A version of the App Service API including this fix should have finished rolling out by tomorrow - would someone be able to confirm if they're still seeing this behaviour?
Thanks!
๐
Since we've not heard back here I'm going to close this issue for the moment - however if you're still seeing this feel free to let us know and we'll take another look.
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
hi @CryptonZylog
Thanks for opening this issue :)
Taking a quick look into this this appears to be a bug in the App Service API where the API isn't handling that the values for these fields are the same underlying value (technically one is the raw value
West Europeand one is the Enum valueWestEurope) - but given these values are normalized in every other API I believe this should be fixed in the API rather than Terraform. I've opened this issue on the Azure Rest API Specs repository which I'd recommend following for updates.Thanks!