Use deployment-time configuration (parameters/derived values) instead of hardcoded or partially-specified settings, and ensure env/config entries required for the selected feature/identity are fully present.
Apply these checks:
resourceGroup().location and environment().name) rather than hardcoded regions or manual cloud selection.@allowed/range validation (don’t rely on a fixed default that can break in other regions).Example (function app managed identity storage auth app settings):
param storageAccountName string
param userAssignedIdentityResourceId string
resource configAppSettings 'config' = {
name: 'appsettings'
properties: {
AzureWebJobsStorage__accountName: storageAccountName
AzureWebJobsStorage__clientId: userAssignedIdentityResourceId
AzureWebJobsStorage__credential: 'ManagedIdentity'
}
}
(Adjust the exact settings to match your runtime’s requirements; the key standard is “don’t omit identity-related env vars for the chosen auth mode.”)