How to successfully create a static web app using Terraform apply?

Steven Bruce 0 Reputation points
2025-07-31T14:46:47.0366667+00:00

I have a terraform configuration file that defines a azurerm_static_web_app. When I apply this template, the resource is created and I can successfully deploy a SWA; however, the the console seems to get stuck and the process never seems to finish.

I end up with this. Yes, it's doing the same for a linux web app too...
User's image

Ultimately, I'm asking for ideas and suggestions as to what could be causing this and how to fix it.

Here is the terraform configuration:

resource "azurerm_static_web_app" "res-503" {
  location            = "westeurope"
  name                = "swa-${var.instance_name}"
  resource_group_name = azurerm_resource_group.res-0.name
  sku_size            = "Standard"
  sku_tier            = "Standard"
  depends_on = [
    azurerm_resource_group.res-0
  ]
}
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
{count} votes

1 answer

Sort by: Most helpful
  1. Siva Nair 345 Reputation points Microsoft External Staff Moderator
    2025-08-01T12:41:55.67+00:00

    Hi Steven Bruce,

    Great! That you got the issue resolved.

    Upgrading to AzureRM provider version 4.38.1 likely a great step to improved the lifecycle handling for azurerm_static_web_app and similar resources.

    • Lock provider versions in your Terraform config to avoid unexpected behavior:
        terraform {
          required_providers {
            azurerm = {
              source  = "hashicorp/azurerm"
              version = ">= 4.38.1"
            }
          }
        }
      
    • Check the changelog for provider updates: https://github.com/hashicorp/terraform-provider-azurerm/blob/main/CHANGELOG.md
    • Test upgrades in a staging environment if possible, especially for production-critical infrastructure.

    Thanks!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.