provider "azurerm" {}
resource "azurerm_app_service_plan" "some-app-service-plan" {
name = "asp-check-bug"
resource_group_name = "my-resource-group"
location = "eastus2"
sku {
tier = "Free"
size = "F1"
}
}
resource "azurerm_app_service" "some-app-service" {
name = "aps-check-bug"
resource_group_name = "my-resource-group"
location = "eastus2"
app_service_plan_id = "${azurerm_app_service_plan.some-app-service-plan.id}"
site_config {
always_on = true
use_32_bit_worker_process = true
}
}
https://gist.github.com/alant94/e9f8e2f1c26183b02d4e94ce67ec3b78
During scale down operation of App Service Plan from Standard to Free tier it should successfully complete or return an error, explaining why it is impossible. Like the errors specified in Activity log of resource.
In case of the configuration described above, the error should be Cannot update the site 'aps-check-bug' because it uses AlwaysOn feature which is not allowed in the target compute mode.
The same behavior is expected in case if use_32_bit_worker_process = false
, meaning the error should be Cannot update the site 'aps-check-bug' because it uses x64 worker process which is not allowed in the target compute mode.
The error that is returned by terraform is kind of uninformative:
azurerm_app_service_plan.rcg-app-service-plan: Error creating/updating App Service Plan "asp-check-bug" (Resource Group "my-resource-group"): web.AppServicePlansClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: autorest/azure: Service returned an error. Status=<nil> <nil>
terraform apply
of the following configurationprovider "azurerm" {}
resource "azurerm_app_service_plan" "some-app-service-plan" {
name = "asp-check-bug"
resource_group_name = "my-resource-group"
location = "eastus2"
sku {
tier = "Standard"
size = "S1"
}
}
resource "azurerm_app_service" "some-app-service" {
name = "aps-check-bug"
resource_group_name = "my-resource-group"
location = "eastus2"
app_service_plan_id = "${azurerm_app_service_plan.some-app-service-plan.id}"
site_config {
always_on = true
use_32_bit_worker_process = true
}
}
terraform apply
of changed configuration to scale down app service plan:provider "azurerm" {}
resource "azurerm_app_service_plan" "some-app-service-plan" {
name = "asp-check-bug"
resource_group_name = "my-resource-group"
location = "eastus2"
sku {
tier = "Free"
size = "F1"
}
}
resource "azurerm_app_service" "some-app-service" {
name = "aps-check-bug"
resource_group_name = "my-resource-group"
location = "eastus2"
app_service_plan_id = "${azurerm_app_service_plan.some-app-service-plan.id}"
site_config {
always_on = true
use_32_bit_worker_process = true
}
}
May be connected to (at least error is the same)
@alant94 Thanks for reporting this issue.
After investigation , I think it is caused by incomplete error message returned by Azure Go SDK.
HTTP API response:
{
"Code": "Conflict",
"Message": "Cannot update the site 'acctestAS-8714886780103063993' because it uses AlwaysOn feature which is not allowed in the target compute mode.",
"Target": null,
"Details": [{
"Message": "Cannot update the site 'acctestAS-8714886780103063993' because it uses AlwaysOn feature which is not allowed in the target compute mode."
}, {
"Code": "Conflict"
}, {
"ErrorEntity": {
"ExtendedCode": "04068",
"MessageTemplate": "Cannot update the site '{0}' because it uses AlwaysOn feature which is not allowed in the target compute mode.",
"Parameters": ["acctestAS-8714886780103063993"],
"Code": "Conflict",
"Message": "Cannot update the site 'acctestAS-8714886780103063993' because it uses AlwaysOn feature which is not allowed in the target compute mode."
}
}],
"Innererror": null
}
Error message returned by Azure Go SDK:
* azurerm_app_service_plan.test: Error creating/updating App Service Plan "acctestASP-8714886780103063993" (Resource Group "acctestRG-8714886780103063993"): web.AppServicePlansClient#CreateOrUpdate: Failure sending request:StatusCode=0 -- Original Error: autorest/azure: Service returned an error. Status=<nil> <nil>
I will open an issue for Azure Go SDK to follow up this issue.
Closing this in favour of #6796 which is tracking the same thing
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
@alant94 Thanks for reporting this issue.
After investigation , I think it is caused by incomplete error message returned by Azure Go SDK.
HTTP API response:
Error message returned by Azure Go SDK:
I will open an issue for Azure Go SDK to follow up this issue.