0

Our deployments have recently started failing with the following error, despite no changes made to Azure, GitHub, or the workflow file:

ERROR: The containerapp 'sample-name' does not exist

To troubleshoot, I added a step before this to confirm the container exists, which proves that it does (and the name has not changed):

Run az containerapp show --name sample-name --resource-group primary-resourcegroup

***
  "id": ...,
  "location": ...,
  "name": "sample-name",
  "properties": 
    ...
    "provisioningState": "Succeeded",
    "runningStatus": "Running"
    ...
  ...
  "type": "Microsoft.App/containerApps"
***

Here is the relevant section of my workflow file:

deploy:
    runs-on: ubuntu-latest
    needs: build

    steps:
      - name: Azure Login
        uses: azure/login@v1
        with:
          creds: ${{ secrets.AZURE_CREDENTIALS }}

      - name: Check if container app exists
        run: |
            az containerapp show --name sample-name --resource-group primary-resourcegroup

      - name: Deploy to containerapp
        uses: azure/CLI@v1
        with:
          azcliversion: 2.50.0
          inlineScript: |
            az config set extension.use_dynamic_install=yes_without_prompt
            az extension add --name containerapp --upgrade
            az containerapp registry set -n sample-name -g primary-resourcegroup --server xxx.azurecr.io --username  ${{ secrets.REGISTRY_USERNAME }} --password ${{ secrets.REGISTRY_PASSWORD }}
            az containerapp update -n sample-name --cpu 0.75 --memory 1.5Gi -g primary-resourcegroup --image xxx.azurecr.io/xxx:${{ github.sha }}

I have tried stopping/starting the container app. I'm at a point where my last resort will be to delete it and recreate it, but this is a headache I'm trying to avoid given all of the settings and whatnot I'd have to transfer/recreate.

Thank you.

2
  • Pin the Azure CLI to version 2.49.0 and explicitly reinstall the containerapp extension using az extension remove --name containerapp && az extension add --name containerapp to avoid inconsistencies in the latest versions @santi Commented May 19 at 16:15
  • Thank you. Likely a good suggestion for future-proofing the script a bit better, but it did not resolve the current issue. Commented May 19 at 17:34

1 Answer 1

0

I'm not quite sure what changed, but using the latest azcliversion fixed the issue.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.