I am trying to create/deploy Azure Standard Logic App using Terrform and getting below error message.
Error: creating Logic App Standard: (Site Name "shd-sbx-spikeecrime-sla" / Resource Group "shd-sbx-uks-spikeecrime-rg"): web.AppsClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: autorest/azure: Service returned an error. Status=<nil> <nil>
Terraform configs:
resource "azurerm_app_service_plan" "main" {
name = "${local.business_unit}-${local.environment}-${local.identifier}-asp"
location = module.resource_group.location
resource_group_name = module.resource_group.name
kind = "elastic"
sku {
tier = "WorkflowStandard"
size = "WS1"
}
}
resource "azurerm_storage_account" "main" {
name = "${local.business_unit}0${local.environment}0${local.identifier}0sa"
location = module.resource_group.location
resource_group_name = module.resource_group.name
account_tier = "Standard"
account_replication_type = "LRS"
}
resource "azurerm_logic_app_standard" "main" {
name = "${local.business_unit}-${local.environment}-${local.identifier}-sla"
location = module.resource_group.location
resource_group_name = module.resource_group.name
app_service_plan_id = azurerm_app_service_plan.main.id
storage_account_name = azurerm_storage_account.main.name
storage_account_access_key = azurerm_storage_account.main.primary_access_key
app_settings = {
FUNCTIONS_WORKER_RUNTIME = "node"
WEBSITE_NODE_DEFAULT_VERSION = "~18"
}
}
TF plan output:
terraform apply --auto-approve
module.resource_group.azurerm_resource_group.main: Refreshing state... [id=/subscriptions/ad0af8a3-80b9-4d65-a992-339cf04886f1/resourceGroups/shd-sbx-uks-spikeecrime-rg]
azurerm_app_service_plan.main: Refreshing state... [id=/subscriptions/ad0af8a3-80b9-4d65-a992-339cf04886f1/resourceGroups/shd-sbx-uks-spikeecrime-rg/providers/Microsoft.Web/serverfarms/shd-sbx-spikeecrime-asp]
azurerm_storage_account.main: Refreshing state... [id=/subscriptions/ad0af8a3-80b9-4d65-a992-339cf04886f1/resourceGroups/shd-sbx-uks-spikeecrime-rg/providers/Microsoft.Storage/storageAccounts/shd0sbx0spikeecrime0sa]
Note: Objects have changed outside of Terraform
Terraform detected the following changes made outside of Terraform since the last "terraform apply":
# azurerm_storage_account.main has changed
~ resource "azurerm_storage_account" "main" {
id = "/subscriptions/ad0af8a3-80b9-4d65-a992-339cf04886f1/resourceGroups/shd-sbx-uks-spikeecrime-rg/providers/Microsoft.Storage/storageAccounts/shd0sbx0spikeecrime0sa"
name = "shd0sbx0spikeecrime0sa"
+ tags = {}
# (37 unchanged attributes hidden)
# (4 unchanged blocks hidden)
}
Unless you have made equivalent changes to your configuration, or ignored the relevant attributes using ignore_changes, the following plan may include actions to undo or respond to these changes.
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# azurerm_logic_app_standard.main will be created
+ resource "azurerm_logic_app_standard" "main" {
+ app_service_plan_id = "/subscriptions/ad0af8a3-80b9-4d65-a992-339cf04886f1/resourceGroups/shd-sbx-uks-spikeecrime-rg/providers/Microsoft.Web/serverfarms/shd-sbx-spikeecrime-asp"
+ app_settings = {
+ "FUNCTIONS_WORKER_RUNTIME" = "node"
+ "WEBSITE_NODE_DEFAULT_VERSION" = "~18"
}
+ bundle_version = "[1.*, 2.0.0)"
+ client_affinity_enabled = (known after apply)
+ custom_domain_verification_id = (known after apply)
+ default_hostname = (known after apply)
+ enabled = true
+ https_only = false
+ id = (known after apply)
+ kind = (known after apply)
+ location = "uksouth"
+ name = "shd-sbx-spikeecrime-sla"
+ outbound_ip_addresses = (known after apply)
+ possible_outbound_ip_addresses = (known after apply)
+ resource_group_name = "shd-sbx-uks-spikeecrime-rg"
+ site_credential = (known after apply)
+ storage_account_access_key = (sensitive value)
+ storage_account_name = "shd0sbx0spikeecrime0sa"
+ storage_account_share_name = (known after apply)
+ use_extension_bundle = true
+ version = "~3"
+ connection_string {
+ name = (known after apply)
+ type = (known after apply)
+ value = (sensitive value)
}
+ site_config {
+ always_on = (known after apply)
+ app_scale_limit = (known after apply)
+ auto_swap_slot_name = (known after apply)
+ dotnet_framework_version = (known after apply)
+ elastic_instance_minimum = (known after apply)
+ ftps_state = (known after apply)
+ health_check_path = (known after apply)
+ http2_enabled = (known after apply)
+ ip_restriction = (known after apply)
+ linux_fx_version = (known after apply)
+ min_tls_version = (known after apply)
+ pre_warmed_instance_count = (known after apply)
+ public_network_access_enabled = (known after apply)
+ runtime_scale_monitoring_enabled = (known after apply)
+ scm_ip_restriction = (known after apply)
+ scm_min_tls_version = (known after apply)
+ scm_type = (known after apply)
+ scm_use_main_ip_restriction = (known after apply)
+ use_32_bit_worker_process = (known after apply)
+ vnet_route_all_enabled = (known after apply)
+ websockets_enabled = (known after apply)
+ cors {
+ allowed_origins = (known after apply)
+ support_credentials = (known after apply)
}
}
}
Plan: 1 to add, 0 to change, 0 to destroy.
azurerm_logic_app_standard.main: Creating...
azurerm_logic_app_standard.main: Still creating... [10s elapsed]
╷
│ Warning: Deprecated Resource
│
│ with azurerm_app_service_plan.main,
│ on standard_logic_app.tf line 2, in resource "azurerm_app_service_plan" "main":
│ 2: resource "azurerm_app_service_plan" "main" {
│
│ The `azurerm_app_service_plan` resource has been superseded by the `azurerm_service_plan` resource. Whilst this resource will continue to be available in the 2.x and 3.x releases it is
│ feature-frozen for compatibility purposes, will no longer receive any updates and will be removed in a future major release of the Azure Provider.
│
│ (and one more similar warning elsewhere)
╵
╷
│ Error: creating Logic App Standard: (Site Name "shd-sbx-spikeecrime-sla" / Resource Group "shd-sbx-uks-spikeecrime-rg"): web.AppsClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: autorest/azure: Service returned an error. Status=<nil> <nil>
│
│ with azurerm_logic_app_standard.main,
│ on standard_logic_app.tf line 24, in resource "azurerm_logic_app_standard" "main":
│ 24: resource "azurerm_logic_app_standard" "main" {
Any help much appreciated.
This is a very transient issue which is not related to the
azurermside.Need to check below:
Make sure that you have logged in with the correct azure login credentials and has necessary permissions to create or update the resource.
Try upgrading the terraform and CLI version using
terraform init -upgrade. If still the issue persists, run the same code inVS codeto avoid conflicts.Instead of using modules for resource group delegation, try using
resourceordatablock as shown below.Provide
--debugargument along with theterraform applyto retrieve more information on the error part.Moreover, check the configuration and property values of app service plan, storage account tier details are given accurately with the help of terraform registry
azurerm_logic_app_standarddocument.I tried below terraform code in my environment and was able to deploy it successfully as shown below.
Deployment succeeded: