microsoft / azure-container-apps

Roadmap and issues for Azure Container Apps
MIT License
360 stars 29 forks source link

GitHub Actions runners and Azure Pipelines agents with Azure Container Apps not working #895

Open ramdasba opened 11 months ago

ramdasba commented 11 months ago

Please provide us with the following information:

This issue is a: (mark with an x)

Issue description

We followed this article https://learn.microsoft.com/en-us/azure/container-apps/tutorial-ci-cd-runners-jobs?tabs=bash&pivots=container-apps-jobs-self-hosted-ci-cd-github-actions and setup. Not sure what mechanism is notifying Azure about the events. The issue was no runners getting started and workflow fails as no runners were available.

Steps to reproduce

  1. Follow this article Tutorial: Run GitHub Actions runners and Azure Pipelines agents with Azure Container Apps jobs | Microsoft Learn and setup.
  2. Replace PAT token logic with the installation token.

Expected behavior [What you expected to happen.] Runner will start and available to run the github workflow.

Actual behavior [What actually happened.] No runners getting started.

NOTE: We added the following to start the job. This was working. This tells us that our Docker file and other startup shell scripts to acquire installation token was working. The issue I see was GITHUB event is not triggering Azure. Also, I would like to know where to look for logs, or how to debug this issue.

jobs: create-runner: name: create-runner runs-on: ubuntu-latest

steps:
- name: 'Az CLI login'
  uses: Azure/login@v1
  with:
    creds: ....                                        

- name: Run Azure CLI Command
  run: |
    az containerapp job start -n "name1" -g "my-rg"  

Screenshots
NA

Additional context

Portal

ruslangalasun commented 11 months ago

I was troubleshooting a similar issue with ADO agents yesterday and couldn't figure out why I was able to trigger the event-based job manually but couldn't get it to work through KEDA. If you go to your container job and go into Logs you will see ContainerAppSystemLogs_CL. This custom log contains information from the KEDA scaler. image

In my case, I found a log entry that stated that my Organization name couldn't be extracted from the Organization URL that I provided and that's why the KEDA scaling job was failing. A few things to try if that's your issue. You can try to put your URL name (whether it's in ENV variables or Secrets) into double quotes " " and remove the trailing / at the end of your URL. This is how I fixed the issue for myself, hopefully, it will be helpful for you as well.

Krusty93 commented 10 months ago

It works for me. You don't need to manually start the job via the yaml, just ensure that the scaling rule is properly set as explained in doc

meizenga commented 9 months ago

Removing the trailing / in $ORGANIZATION_URL fixed the issue for me where the Agent wouldn't pick up new pipeline Jobs.

RichDCs commented 9 months ago

Same for me, the trailing / was the issue. I created a PR to modify the documentation.

kabal2010 commented 6 months ago

@RichDCs Can you please point me to documentation you were talking about?