AVM Pitfalls & Common Issues
Purpose: Document known AVM parameter issues and region limitations discovered during implementation. Updated: 2025-02-04
This file captures real-world issues encountered when using Azure Verified Modules. Agents MUST consult this file before generating Bicep code.
Region Limitations
Some Azure services are not available in all regions. Check before deployment.
| Service | Limitation | Solution |
|---|---|---|
| Static Web Apps | Only: westus2, centralus, eastus2, westeurope, eastasia |
Use westeurope for EU workloads |
| Azure OpenAI | Limited regions - check Azure docs | Use swedencentral or eastus |
| Container Apps (Consumption) | Most regions supported, some features region-specific | Verify zone redundancy availability |
Static Web App Pattern
// Static Web Apps only support specific regions - hardcode westeurope for EU
var staticWebAppLocation = 'westeurope' // NOT the location parameter!
module staticWebApp 'br/public:avm/res/web/static-site:0.9.3' = {
params: {
location: staticWebAppLocation // Use hardcoded value
// ...
}
}
AVM Parameter Type Mismatches
Parameters that don't match expected types or have changed between versions.
Log Analytics Workspace (operational-insights/workspace)
| Parameter | ❌ Wrong Type | ✅ Correct Type | Notes |
|---|---|---|---|
dailyQuotaGb |
int |
string |
Must be string: '1' not 1 |
// ❌ WRONG
dailyQuotaGb: 1
// ✅ CORRECT
dailyQuotaGb: '1'
Container Apps Managed Environment (app/managed-environment)
| Parameter | ❌ Deprecated/Wrong | ✅ Correct |
|---|---|---|
logAnalyticsWorkspaceResourceId |
String parameter | Use appLogsConfiguration object |
// ❌ WRONG - deprecated parameter
logAnalyticsWorkspaceResourceId: logAnalyticsWorkspaceId
// ✅ CORRECT - use appLogsConfiguration
appLogsConfiguration: {
destination: 'azure-monitor'
}
Container Apps (app/container-app)
| Parameter | ❌ Deprecated | ✅ Correct |
|---|---|---|
scaleMinReplicas |
Individual parameters | Use scaleSettings object |
scaleMaxReplicas |
Individual parameters | Use scaleSettings object |
// ❌ WRONG - deprecated individual params
scaleMinReplicas: 0
scaleMaxReplicas: 3
// ✅ CORRECT - use scaleSettings object
scaleSettings: {
minReplicas: 0
maxReplicas: 3
}
SQL Server (sql/server)
| Parameter | ❌ Wrong Pattern | ✅ Correct Pattern |
|---|---|---|
skuName / skuTier |
Separate parameters | Use sku object |
availabilityZone |
Omitted | Required: availabilityZone: -1 |
// ❌ WRONG - separate sku params
skuName: 'Basic'
skuTier: 'Basic'
// ✅ CORRECT - sku object + availabilityZone
sku: {
name: 'Basic'
tier: 'Basic'
}
availabilityZone: -1 // -1 = no zone redundancy
App Service (web/site)
| Parameter | Status | Notes |
|---|---|---|
appInsightsInstrumentationKey |
⚠️ Deprecated | Use connection string via app settings instead |
// ❌ WRONG - deprecated parameter
appInsightsInstrumentationKey: appInsightsKey
// ✅ CORRECT - use app settings with connection string
siteConfig: {
appSettings: [
{
name: 'APPLICATIONINSIGHTS_CONNECTION_STRING'
value: appInsightsConnectionString
}
]
}
Key Vault (key-vault/vault)
| Parameter | ❌ Issue | ✅ Correct Pattern |
|---|---|---|
softDeleteRetentionInDays |
Cannot modify on existing vault | Omit parameter for existing vaults |
enablePurgeProtection |
Cannot disable once enabled | Set false only for new dev vaults |
// ❌ WRONG - will fail if vault exists with different retention
softDeleteRetentionInDays: 7
// ✅ CORRECT - omit for existing vaults, or match existing value
// For new vaults only:
enableSoftDelete: true
// softDeleteRetentionInDays: 90 // Only set on initial creation
Note: Once a Key Vault is created,
softDeleteRetentionInDaysis immutable. Attempting to change it will result in deployment failure.
Static Web App (web/static-site)
| Parameter | ❌ Issue | ✅ Correct Pattern |
|---|---|---|
sku |
Free not available via ARM API |
Use Standard |
// ❌ WRONG - Free SKU not available via ARM deployment
sku: 'Free'
// ✅ CORRECT - use Standard for ARM deployments
sku: 'Standard'
Note: The
Freetier can only be selected via Azure Portal. ARM/Bicep deployments must useStandardtier.
Pre-Implementation Checklist
Before generating Bicep code, agents MUST:
- Check region limitations for each resource type
- Query AVM schema using
azure_bicep-get_azure_verified_modulefor parameter structure - Validate types - watch for string vs int mismatches
- Check for object parameters - many AVM modules use objects instead of flat params
- Run
bicep buildafter each module to catch errors early
Validation Pattern
# After generating each module, validate immediately
bicep build main.bicep
# If errors, check:
# 1. Parameter types (string vs int)
# 2. Object structures (sku, scaleSettings, etc.)
# 3. Deprecated parameters
# 4. Region availability
How to Update This File
When encountering a new AVM issue:
- Document the error message received
- Add the correct pattern to this file
- Include both wrong and correct examples
- Update the bicep-code agent guardrails if pattern is common
Last verified against AVM versions as of February 2025