Skip to content

Commit a7dc11b

Browse files
author
RoseHJM
committed
Using key vault secrets
1 parent 98d0cee commit a7dc11b

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

articles/dev-box/how-to-write-customization-file.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ms.date: 11/06/2024
1010
#customer intent: As a dev center administrator or DevCenter Project Admin I want to create image definition files so that my development teams can create customized dev boxes.
1111
---
1212

13-
# Write a Team Customization file for Dev Box
13+
# Write a customization file for Dev Box
1414
In this article, you learn how to create and test a customization file for your dev box using Visual Studio Code and Dev Home.
1515

1616
There are two ways to use a customization file: team customizations which apply automatically once configured on a pool, and individual customizations which are applied when a user creates a dev box.
@@ -120,8 +120,11 @@ To invoke the Dev Box chat agent:
120120
121121
You can select **Generate Workload.yaml File** to create a file with the custom task. You can then rename the *workload.yaml* file to *imagedefintion.yaml*for use in your team customizations.
122122
123-
## Use secrets from an Azure Key Vault
124-
You can use secrets from your Azure Key Vault in your yaml customizations to clone private repositories, or with any custom task you author that requires an access token.
123+
## Clone a private repository using a customization file
124+
You can use secrets from your Azure Key Vault in your yaml customizations to clone private repositories, or with any custom task you author that requires an access token. In a team customization file, you can use a personal access token (PAT) sotred in a key vault to access a private repository. In an individual customization file, you can also use the `{{ado}}` or `{{ado://your-ado-organization-name}}` parameter to fetch an access token on your behalf when creating a dev box.
125+
126+
### Use Key Vault secrets in team customization files
127+
To clone a private repository, store your PAT as an Azure KeyVault secret, and use it when invoking the git-clone task in your customization.
125128

126129
To configure your Key Vault secrets for use in your yaml customizations:
127130
1. Ensure that your dev center project's managed identity has the Key Vault Reader role and Key Vault Secrets User role on your key vault.
@@ -143,8 +146,8 @@ tasks:
143146
directory: C:\Workspaces
144147
pat: '{{KEY_VAULT_SECRET_URI}}'
145148
```
146-
147-
If you wish to clone a private Azure Repos repository, you don't need to configure a secret in Key Vault. Instead, you can use `{{ado}}`, or `{{ado://your-ado-organization-name}}` as a parameter. This fetches an access token on your behalf when creating a dev box, which has read-only permission to your repository. The git-clone task in the quickstart catalog uses the access token to clone your repository. Here's an example:
149+
### Use Key Vault secrets in individual customization files
150+
If you wish to clone a private Azure Repos repository from an individual customization file, you don't need to configure a secret in Key Vault. Instead, you can use `{{ado}}`, or `{{ado://your-ado-organization-name}}` as a parameter. This fetches an access token on your behalf when creating a dev box, which has read-only permission to your repository. The git-clone task in the quickstart catalog uses the access token to clone your repository. Here's an example:
148151

149152
```yml
150153
tasks:

0 commit comments

Comments
 (0)