Using environment variables to build the image to deploy will fail since they will not be resolved:
Run Azure/functions-container-action@v1
with:
app-name: xxx-functions-staging-ca
image: xxx.azurecr.io/xxx-functions:b$HASH
will result in the following error:
Updating App Service Configuration settings. Data: {"linuxFxVersion":"DOCKER|xxx.azurecr.io/xxx-functions:b$HASH"}
Error: Error: Failed to patch configuration settings for app service xxx-functions-staging-ca.
BadRequest - Internal server error occurred. ContainerAppOperationError. Failed to provision revision for container app 'xxx-functions-staging-ca'. Error details: The following field(s) are either invalid or missing. Field 'template.containers.functions-container.image' is invalid with details: 'Invalid value: "xxx.azurecr.io/xxx-functions:b$HASH": could not parse reference: xxx.azurecr.io/xxx-functions:b$HASH';.. (CODE: 400)
Instead I would expect it to work in the same way as azure/container-apps-deploy-action works. They execute one important step which I believe makes environment variables work here:
Run azure/container-apps-deploy-action@v1
with:
imageToDeploy: xxx.azurecr.io/xxx-api:b$HASH
The important step:
Run CA_GH_ACTION_IMAGE_TO_DEPLOY="xxx.azurecr.io/xxx-api:b$HASH"
CA_GH_ACTION_IMAGE_TO_DEPLOY="xxx.azurecr.io/xxx-api:b$HASH"
echo "CA_GH_ACTION_IMAGE_TO_DEPLOY=${CA_GH_ACTION_IMAGE_TO_DEPLOY}" >> $GITHUB_ENV
Using environment variables to build the image to deploy will fail since they will not be resolved:
will result in the following error:
Updating App Service Configuration settings. Data: {"linuxFxVersion":"DOCKER|xxx.azurecr.io/xxx-functions:b$HASH"} Error: Error: Failed to patch configuration settings for app service xxx-functions-staging-ca. BadRequest - Internal server error occurred. ContainerAppOperationError. Failed to provision revision for container app 'xxx-functions-staging-ca'. Error details: The following field(s) are either invalid or missing. Field 'template.containers.functions-container.image' is invalid with details: 'Invalid value: "xxx.azurecr.io/xxx-functions:b$HASH": could not parse reference: xxx.azurecr.io/xxx-functions:b$HASH';.. (CODE: 400)Instead I would expect it to work in the same way as
azure/container-apps-deploy-actionworks. They execute one important step which I believe makes environment variables work here:The important step: