staticSites API is not idempotent -- requires `isForced` query parameter for redeployment
- Dominant language
- Bicep
- Stars
- 3.6k
- Forks
- 830
- Avg merge
- 1d 21m
- Merged PRs (30d)
- 79
Description
**Is your feature request related to a problem? Please describe.**
There is a nearly 1 year old implementation issue in the Static Web Apps (staticSites) provider that blocks idempotent deployments when user defined function apps are used (https://github.com/Azure/static-web-apps/issues/576).
The problem is that as soon as the `userDefinedFunction` property was set once, it cannot be overwritten and the resource provider even throws a error with the exact same configuration because the field seems to be write protected internally.
There is a uri parameter called `isForced` that has to be set to overwrite this property, but it is only available in the REST API (https://docs.microsoft.com/en-us/rest/api/appservice/static-sites/register-user-provided-function-app-with-static-site#uri-parameters) and that should be used like this
`PUT https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.Web/staticSites/testStaticSite0/userProvidedFunctionApps/testFunctionApp?isForced=true&api-version=2021-02-01`
Is there any way in Bicep or ARM templates to reference URI parameters or has anyone an idea of a proper workaround to be able to use IaC with staticSites?
Contributor guide
Research direction
Start with the Static Web Apps staticSites REST operation for registering a user-provided function app and its isForced URI parameter, then compare that API with the Bicep and ARM template resource model. Done means establishing whether URI parameters can be represented for idempotent redeployment and documenting or implementing a supported path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- cloud, infrastructure
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100