-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SERVICE_XXX_RESOURCE_EXISTS environment variables are always false
when passed as ARM Deployment params in CI environment
#4310
Comments
false
false
when targeting Azure Container Apps
false
when targeting Azure Container Appsfalse
when passed as ARM Deployment params when targeting Azure Container Apps
false
when passed as ARM Deployment params when targeting Azure Container Appsfalse
when passed as ARM Deployment params in CI environment
This is indeed a bug. A more full description and a tentative plan of reworking how deploy works in this scenario is described fully in #4232. A related issue that container app deployments faces is described in #3116. FYI @wbreza
This may be an acceptable short-term fix. If we do such a thing, perhaps we could also avoid setting the output variable entirely and letting |
Yes, I have confirmed a bug and believe the root cause here is from adding support of caching of bicep parameters during provider init phase and they don't get re-evaluated at deploy time and the azd environment was mutated between init & deploy. cc @vhvb1989 |
Remove in-memory `main.parameters.json` cache. By removing this in-memory cache, we incur an extra load from disk, but without any noticeable behavioral changes. Background: In-memory caching for `main.parameters.json` was added initially to avoid a re-prompt when the user declines the prompt "Save the value in the environment for future use?" (#3155). This was added as a way to communicate within `azd` that "this value is configured for the current azd process lifetime". This was superseded by the changes in #3479 where we always saved the values to `config.json` and removed the prompt. Fixes #3973, #4310
This should be fixed with #3973 -- it's currently in the latest daily build if anyone wants to give it a try. |
Hi all I've run through the reproduction steps detailed in the issue with azd version Thanks so much for getting this fixed! |
Hi @MarcelMichau. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “ |
@MarcelMichau Thanks for giving it a try! I'm glad that it helped resolve your issue. The change will go out with the next release. As a footnote, we are thinking about improving our strategy for container app deployments. If you have any thoughts around this, feel free to leave a note on ##4232. |
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 runningazd provision
, theSERVICE_XXX_RESOURCE_EXISTS
environment variables are alwaysfalse
when passed as Bicep params.To Reproduce
azd init --template Azure-Samples/todo-python-mongo-aca
azd provision
& wait for resources to finish provisioning.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.azd provision --no-state
to force an infra deploymentSERVICE_API_RESOURCE_EXISTS
&SERVICE_WEB_RESOURCE_EXISTS
in the.azure/<environmentName>/.env
file will update totrue
apiAppExists
&webAppExists
parameters are stillfalse
: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 setSERVICE_XXX_RESOURCE_EXISTS
environment variables totrue
prior to starting the Bicep deployment so that containers do not get swapped out with themcr.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
The text was updated successfully, but these errors were encountered: