Skip to content

Commit f5a66db

Browse files
author
Dany Contreras
committed
updates
1 parent a364ce3 commit f5a66db

File tree

5 files changed

+6899
-17
lines changed

5 files changed

+6899
-17
lines changed

workload/bicep/brownfield/addAvdAgents/deploy.bicep

+8-11
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,8 @@ targetScope = 'resourceGroup'
44
// Parameters //
55
// ========== //
66

7-
@sys.description('Subscription ID where to deploy session hosts. (Default: )')
8-
param computeSubscriptionId string
9-
10-
@sys.description('Resource Group name where to deploy session hosts. (Default: )')
11-
param computeRgResourceGroupName string
12-
13-
@sys.description('The name of the VM where the AVD agents will be installed. (Default: )')
14-
param vmName string
7+
@sys.description('Virtual machine resource ID. (Default: )')
8+
param vmResourceId string
159

1610
@sys.description('AVD Host Pool resource ID. (Default: )')
1711
param hostPoolResourceId string
@@ -33,6 +27,9 @@ var varHostpoolRgName = split(hostPoolResourceId, '/')[4]
3327
var varHostPoolName = split(hostPoolResourceId, '/')[8]
3428
var varKeyVaultSubId = split(keyVaultResourceId, '/')[2]
3529
var varKeyVaultRgName = split(keyVaultResourceId, '/')[4]
30+
var varVmName = split(vmResourceId, '/')[8]
31+
var varVmSubId = split(vmResourceId, '/')[2]
32+
var varVmRgName = split(vmResourceId, '/')[4]
3633
var varBaseScriptUri = 'https://raw.githubusercontent.com/Azure/avdaccelerator/main/workload/'
3734
var varSessionHostConfigurationScriptUri = '${varBaseScriptUri}scripts/Set-SessionHostConfiguration.ps1'
3835
var varSessionHostConfigurationScript = './Set-SessionHostConfiguration.ps1'
@@ -81,11 +78,11 @@ resource keyVault 'Microsoft.KeyVault/vaults@2023-07-01' existing = {
8178

8279
// Apply AVD session host configurations
8380
module sessionHostConfiguration './modules/configureSessionHost.bicep' = {
84-
scope: resourceGroup('${computeSubscriptionId}', '${computeRgResourceGroupName}')
85-
name: 'AVD-Agents-${vmName}-${time}'
81+
scope: resourceGroup('${varVmSubId}', '${varVmRgName}')
82+
name: 'AVD-Agents-${varVmName}-${time}'
8683
params: {
8784
location: vmLocation
88-
name: vmName
85+
name: varVmName
8986
hostPoolToken: keyVault.getSecret('hostPoolRegistrationToken')
9087
baseScriptUri: varSessionHostConfigurationScriptUri
9188
scriptName: varSessionHostConfigurationScript

workload/bicep/brownfield/addAvdAgents/readme.md

+4-6
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ This solution will deploy the AVD agents to a VM.
1919

2020
[![Deploy to Azure (under construction)]()
2121

22+
[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#blade/Microsoft_Azure_CreateUIDef/CustomDeploymentBlade/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Favdaccelerator%2Fmain%2Fworkload%2Farm%2Fbrownfield%2FdeployAddAvdAgents.json/uiFormDefinitionUri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Favdaccelerator%2Fmain%2Fworkload%2Fportal-ui%2Fbrownfield%2FportalUiAddAvdAgents.json) [![Deploy to Azure Gov](https://aka.ms/deploytoazuregovbutton)](https://portal.azure.us/?feature.deployapiver=2022-12-01#blade/Microsoft_Azure_CreateUIDef/CustomDeploymentBlade/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Favdaccelerator%2Fmain%2Fworkload%2Farm%2Fbrownfield%2FdeployAddAvdAgents.json/uiFormDefinitionUri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Favdaccelerator%2Fmain%2Fworkload%2Fportal-ui%2Fbrownfield%2FportalUiAddAvdAgents.json)
23+
2224
### PowerShell
2325

2426
```powershell
2527
New-AzSubscriptionDeployment `
2628
-Location '<Azure location>' `
2729
-TemplateFile 'https://raw.githubusercontent.com/Azure/avdaccelerator/main/workload/brownfield/addAvdAgents/deploy.bicep' `
28-
-computeSubscriptionId '<ID of the subscription where the VM was created>' `
29-
-computeRgResourceGroupName '<Resource group name where the VM was created>' `
3030
-vmLocation '<VM location>' `
31-
-vmName '<VM name>' `
31+
-vmResourceId '<resource ID of the VM where the AVD agents will be installed>' `
3232
-hostPoolResourceId '<resource ID of the host pool to which the VM will be registered>' `
3333
-keyVaultResourceId '<resource ID of the key vault where the host pool registration token will be stored>' `
3434
-Verbose
@@ -43,10 +43,8 @@ az deployment sub create \
4343
--location '<Azure location>' \
4444
--template-uri 'https://raw.githubusercontent.com/Azure/avdaccelerator/main/workload/brownfield/addAvdAgents/deploy.bicep' \
4545
--parameters \
46-
computeSubscriptionId '<ID of the subscription where the VM was created>' \
47-
computeRgResourceGroupName '<Resource group name where the VM was created>' \
4846
vmLocation '<VM location>' \
49-
vmName '<VM name>' \
47+
vmResourceId '<resource ID of the VM where the AVD agents will be installed>' \
5048
hostPoolResourceId '<resource ID of the host pool to which the VM will be registered>' \
5149
keyVaultResourceId '<resource ID of the key vault where the host pool registration token will be stored>'
5250
```

0 commit comments

Comments
 (0)