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