Azure / Azure/bicep-registry-modules
[AVM Module Issue]: AVM web/site emits deployment slot template for Flex Consumption Function Apps even though slots are unsupported
- Dominant language
- Bicep
- Stars
- 736
- Forks
- 564
- Avg merge
- 3d 15h
- Merged PRs (30d)
- 30
Description
### Check for previous/existing GitHub issues
- [x] I have checked for previous/existing GitHub issues
### Issue Type?
Bug
### Module Name
avm/res/web/site
### (Optional) Module Version
0.22.0
### Description
### Summary
When `br/public:avm/res/web/site:0.22.0` is used for Azure Functions Flex Consumption apps, the compiled ARM template still contains the `app_slots` nested deployment subtree even when no slots are configured.
As of March 18, 2026, Microsoft Learn documents that Azure Functions Flex Consumption does not support deployment slots:
- https://learn.microsoft.com/en-us/azure/azure-functions/flex-consumption-plan
- https://learn.microsoft.com/en-gb/azure/azure-functions/functions-deployment-slots
### Why this matters
The slot subtree adds a significant amount of unnecessary template payload for Flex Consumption deployments.
In my local build:
- one Function App wrapper includes an `app_slots` subtree of about `163,502` raw bytes / `24,489` gzip bytes
- across four Function Apps, that is about `654,008` raw bytes / `97,956` gzip bytes
This is especially painful in larger Bicep solutions, because it contributes to Azure ARM deployment size limits and can push deployments into `RequestedSizeExceeded` / job size exceeded failures:
- https://learn.microsoft.com/en-us/azure/azure-resource-manager/troubleshooting/error-job-size-exceeded?tabs=bicep
### Actual behavior
Even when:
- no `slots` parameter is passed, or
- `slots: null` is passed explicitly
the generated template still contains the `app_slots` nested deployment definition.
Passing `slots: null` does not remove the subtree. In my case it made the compiled template slightly larger because it only adds an explicit null parameter to the module call.
### Expected behavior
For Azure Functions Flex Consumption:
- slot-related resources/parameters should not be emitted at all, or
- the module should expose a way to fully disable slot generation
Because deployment slots are unsupported for Flex Consumption, emitting the slot deployment subtree provides no runtime value and only increases template size.
### Repro
1. Use `br/public:avm/res/web/site:0.22.0` to deploy an Azure Function App on Flex Consumption.
2. Compile the Bicep template.
3. Inspect the emitted ARM JSON.
4. Observe that `app_slots` is present even though the app does not use slots and Flex Consumption does not support them.
### Requested change
Please consider a Flex-specific code path, or a module switch, that omits slot-related template generation entirely when targeting Flex Consumption.
### (Optional) Correlation Id
c0f34c77-38b0-4927-8855-f38c0fba7ae2
Contributor guide
Assessment
This issue has not been assessed yet.