You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Output from azd version
Run azd version and copy and paste the output here:
1.11.0
Describe the bug
I'm not sure if this is a regression, or if this never actually worked and I deceived myself that it did.
Upon reflection, our usage of a default value for SERVICE_WEB_RESOURCE_EXISTS has perhaps served us poorly - it means we're not aware if behaviour changes.
// azd will provide the following parametersparamcontainerAppExists = bool(readEnvironmentVariable('SERVICE_WEB_RESOURCE_EXISTS', 'false'))
However, part of the mechanism describes the "magic" environment variables provided by azd provision. These are variables like SERVICE_WEB_RESOURCE_EXISTS and the mechanism for providing them can be found here:
After the initial deployment, log into the portal to look at the root deployment created by azd. Look at the inputs and you should see a SERVICE_WEB_RESOURCE_EXISTS that is reliably false
Expected behavior
After the initial deployment, log into the portal to look at the root deployment created by azd. Look at the inputs and you should see a SERVICE_WEB_RESOURCE_EXISTS that is reliably true once the service exists.
Environment
Azure Pipelines
Additional context
The blog post linked covers a good amount of this context
It's possible to work around this issue by creating the variable by hand - here's an example:
- task: AzureCLI@2
displayName: Check container app exists # see https://github.com/Azure/azure-dev/issues/4593 for context on why this exists
inputs:
azureSubscription: ${{ variables.serviceConnection }}
scriptType: bash
scriptLocation: inlineScript
inlineScript: |if az containerapp show --name "$(zgptZebraGptContainerApps)" --resource-group "$(resourceGroupName)"> /dev/null 2>&1;thenecho"SERVICE_APP_RESOURCE_EXISTS: true"echo"##vso[task.setvariable variable=SERVICE_APP_RESOURCE_EXISTS]true"elseecho"SERVICE_APP_RESOURCE_EXISTS: false"echo"##vso[task.setvariable variable=SERVICE_APP_RESOURCE_EXISTS]false"fi
- task: AzureCLI@2
displayName: Provision Infra
inputs:
azureSubscription: ${{ variables.serviceConnection }}
scriptType: bash
scriptLocation: inlineScript
${{ if eq(parameters.forceDeployInfra, true) }}:
inlineScript: azd provision --no-prompt --no-state
${{ else }}:
inlineScript: azd provision --no-prompt
env:
# ....
SERVICE_APP_RESOURCE_EXISTS: $(SERVICE_APP_RESOURCE_EXISTS)
It feels wrong that we should be doing this though.
The text was updated successfully, but these errors were encountered:
Output from
azd version
Run
azd version
and copy and paste the output here:1.11.0
Describe the bug
I'm not sure if this is a regression, or if this never actually worked and I deceived myself that it did.
Upon reflection, our usage of a default value for
SERVICE_WEB_RESOURCE_EXISTS
has perhaps served us poorly - it means we're not aware if behaviour changes.In this blog post I explain how to use AZD to speed up incremental deployments of container apps in Azure Pipelines: https://johnnyreilly.com/using-azd-for-faster-incremental-azure-container-app-deployments-in-azure-devops
However, part of the mechanism describes the "magic" environment variables provided by
azd provision
. These are variables likeSERVICE_WEB_RESOURCE_EXISTS
and the mechanism for providing them can be found here:azure-dev/cli/azd/pkg/project/service_target_containerapp.go
Lines 174 to 190 in 837d4e8
However, regardless of the existence of a container app, AZD is reliably providing
false
where it should be providingtrue
when a service existsTo Reproduce
Follow the steps in this blog post: https://johnnyreilly.com/using-azd-for-faster-incremental-azure-container-app-deployments-in-azure-devops
After the initial deployment, log into the portal to look at the root deployment created by azd. Look at the inputs and you should see a
SERVICE_WEB_RESOURCE_EXISTS
that is reliablyfalse
Expected behavior
After the initial deployment, log into the portal to look at the root deployment created by azd. Look at the inputs and you should see a
SERVICE_WEB_RESOURCE_EXISTS
that is reliablytrue
once the service exists.Environment
Azure Pipelines
Additional context
The blog post linked covers a good amount of this context
It's possible to work around this issue by creating the variable by hand - here's an example:
It feels wrong that we should be doing this though.
The text was updated successfully, but these errors were encountered: