Skip to content

SERVICE_XXX_RESOURCE_EXISTS environment variables are always false when passed as ARM Deployment params in CI environment #4310

Closed
@MarcelMichau

Description

@MarcelMichau

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

  1. Run azd init --template Azure-Samples/todo-python-mongo-aca
  2. Run azd provision & wait for resources to finish provisioning
  3. Open the .azure/<environmentName>/.env file & delete all environment variables except for AZURE_ENV_NAME, AZURE_LOCATION & AZURE_SUBSCRIPTION_ID to mimic the environment variables passed to the CI task.
  4. Run azd provision --no-state to force an infra deployment
  5. 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 to true
  6. Inspect the Deployment Inputs in the Azure Portal - the values for the apiAppExists & webAppExists parameters are still false:

image

  1. Subsequently running azd provision --no-state when the SERVICE_XXX_RESOURCE_EXISTS environment variables are present & set to true in the .azure/<environmentName>/.env file will correctly set the Bicep params to true:

image

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

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions