Skip to content

Environment variables are not resolved #59

@DavidVollmers

Description

@DavidVollmers

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions