Context
We found two Bicep entrypoints in the repo:
infrastructure/azure/main.bicep
web/deploy/main.bicep
The existing production Azure resource group rg-walter-prod in subscription 003283b1-cc5e-417a-b037-01ff3c05537b was created by the newer infrastructure/azure path, not by the older web/deploy path.
Azure deployment evidence from rg-walter-prod:
- Deployment:
walter-walter-production-20260330163541
- Parameters:
appName=walter, env=production, linuxFxVersion=DOTNETCORE|8.0
- App Service Plan:
/subscriptions/003283b1-cc5e-417a-b037-01ff3c05537b/resourceGroups/Shared/providers/Microsoft.Web/serverFarms/Petunia
- Outputs:
- Web App:
web-walter-production-dfvhbu
- SQL Server:
sql-walter-production-dfvhbu
- SQL Database:
walter
Those generated names match infrastructure/azure/main.bicep, which builds names as web-<appName>-<env>-<token> and sql-<appName>-<env>-<token>. The older web/deploy template/scripts use explicit names like walter and walter-test, so they are not compatible with the current prod resource names.
Current risks
-
web/deploy is legacy/confusing
The web/deploy/test/run-deploy.sh and web/deploy/production/run-deploy.sh scripts still point at web/deploy/main.bicep, use explicit resource names, and contain hard-coded SQL password values. Keeping these scripts around makes it unclear which infrastructure path should be used.
-
Re-running current infrastructure Bicep may overwrite App Service settings
Current prod App Service settings include names such as:
Auth__ClientSecret
DB_CONNECTION
DM_CONNECTION
Financial__ApiUrl
Financial__ConsumerKey
Financial__ConsumerSecret
Financial__ScopeApp
Financial__ScopeEnv
Financial__TokenEndpoint
Iam__ApiKey
OTEL_EXPORTER_OTLP_ENDPOINT
OTEL_EXPORTER_OTLP_HEADERS
OTEL_EXPORTER_OTLP_PROTOCOL
OTEL_RESOURCE_ATTRIBUTES
WEBSITE_HTTPLOGGING_RETENTION_DAYS
infrastructure/azure/modules/webapp.bicep currently writes Microsoft.Web/sites/config appsettings using only the appSettings object passed by the template. That could delete settings managed outside Bicep.
-
Deployment history exposes generated DB_CONNECTION
Although sqlAdminPassword is a secure parameter, the composed DB_CONNECTION is passed into the nested web deployment as part of a plain object parameter. Azure deployment history for the nested web deployment can therefore show the connection string, including the SQL password. Do not copy the exposed value into the repo or issue comments.
Recommended direction
Use infrastructure/azure going forward and retire/archive the old web/deploy Bicep path.
For compatibility with existing prod, future deployments must preserve these identity inputs:
- Subscription:
003283b1-cc5e-417a-b037-01ff3c05537b
- Resource group:
rg-walter-prod
appName=walter
env=production
Changing env to prod, omitting env, changing the resource group, or changing appName would generate different resource names.
What to build
Clean up the Azure IaC so infrastructure/azure is the single supported deployment path and App Service settings are not accidentally overwritten or leaked through deployment history.
Acceptance criteria
Notes
One likely implementation path is to make the web module merge desired settings with existing App Service settings, or to stop managing app settings in Bicep and let Azure DevOps, Key Vault, or another configuration owner manage them. If Bicep continues to set DB_CONNECTION, ensure the parameter flow stays secure and does not surface the full connection string in deployment history.
Context
We found two Bicep entrypoints in the repo:
infrastructure/azure/main.bicepweb/deploy/main.bicepThe existing production Azure resource group
rg-walter-prodin subscription003283b1-cc5e-417a-b037-01ff3c05537bwas created by the newerinfrastructure/azurepath, not by the olderweb/deploypath.Azure deployment evidence from
rg-walter-prod:walter-walter-production-20260330163541appName=walter,env=production,linuxFxVersion=DOTNETCORE|8.0/subscriptions/003283b1-cc5e-417a-b037-01ff3c05537b/resourceGroups/Shared/providers/Microsoft.Web/serverFarms/Petuniaweb-walter-production-dfvhbusql-walter-production-dfvhbuwalterThose generated names match
infrastructure/azure/main.bicep, which builds names asweb-<appName>-<env>-<token>andsql-<appName>-<env>-<token>. The olderweb/deploytemplate/scripts use explicit names likewalterandwalter-test, so they are not compatible with the current prod resource names.Current risks
web/deployis legacy/confusingThe
web/deploy/test/run-deploy.shandweb/deploy/production/run-deploy.shscripts still point atweb/deploy/main.bicep, use explicit resource names, and contain hard-coded SQL password values. Keeping these scripts around makes it unclear which infrastructure path should be used.Re-running current infrastructure Bicep may overwrite App Service settings
Current prod App Service settings include names such as:
Auth__ClientSecretDB_CONNECTIONDM_CONNECTIONFinancial__ApiUrlFinancial__ConsumerKeyFinancial__ConsumerSecretFinancial__ScopeAppFinancial__ScopeEnvFinancial__TokenEndpointIam__ApiKeyOTEL_EXPORTER_OTLP_ENDPOINTOTEL_EXPORTER_OTLP_HEADERSOTEL_EXPORTER_OTLP_PROTOCOLOTEL_RESOURCE_ATTRIBUTESWEBSITE_HTTPLOGGING_RETENTION_DAYSinfrastructure/azure/modules/webapp.bicepcurrently writesMicrosoft.Web/sites/configappsettingsusing only theappSettingsobject passed by the template. That could delete settings managed outside Bicep.Deployment history exposes generated
DB_CONNECTIONAlthough
sqlAdminPasswordis a secure parameter, the composedDB_CONNECTIONis passed into the nestedwebdeployment as part of a plain object parameter. Azure deployment history for the nestedwebdeployment can therefore show the connection string, including the SQL password. Do not copy the exposed value into the repo or issue comments.Recommended direction
Use
infrastructure/azuregoing forward and retire/archive the oldweb/deployBicep path.For compatibility with existing prod, future deployments must preserve these identity inputs:
003283b1-cc5e-417a-b037-01ff3c05537brg-walter-prodappName=walterenv=productionChanging
envtoprod, omittingenv, changing the resource group, or changingappNamewould generate different resource names.What to build
Clean up the Azure IaC so
infrastructure/azureis the single supported deployment path and App Service settings are not accidentally overwritten or leaked through deployment history.Acceptance criteria
web/deployis removed, archived, or replaced with documentation pointing toinfrastructure/azureas the supported IaC path.appName=walterandenv=production, producingweb-walter-production-dfvhbuandsql-walter-production-dfvhbuinrg-walter-prod.what-ifbefore applying changes.Notes
One likely implementation path is to make the web module merge desired settings with existing App Service settings, or to stop managing app settings in Bicep and let Azure DevOps, Key Vault, or another configuration owner manage them. If Bicep continues to set
DB_CONNECTION, ensure the parameter flow stays secure and does not surface the full connection string in deployment history.