Skip to content

Commit d936522

Browse files
authored
Merge pull request #108152 from aut0pil0t/patch-1
Update syntax and variable errors
2 parents ca587af + 42df979 commit d936522

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

articles/devtest-labs/devtest-lab-integrate-ci-cd.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,10 @@ $labVmRgName = (Get-AzResource -Id $labVmComputeId).ResourceGroupName
7070
$labVmName = (Get-AzResource -Id $labVmId).Name
7171
7272
# Get lab VM public IP address
73-
$labVMIpAddress = (Get-AzPublicIpAddress -ResourceGroupName $labVmRgName
74-
-Name $labVmName).IpAddress
73+
$labVMIpAddress = (Get-AzPublicIpAddress -ResourceGroupName $labVmRgName -Name $labVmName).IpAddress
7574
7675
# Get lab VM FQDN
77-
$labVMFqdn = (Get-AzPublicIpAddress -ResourceGroupName $labVmRgName
78-
-Name $labVmName).DnsSettings.Fqdn
76+
$labVMFqdn = (Get-AzPublicIpAddress -ResourceGroupName $labVmRgName -Name $labVmName).DnsSettings.Fqdn
7977
8078
# Set a variable labVmRgName to store the lab VM resource group name
8179
Write-Host "##vso[task.setvariable variable=labVmRgName;]$labVmRgName"
@@ -127,10 +125,10 @@ The next step creates a golden image VM to use for future deployments. This step
127125
- **Virtual Machine Name**: the variable you specified for your virtual machine name: *$vmName*.
128126
- **Template**: Browse to and select the template file you checked in to your project repository.
129127
- **Parameters File**: If you checked a parameters file into your repository, browse to and select it.
130-
- **Parameter Overrides**: Enter `-newVMName '$(vmName)' -userName '$(userName)' -password (ConvertTo-SecureString -String '$(password)' -AsPlainText -Force)`.
131-
- Drop down **Output Variables**, and under **Reference name**, enter the variable for the created lab VM ID. If you use the default *labVmId*, you can refer to the variable in subsequent tasks as **$(labVmId)**.
128+
- **Parameter Overrides**: Enter `-newVMName '$(vmName)' -userName '$(userName)' -password '$(password)'`.
129+
- Drop down **Output Variables**, and under **Reference name**, enter the variable for the created lab VM ID. Let's enter *vm* for **Reference name** for simplicity. **labVmId** will be an attribute of this variable and will be referred to later as *$vm.labVmId*. If you use any other name, then remember to use it accordingly in the subsequent tasks.
132130

133-
You can create a name other than the default, but remember to use the correct name in subsequent tasks. You can write the Lab VM ID in the following form: `/subscriptions/{subscription Id}/resourceGroups/{resource group Name}/providers/Microsoft.DevTestLab/labs/{lab name}/virtualMachines/{vmName}`.
131+
Lab VM ID will be in the following form: `/subscriptions/{subscription Id}/resourceGroups/{resource group Name}/providers/Microsoft.DevTestLab/labs/{lab name}/virtualMachines/{vmName}`.
134132

135133
### Collect the details of the DevTest Labs VM
136134

@@ -143,7 +141,7 @@ Next, the pipeline runs the script you created to collect the details of the Dev
143141
- **Azure Subscription**: Select your service connection or subscription.
144142
- **Script Type**: Select **Script File Path**.
145143
- **Script Path**: Browse to and select the PowerShell script that you checked in to your source code repository. You can use built-in properties to simplify the path, for example: `$(System.DefaultWorkingDirectory/Scripts/GetLabVMParams.ps1`.
146-
- **Script Arguments**: Enter the name of the **labVmId** variable you populated in the previous task, for example *-labVmId '$(labVmId)'*.
144+
- **Script Arguments**: Enter the value as **-labVmId $(vm.labVmId)**.
147145

148146
The script collects the required values and stores them in environment variables within the release pipeline, so you can refer to them in later steps.
149147

@@ -159,7 +157,7 @@ The next task creates an image of the newly deployed VM in your lab. You can use
159157
- **Lab**: Select your lab.
160158
- **Custom Image Name**: Enter a name for the custom image.
161159
- **Description**: Enter an optional description to make it easy to select the correct image.
162-
- **Source Lab VM**: The source **labVmId**. If you changed the default name of the **labVmId** variable, enter it here. The default value is **$(labVmId)**.
160+
- **Source Lab VM**: The source **labVmId**. Enter the value as **$(vm.labVmId)**.
163161
- **Output Variables**: You can edit the name of the default Custom Image ID variable if necessary.
164162

165163
### Deploy your app to the DevTest Labs VM (optional)
@@ -177,7 +175,7 @@ The final task is to delete the VM that you deployed in your lab. You'd ordinari
177175
1. Configure the task as follows:
178176
- **Azure RM Subscription**: Select your service connection or subscription.
179177
- **Lab**: Select your lab.
180-
- **Virtual Machine**: Select the VM you want to delete.
178+
- **Virtual Machine**: Enter the value as **$(vm.labVmId)**.
181179
- **Output Variables**: Under **Reference name**, if you changed the default name of the **labVmId** variable, enter it here. The default value is **$(labVmId)**.
182180

183181
### Save the release pipeline

0 commit comments

Comments
 (0)