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
Copy file name to clipboardExpand all lines: articles/devtest-labs/add-artifact-repository.md
+38-38Lines changed: 38 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -190,44 +190,44 @@ To add an artifact repo, complete the following tasks:
190
190
191
191
1. To add your artifact repository to the lab, select **Add** in the top menu.
192
192
193
-
:::image type="content" source="media/devtest-lab-add-repo/devtestlab-add-repo.png" alt-text="Screenshot that shows the Repositories configuration screen." lightbox=media/devtest-lab-add-repo/devtestlab-add-repo.png":::
193
+
:::image type="content" source="media/devtest-lab-add-repo/devtestlab-add-repo.png" alt-text="Screenshot that shows the Repositories configuration screen." lightbox="media/devtest-lab-add-repo/devtestlab-add-repo.png":::
194
194
195
195
1. In the **Repository** pane, enter the following information:
196
196
197
197
-**Name**: A repository name to use in the lab.
198
198
-**Git clone URL**: The Git HTTPS clone URL from GitHub Repos.
199
199
-**Branch** (optional): The branch that has your artifact definitions.
200
200
-**Folder paths**: The folder for your ARM template definitions, relative to the Git clone URL. Be sure to include the initial forward slash in the folder path.
201
-
-**GitHub app**: Use this option to leverage GitHub app authentication.
201
+
-**GitHub app**: Select this option to use GitHub app authentication.
202
202
203
203
1. Select **Save**.
204
204
205
-

