Trying to deploy container app from GitHub Actions - Authentication failure

Copper Contributor

I am trying to deploy to an Azure Container App from GitHub Actions.  I am following this guide:  https://learn.microsoft.com/en-us/azure/container-apps/github-actions#build-and-deploy-to-container-...

 

Here is this step:

deploy-to-container-apps:
    permissions:
      contents: none
    runs-on: ubuntu-latest
    needs: build-push-container-image

    steps:

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

    - name: Build and deploy Container App
      uses: azure/container-apps-deploy-action@v1
      with:
        registryUrl: ghcr.io
        imageToDeploy: ghcr.io/${{ env.IMAGE_NAME }}:${{ github.run_number }}
        targetPort: 3500
        ingress: external
        containerAppName: ${{ env.CONTAINERAPPS_APP }}
        containerAppEnvironment: ${{ env.CONTAINERAPPS_ENVIRONMENT }}
        resourceGroup: ${{ env.RESOURCE_GROUP }}

 

I use this command to create an rbac:  

az ad sp create-for-rbac -n "spn-aca-github" --role Contributor --scope /subscriptions/$SUBSCRIPTION_ID --sdk-auth

 

I then add the output of this command as a secret:

AdamCodes716_0-1704389369739.png

 

 

When I run the flow, I get this error:

Run az containerapp show \
Run CA_GH_ACTION_CONTAINER_APP_ENVIRONMENT="aca-environment"
Run CA_GH_ACTION_INGRESS_ENABLED="true"
Run CA_GH_ACTION_TARGET_PORT="3500"
Run CA_GH_ACTION_TARGET_PORT_ARG="--target-port 3500"
Run CA_GH_ACTION_USE_UP="true"
Run az containerapp up \
WARNING: Using resource group 'rg-containerapps-github-actions'
WARNING: Using ContainerAppEnvironment 'aca-environment' in resource group rg-containerapps-github-actions
WARNING: Updating Containerapp album-backend-api in resource group rg-containerapps-github-actions
ERROR: (InvalidParameterValueInContainerTemplate) The following field(s) are either invalid or missing. Field 'template.containers.album-backend-api.image' is invalid with details: 'Invalid value: "ghcr.io/adamcodes716/containerapps-album-api:3": GET https:?scope=repository%3Aadamcodes716%2Fcontainerapps-album-api%3Apull&service=ghcr.io: UNAUTHORIZED: authentication required';.
Error: Process completed with exit code 1.


Any idea as to what the issue might be?  

 

 

 

 
0 Replies