Azure Static Web App Terraform error

Jolo Gonzales 40 Reputation points
2024-07-24T07:05:06.36+00:00

Hi Microsoft Azure,

We are trying to deploy Static Web App using Terraform.

The requirement is to deploy Static Web App ONLY (global) and exclude Azure Function that requires an azure region.

We have achieved it through azure portal.

When we try in Terraform, the field location is required ->

User's image

QUESTION: How do we achieve the requirement in terraform? Is there a guide to do this in Terraform -> https://learn.microsoft.com/en-us/azure/static-web-apps/functions-bring-your-own?source=recommendations

Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
851 questions
{count} votes

1 answer

Sort by: Most helpful
  1. akinbade abiola 9,625 Reputation points
    2024-07-24T07:40:39.9933333+00:00

    Unfortunately, there isn't a direct way to do this in Terraform for Azure Static Web Apps at the moment. The Terraform provider requires a location.

    See reference here:

    • location - (Required) The Azure Region where the Static Web App should exist. Changing this forces a new Static Web App to be created.

    https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/static_web_app

    You can mark it 'Accept Answer' and 'Upvote' if this helped you

    Regards,

    Abiola

    0 comments No comments