Open itpropro opened 2 years ago
Just confirming that there is no capability to add parameters to the PUT query string through Bicep or ARM Templates.
I can't comment on whether there is another workaround for staticSites
in Bicep.
Thanks for confirming @anthony-c-martin! Do you know if there is any guidance for the development of resource providers to avoid uri parameters to be compatible with IaC?
The guidance to all RPs is to make sure all of their resources are deployable via ARM Templates/bicep, so if a query string parameter is required for deployment, they should change that such it is in the PUT request body.
The more concerning part of what you are reporting is that the API is not idempotent. It is ok for a property to not be modifiable, but if there were no property changes then it should re-deploy successfully.
I would recommend opening a support case for this one. @seligj95 / @naveedaz -- do you have a good contact on the static sites team that can help look into this?
Exactly, I don't think it's a problem in general, if some parameters like isForced
are being exposed later with a newer api version, but unfortunately, the parameter is required for idempotency. Thereby it blocks every ARM/Bicep deployment and management of staticSites that have a customer function app deployed. Maybe Terraform would work, as they use REST APIs, but the Terraform provider doesn't have functionality regarding user provided function apps at all.
I am currently working on some submodules for CARML for the staticSites
provider, if a reproduction repository is needed, I can provide one.
@BandaruDheeraj for visibility
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 calledisForced
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 thisPUT 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?