Skip to content

Commit f6e9928

Browse files
committed
wi
1 parent 94bca37 commit f6e9928

3 files changed

Lines changed: 10 additions & 40 deletions

File tree

docs/infrastructure/bootstrap.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
11
make hub-nonlive bootstrap
2+
3+
4+
# Find the AVD SP object id (run as someone with AAD read access)
5+
az ad sp show --id 9cdead84-a844-4324-93f2-b2e6bb768d07 --query id
6+
7+
# Then assign the role (run as Owner)
8+
az role assignment create \
9+
--assignee-object-id <AVD_SP_OBJECT_ID> \
10+
--role "Desktop Virtualization Power On Contributor" \
11+
--scope /subscriptions/<SUBSCRIPTION_ID>

infrastructure/bootstrap/hub.bicep

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ param enableSoftDelete bool
3030

3131
// removed when generalised
3232
var appShortName = 'lungcs'
33-
//var appShortName = 'lungal'
3433

3534
var devCenterSuffix = substring(uniqueString(subscription().id), 0, 3)
3635
var devCenterName = 'devc-hub-${hubType}-${regionShortName}-${devCenterSuffix}'

infrastructure/terraform/hub/virtual_desktop.tf

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -156,45 +156,6 @@ resource "azurerm_resource_group" "avd_green" {
156156
# }
157157

158158

159-
data "azuread_service_principal" "avd_ms_sp" {
160-
application_id = local.principal_id # this is your "9cdead84-..." appId
161-
}
162-
163-
164-
resource "azurerm_role_definition" "avd_autoscale_operator" {
165-
name = "AVD Autoscale Operator"
166-
scope = data.azurerm_subscription.current.id
167-
description = "Allows Azure Virtual Desktop Autoscale to manage session host power state"
168-
169-
permissions {
170-
actions = [
171-
"Microsoft.DesktopVirtualization/hostPools/read",
172-
"Microsoft.DesktopVirtualization/hostPools/sessionHosts/read",
173-
"Microsoft.DesktopVirtualization/hostPools/sessionHosts/write",
174-
"Microsoft.Compute/virtualMachines/start/action",
175-
"Microsoft.Compute/virtualMachines/deallocate/action",
176-
"Microsoft.Compute/virtualMachines/read",
177-
"Microsoft.Insights/autoscalesettings/*"
178-
]
179-
not_actions = []
180-
}
181-
182-
assignable_scopes = [
183-
data.azurerm_subscription.current.id
184-
]
185-
}
186-
187-
resource "azurerm_role_assignment" "avd_autoscale_blue_sp" {
188-
for_each = local.deploy_blue_avd ? var.regions : {}
189-
190-
scope = azurerm_resource_group.avd_blue[each.key].id
191-
role_definition_id = azurerm_role_definition.avd_autoscale_operator.id
192-
principal_id = data.azuread_service_principal.avd_ms_sp.object_id
193-
principal_type = "ServicePrincipal"
194-
195-
# ensure role definition exists first
196-
depends_on = [azurerm_role_definition.avd_autoscale_operator]
197-
}
198159

199160
# Green AVD deployment
200161
module "virtual-desktop-green" {

0 commit comments

Comments
 (0)