205
+
:::image type="content" source="media/devtest-lab-add-repo/devtestlab-repo-blade-with-github-app-auth.png" alt-text="Screenshot that shows the steps for adding an artifact repository to a lab." lightbox="media/devtest-lab-add-repo/devtestlab-repo-blade-with-github-app-auth.png":::
206
206
207
207
The repository now appears in the **Repositories** list for the lab.
208
208
209
209
## [GitHub repo with PAT](#tab/GitHubRepoPAT/)
210
210
211
211
### Get the clone URL and personal access token for GitHub
212
212
213
-
1. On the home page of the GitHub repository that has your artifacts, select **Code**, and under **Clone**, copy the HTTPS URL.
213
+
1. On the home page of the GitHub repository that stores your artifacts, select **Code**, and under **Clone**, copy the HTTPS URL.
214
214
1. Select your profile image in the upper-right corner of GitHub, and then select **Settings**.
215
215
1. On your profile page, in the left menu, select **Developer Settings**, and then select **Personal access tokens**.
216
216
1. Select **Generate new token**.
217
-
1. On the **New personal access token** page, under **Note**, enter an optional description for the token. Accept all the defaults, and then select **Generate token**.
217
+
1. On the **New personal access token** page, under **Note**, enter a description for the token, if you want. Accept all the defaults, and then select **Generate token**.
218
218
1. Save the generated token.
219
219
220
220
### Add a GitHub artifact repository to a lab in the Azure portal
221
221
222
-
1. On the lab's **Overview** page, select **Configuration and policies**from the left navigation.
222
+
1. On the lab's **Overview** page, select **Configuration and policies**in the left pane.
223
223
224
-
1. On the **Configuration and policies** page, select **Repositories** under **External resources** in the left navigation.
224
+
1. On the **Configuration and policies** page, select **Repositories** under **External resources** in the left pane.
225
225
226
-
On the **Repositories** page, the **Public Artifact Repo** is automatically present and connects to the [DevTest Labs public GitHub repository](https://github.com/Azure/azure-devtestlab). If this repo isn't enabled for your lab, you can enable it by selecting the checkbox next to **Public Artifact Repo**, and then selecting **Enable**on the top menu bar.
226
+
On the **Repositories** page, the **Public Artifact Repo** is automatically present and connects to the [DevTest Labs public GitHub repository](https://github.com/Azure/azure-devtestlab). If this repo isn't enabled for your lab, you can enable it by selecting the checkbox next to **Public Artifact Repo**, and then selecting **Enable**in menu at the top of the pane.
227
227
228
-
1. To add your artifact repository to the lab, select **Add** in the top menu bar.
228
+
1. To add your artifact repository to the lab, select **Add** in the top menu.
229
229
230
-

230
+
:::image type="content" source="media/devtest-lab-add-repo/devtestlab-add-repo.png" alt-text="Screenshot that shows the Repositories configuration screen." lightbox="media/devtest-lab-add-repo/devtestlab-add-repo.png":::
231
231
232
232
1. In the **Repository** pane, enter the following information:
233
233
@@ -240,7 +240,7 @@ The repository now appears in the **Repositories** list for the lab.
240
240
241
241
1. Select **Save**.
242
242
243
-

243
+
:::image type="content" source="media/devtest-lab-add-repo/devtestlab-repo-blade-with-github-pat.png" alt-text="Screenshot that shows the fields for adding a new artifact repository to a lab." lightbox="media/devtest-lab-add-repo/devtestlab-repo-blade-with-github-pat.png":::
244
244
245
245
The repository now appears in the **Repositories** list for the lab.
246
246
@@ -250,7 +250,7 @@ The repository now appears in the **Repositories** list for the lab.
250
250
251
251
ARM templates are JSON files that describe Azure resources to create. For more information about ARM templates, see [Understand the structure and syntax of ARM templates](../azure-resource-manager/templates/syntax.md).
252
252
253
-
The following ARM template adds an artifact repository to a lab. The template creates the lab if it doesn't already exist.
253
+
The following ARM template adds an artifact repository to a lab. If the lab doesn't already exist, the template creates it.
254
254
255
255
### Review the ARM template
256
256
@@ -337,7 +337,7 @@ There are several ways to deploy ARM templates to create or update Azure resourc
337
337
-[Deploy resources with ARM templates in the Azure portal](../azure-resource-manager/templates/deploy-portal.md)
338
338
-[Deploy resources with ARM templates and Resource Manager REST API](../azure-resource-manager/templates/deploy-rest.md)
339
339
340
-
For this example, deploy the template by using Azure PowerShell.
340
+
For this procedure, deploy the template by using Azure PowerShell.
341
341
342
342
> [!NOTE]
343
343
> The cmdlets that deploy the template are context-specific, so they use the current tenant and subscription. If you need to change the context, use [Set-AzContext](/powershell/module/az.accounts/set-azcontext) before you deploy the template
@@ -369,7 +369,7 @@ The following sample PowerShell script, *New-DevTestLabArtifactRepository.ps1*,
369
369
<#
370
370
371
371
.SYNOPSIS
372
-
This script creates a new custom repository and adds it to an existing DevTest Lab.
372
+
This script creates a new custom repository and adds it to an existing DevTest lab.
373
373
374
374
.PARAMETER LabName
375
375
The name of the lab.
@@ -378,20 +378,20 @@ The name of the lab.
378
378
The name of the resource group that contains the lab.
379
379
380
380
.PARAMETER ArtifactRepositoryName
381
-
Name for the new artifact repository. The script creates a random name for the repository if not specified.
381
+
Name for the new artifact repository. The script creates a random name for the repository if a name isn't specified.
382
382
383
383
.PARAMETER ArtifactRepositoryDisplayName
384
384
Display name for the artifact repository.
385
385
This name appears in the list of artifact repositories for a lab.
386
386
387
387
.PARAMETER RepositoryUri
388
-
Uri to the artifact repository.
388
+
URI to the artifact repository.
389
389
390
390
.PARAMETER RepositoryBranch
391
391
Branch that contains the artifact files. Defaults to 'main'.
392
392
393
393
.PARAMETER FolderPath
394
-
Folder that contains the artifact files. Defaults to '/Artifacts'
394
+
Folder that contains the artifact files. Defaults to '/Artifacts'.
395
395
396
396
.PARAMETER PersonalAccessToken
397
397
Personal access token for the GitHub or Azure Repos repository.
@@ -433,7 +433,7 @@ Param(
433
433
$SourceType
434
434
)
435
435
436
-
# Set artifact repository internal name if not specified.
436
+
# Set artifact repository internal name if it's not specified.
#Return the newly created resource to use in later scripts.
492
+
#Return the newly created resource to use in later scripts.
494
493
return $result
495
494
```
496
495
@@ -501,19 +500,18 @@ The PowerShell script takes the following parameters:
501
500
| Parameter | Description |
502
501
| --------- | ----------- |
503
502
|`LabName`| The name of the lab. |
504
-
|`ArtifactRepositoryName`| Name for the new artifact repository. The script creates a random name for the repository if it isn't specified. |
503
+
|`ArtifactRepositoryName`| Name for the new artifact repository. The script creates a random name for the repository if a name isn't specified. |
505
504
|`ArtifactRepositoryDisplayName`| Display name that appears in the lab's artifact repository list. |
506
-
|`RepositoryUri`| URI of the artifact repository, which you copied earlier.|
505
+
|`RepositoryUri`| URI of the artifact repository. You copeied this value earlier.|
507
506
|`RepositoryBranch`| Repository branch that contains the artifacts. The default value is `main`.|
508
-
|`FolderPath`| Folder that contains the artifacts. The default value is: `/Artifacts`.|
509
-
|`PersonalAccessToken`| Security token for accessing the repository, which you copied earlier.|
510
-
|`SourceType`| Whether the artifact repository is a VSOGit (Azure Repos) or GitHub repository.|
511
-
507
+
|`FolderPath`| Folder that contains the artifacts. The default value is `/Artifacts`.|
508
+
|`PersonalAccessToken`| Security token for accessing the repository. You copied this value earlier.|
509
+
|`SourceType`| Whether the artifact repository is a `VSOGit` (Azure Repos) or GitHub repository.|
512
510
513
-
The repository needs an internal name for identification, which is different than the display name in the Azure portal. You don't see the internal name when using the Azure portal, but you see it when using Azure REST APIs or Azure PowerShell. The script creates a random name if the deployment command doesn't specify one.
511
+
The repository needs an internal name for identification. This name is different from the display name in the Azure portal. You don't see the internal name when using the Azure portal, but you see it when using Azure REST APIs or Azure PowerShell. The script creates a random name if the deployment command doesn't specify one.
514
512
515
513
```powershell
516
-
#Set artifact repository name, if not set by user
514
+
#Set artifact repository name, if it's not set by user.
@@ -526,15 +524,15 @@ The script uses the following PowerShell commands:
526
524
| Command | Notes |
527
525
| ------------------ | ----- |
528
526
|[Get-AzResource](/powershell/module/az.resources/get-azresource)| Gets details about the lab, such as its location. You create the artifact repository source in the same location and under the same resource group as the lab.|
529
-
|[New-AzResource](/powershell/module/az.resources/new-azresource)| Adds the Azure resource. There's no specific command for adding artifact repositories. This cmdlet needs either the `ResourceId` or the `ResourceName` and `ResourceType` pair to know the type of resource to create. The current script uses the `ResourceName` and `ResourceType` pair. |
527
+
|[New-AzResource](/powershell/module/az.resources/new-azresource)| Adds the Azure resource. There's no specific command for adding artifact repositories. This cmdlet needs either the `ResourceId` or the `ResourceName` and `ResourceType` pair to know the type of resource to create. The preceding script uses the `ResourceName` and `ResourceType` pair. |
530
528
531
-
A good way to discover resource name and resource type information is to use the [Azure REST API Browser](https://azure.github.io/projects/apis/) website. DevTest Labs [Artifact Sources](/rest/api/dtl/artifact-sources) shows REST APIs for creating and managing DevTest Labs artifact sources. The current script uses the following resource ID:
529
+
A good way to discover resource name and resource type information is to use the [Azure REST API Browser](https://azure.github.io/projects/apis/) website. DevTest Labs [Artifact Sources](/rest/api/dtl/artifact-sources) shows REST APIs for creating and managing DevTest Labs artifact sources. The preceding script uses the following resource ID:
The resource type is everything listed after `providers` in the URI, except for items in curly brackets. The resource name is everything in the curly brackets. If you use more than one item for the resource name, separate each item with a slash:
535
+
The resource type is everything listed after `providers` in the URI, except for items in curly brackets ({}). The resource name is everything in the curly brackets. If you use more than one item for the resource name, separate each item with a slash:
Run the PowerShell script, substituting your own values for the example values in `LabName`, `LabResourceGroupName`, `ArtifactRepositoryName`, `RepositoryUri`, `PersonalAccessToken`, and `SourceType`:
0 commit comments