Skip to content

Commit 516b73e

Browse files
updates
1 parent bee2c52 commit 516b73e

1 file changed

Lines changed: 67 additions & 2 deletions

File tree

articles/container-apps/tutorial-ci-cd-runners-jobs.md

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ To run a self-hosted runner, you need to create a personal access token (PAT) in
270270
To create a self-hosted runner, you need to build a container image that executes the runner. In this section, you build the container image and push it to a container registry.
271271
272272
> [!NOTE]
273-
> The image you build in this tutorial contains a basic self-hosted runner that's suitable for running as a Container Apps job. You can customize it to include additional tools or dependencies that your workflows require.
273+
> The image you build in this tutorial contains a basic self-hosted runner that's suitable for running as a Container Apps job. You can customize it to include other tools or dependencies that your workflows require.
274274

275275
1. Define a name for your container image and registry.
276276

@@ -673,7 +673,10 @@ To run a self-hosted runner, you need to create a personal access token (PAT) in
673673
To create a self-hosted agent, you need to build a container image that runs the agent. In this section, you build the container image and push it to a container registry.
674674

675675
> [!NOTE]
676-
> The image you build in this tutorial contains a basic self-hosted agent that's suitable for running as a Container Apps job. You can customize it to include additional tools or dependencies that your pipelines require.
676+
> The image you build in this tutorial contains a basic self-hosted agent that's suitable for running as a Container Apps job. You can customize it to include other tools or dependencies that your pipelines require.
677+
678+
> [!IMPORTANT]
679+
> If your pipelines build .NET Framework applications, you might need to include Mono in your container image. The sample Dockerfile includes .NET SDK but not Mono. Consider using a Windows-based container or adding Mono dependencies if needed.
677680
678681
1. Back in your terminal, define a name for your container image and registry.
679682
@@ -859,6 +862,9 @@ You can run a manual job to register an offline placeholder agent. The job runs
859862

860863
After you create a placeholder agent, you can create a self-hosted agent. In this section, you create an event-driven job that runs a self-hosted agent when a pipeline is triggered.
861864

865+
> [!IMPORTANT]
866+
> Ensure that your Azure DevOps organization URL is correct and accessible. The KEDA azure-pipelines scaler requires proper authentication and network connectivity to monitor the pipeline queue.
867+
862868
# [Bash](#tab/bash)
863869
```bash
864870
az containerapp job create -n "$JOB_NAME" -g "$RESOURCE_GROUP" --environment "$ENVIRONMENT" \
@@ -972,6 +978,65 @@ After you configure a self-hosted agent job, run a pipeline to verify that it wo
972978

973979
::: zone-end
974980

981+
## Troubleshooting
982+
983+
If you encounter issues with your self-hosted agents, try the following troubleshooting steps.
984+
985+
### Pipeline jobs remain queued and don't trigger Container Apps jobs
986+
987+
If your pipelines stay in a queued state and don't trigger job executions, then try these steps:
988+
989+
1. Verify the scale rule configuration. Check that the scale rule metadata matches your Azure DevOps setup.
990+
991+
```bash
992+
az containerapp job show \
993+
--name "$JOB_NAME" \
994+
--resource-group "$RESOURCE_GROUP" \
995+
--query "properties.configuration.eventTriggerConfig.scale.rules[0]"
996+
```
997+
998+
1. Ensure your personal access token has the correct permissions and isn't expired.
999+
1000+
1. The Container Apps environment must be able to reach your Azure DevOps organization URL, so verify network connectivity in your environment.
1001+
1002+
1. Check the polling interval. The default polling interval is 30 seconds. You can increase it if needed, but this change might delay job execution.
1003+
1004+
1. Check if there are any error messages in the job execution logs.
1005+
1006+
```bash
1007+
az containerapp job execution list \
1008+
--name "$JOB_NAME" \
1009+
--resource-group "$RESOURCE_GROUP" \
1010+
--output table
1011+
```
1012+
1013+
### Missing dependencies in container image
1014+
1015+
If you encounter errors like "Unable to locate executable file: 'mono'" when building .NET Framework applications:
1016+
1017+
1. Use appropriate base images. Ensure that your container image includes all required dependencies for your build process.
1018+
1019+
1. If you need to build .NET Framework applications on Linux, add Mono to your container image with the following command:
1020+
1021+
```dockerfile
1022+
# Add to your Dockerfile
1023+
RUN apt-get update && apt-get install -y mono-complete
1024+
```
1025+
1026+
1. Consider Windows containers. For .NET Framework applications, consider using Windows-based container images instead of Linux.
1027+
1028+
1. For versions, use .NET Core/5+. Modern .NET versions don't require Mono and work better with Linux containers.
1029+
1030+
### Agent registration issues
1031+
1032+
If agents fail to register with Azure DevOps:
1033+
1034+
1. Check token permissions. Ensure the PAT has "Agent Pools (Read & manage)" permissions.
1035+
1036+
1. Verify organization URL. Make sure the organization URL is correct and doesn't have trailing slashes.
1037+
1038+
1. Check agent pool name. Confirm the agent pool name matches exactly between Azure DevOps and your job configuration.
1039+
9751040
> [!TIP]
9761041
> Having issues? Let us know on GitHub by opening an issue in the [Azure Container Apps repo](https://github.com/microsoft/azure-container-apps).
9771042

0 commit comments

Comments
 (0)