hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.61k stars 4.65k forks source link

Support for passing repository, branch, etc to `azurerm_static_web_app` #27392

Open djryanj opened 2 months ago

djryanj commented 2 months ago

Is there an existing issue for this?

Community Note

Description

Currently, it's not possible to pass/connect an azurerm_static_web_app to either MS DevOps or GitHub repositories, which is done via the portal on creation.

This is possible e.g., via an ARM template: https://stackoverflow.com/questions/78460424/connect-azure-static-web-app-to-azure-devops-via-terraform-script or the AzAPI provider: https://learn.microsoft.com/en-us/azure/templates/microsoft.web/staticsites?pivots=deployment-language-terraform

New or Affected Resource(s)/Data Source(s)

azurerm_static_web_app

Potential Terraform Configuration

resource "azurerm_static_web_app" "example" {
  location            = "eastus2"
  name                = "swebapp"
  resource_group_name = azurerm_resource_group.example.name
  repository_url      = "https://github.com/repo/"
  branch              = "main"
  repository_token    = "somethingsecret"
} # note that I'm not sure of the required, complete configuration at this juncture

References

https://learn.microsoft.com/en-us/azure/templates/microsoft.web/staticsites?pivots=deployment-language-terraform

https://stackoverflow.com/questions/78460424/connect-azure-static-web-app-to-azure-devops-via-terraform-script

The SDK model does have those parameters defined: https://github.com/hashicorp/terraform-provider-azurerm/blob/main/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsite.go

ned1313 commented 2 months ago

Thanks @djryanj for submitting this issue! I'm working on adding the repository_url, branch, and repository_token arguments to support your request.

djryanj commented 2 months ago

@ned1313 thanks. I was going to work on it myself next week when I had some cycles but if you're on it, be my guest.

I should think this also affects the data resource as well.