Description
- Make sure you've installed the latest version using instructions in the wiki
Output from azd version
azd version 1.10.1 (commit 31409a3)
Describe the bug
In a CI environment where the SERVICE_XXX_RESOURCE_EXISTS
environment variables do not pre-exist in the .azure/<environmentName>/.env
file, when running azd provision
, the SERVICE_XXX_RESOURCE_EXISTS
environment variables are always false
when passed as Bicep params.
To Reproduce
- Run
azd init --template Azure-Samples/todo-python-mongo-aca
- Run
azd provision
& wait for resources to finish provisioning - Open the
.azure/<environmentName>/.env
file & delete all environment variables except forAZURE_ENV_NAME
,AZURE_LOCATION
&AZURE_SUBSCRIPTION_ID
to mimic the environment variables passed to the CI task. - Run
azd provision --no-state
to force an infra deployment - When the provision operation starts, observe the values for
SERVICE_API_RESOURCE_EXISTS
&SERVICE_WEB_RESOURCE_EXISTS
in the.azure/<environmentName>/.env
file will update totrue
- Inspect the Deployment Inputs in the Azure Portal - the values for the
apiAppExists
&webAppExists
parameters are stillfalse
:
- Subsequently running
azd provision --no-state
when theSERVICE_XXX_RESOURCE_EXISTS
environment variables are present & set totrue
in the.azure/<environmentName>/.env
file will correctly set the Bicep params totrue
:
Expected behavior
Running azd provision
in a CI environment should set SERVICE_XXX_RESOURCE_EXISTS
environment variables to true
prior to starting the Bicep deployment so that containers do not get swapped out with the mcr.microsoft.com/azuredocs/containerapps-helloworld:latest
placeholder image during deployment.
Environment
Information on your environment:
Windows 11 Pro 23H2 - Build 22631.4169
Additional context
N/A