You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -288,8 +288,7 @@ To create a self-hosted runner, you need to build a container image that execute
288
288
--name "$CONTAINER_REGISTRY_NAME" \
289
289
--resource-group "$RESOURCE_GROUP" \
290
290
--location "$LOCATION" \
291
-
--sku Basic \
292
-
--admin-enabled true
291
+
--sku Basic
293
292
```
294
293
295
294
# [Azure PowerShell](#tab/azure-powershell)
@@ -298,8 +297,45 @@ To create a self-hosted runner, you need to build a container image that execute
298
297
--name "$CONTAINER_REGISTRY_NAME"`
299
298
--resource-group "$RESOURCE_GROUP"`
300
299
--location "$LOCATION"`
301
-
--sku Basic `
302
-
--admin-enabled true
300
+
--sku Basic
301
+
```
302
+
303
+
---
304
+
305
+
1. Your container registry must allow Azure Resource Manager (ARM) audience tokens forauthenticationin order to use managed identity to pull images.
306
+
307
+
Use the following command to check if ARM tokens are allowed to access your Azure Container Registry (ACR).
308
+
309
+
# [Bash](#tab/bash)
310
+
```azurecli
311
+
az acr config authentication-as-arm show --registry "$CONTAINER_REGISTRY_NAME"
312
+
```
313
+
314
+
# [Azure PowerShell](#tab/azure-powershell)
315
+
```powershell
316
+
az acr config authentication-as-arm show --registry "$CONTAINER_REGISTRY_NAME"
317
+
```
318
+
319
+
---
320
+
321
+
If ARM tokens are allowed, the command outputs the following.
322
+
323
+
```
324
+
{
325
+
"status": "enabled"
326
+
}
327
+
```
328
+
329
+
If the `status` is `disabled`, allow ARM tokens with the following command.
330
+
331
+
# [Bash](#tab/bash)
332
+
```azurecli
333
+
az acr config authentication-as-arm update --registry "$CONTAINER_REGISTRY_NAME" --status enabled
334
+
```
335
+
336
+
# [Azure PowerShell](#tab/azure-powershell)
337
+
```powershell
338
+
az acr config authentication-as-arm update --registry "$CONTAINER_REGISTRY_NAME" --status enabled
303
339
```
304
340
305
341
---
@@ -328,6 +364,59 @@ To create a self-hosted runner, you need to build a container image that execute
328
364
329
365
The image is now available in the container registry.
330
366
367
+
## Create a user-assigned managed identity
368
+
369
+
To avoid using administrative credentials, pull images from private repositories in Microsoft Azure Container Registry using managed identities for authentication. When possible, use a user-assigned managed identity to pull images.
370
+
371
+
1. Create a user-assigned managed identity. Before you run the following commands, choose a name for your managed identity and replace the `\<PLACEHOLDER\>` with the name.
372
+
373
+
# [Bash](#tab/bash)
374
+
375
+
```bash
376
+
IDENTITY="<YOUR_IDENTITY_NAME>"
377
+
```
378
+
379
+
```azurecli
380
+
az identity create \
381
+
--name $IDENTITY \
382
+
--resource-group $RESOURCE_GROUP
383
+
```
384
+
385
+
# [Azure PowerShell](#tab/azure-powershell)
386
+
387
+
```powershell
388
+
$IDENTITY="<YOUR_IDENTITY_NAME>"
389
+
az identity create `
390
+
--name $IDENTITY`
391
+
--resource-group $RESOURCE_GROUP
392
+
```
393
+
394
+
---
395
+
396
+
1. Get the identity's resource ID.
397
+
398
+
# [Bash](#tab/bash)
399
+
400
+
```azurecli
401
+
IDENTITY_ID=$(az identity show \
402
+
--name $IDENTITY \
403
+
--resource-group $RESOURCE_GROUP \
404
+
--query id \
405
+
--output tsv)
406
+
```
407
+
408
+
# [Azure PowerShell](#tab/azure-powershell)
409
+
410
+
```powershell
411
+
IDENTITY_ID=$(az identity show `
412
+
--name $IDENTITY `
413
+
--resource-group $RESOURCE_GROUP `
414
+
--query id `
415
+
--output tsv)
416
+
```
417
+
418
+
---
419
+
331
420
## Deploy a self-hosted runner as a job
332
421
333
422
You can now create a job that uses to use the container image. In this section, you create a job that executes the self-hosted runner and authenticates with GitHub using the PAT you generated earlier. The job uses the [`github-runner` scale rule](https://keda.sh/docs/latest/scalers/github-runner/) to create job executions based on the number of pending workflow runs.
@@ -336,7 +425,10 @@ You can now create a job that uses to use the container image. In this section,
@@ -400,8 +499,10 @@ You can now create a job that uses to use the container image. In this section,
400
499
|`--secrets`| The secrets to use for the job. |
401
500
|`--env-vars`| The environment variables to use for the job. |
402
501
|`--registry-server`| The container registry server to use for the job. For an Azure Container Registry, the command automatically configures authentication. |
502
+
|`--mi-user-assigned`| The resource ID of the user-assigned managed identity to assign to the job. |
503
+
|`--registry-identity`| The resource ID of a managed identity to authenticate with the registry server instead of using a username and password. If possible, an 'acrpull' role assignment is created for the identity automatically. |
403
504
404
-
The scale rule configuration defines the event source to monitor. It's evaluated on each polling interval and determines how many job executions to trigger. To learn more, see [Set scaling rules](scale-app.md).
505
+
The scale rule configuration defines the event source to monitor. Rules are evaluated on each polling interval to determine how many job executions to trigger. To learn more, see [Set scaling rules](scale-app.md).
405
506
406
507
The event-driven job is now created in the Container Apps environment.
407
508
@@ -811,13 +912,13 @@ The following table describes the scale rule parameters used in the command.
811
912
| `--scale-rule-metadata` | The metadata for the scale rule. |
812
913
| `--scale-rule-auth` | The authentication for the scale rule. |
813
914
814
-
The scale rule configuration defines the event source to monitor. It's evaluated on each polling interval and determines how many job executions to trigger. To learn more, see [Set scaling rules](scale-app.md).
915
+
The scale rule configuration defines the event source to monitor. Rules are evaluated on each polling interval to determine how many job executions to trigger. To learn more, see [Set scaling rules](scale-app.md).
815
916
816
917
The event-driven job is now created in the Container Apps environment.
817
918
818
919
## Run a pipeline and verify the job
819
920
820
-
Now that you've configured a self-hosted agent job, you can run a pipeline and verify it's working correctly.
921
+
Once a self-hosted agent job is configured, you can run a pipeline and verify it's working correctly.
821
922
822
923
1. In the left-hand navigation of your Azure DevOps project, navigate to **Pipelines**.
0 commit comments