Skip to content

Commit

Permalink
Support for having blank management VM resource ID,
Browse files Browse the repository at this point in the history
which is optional when not using AD as the logon type.
  • Loading branch information
SvenAelterman committed Dec 10, 2024
1 parent f97496f commit 9fa453e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions research-spoke/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ param createPolicyExemptions bool = false
param policyAssignmentId string = ''

@secure()
param sessionHostLocalAdminUsername string
param sessionHostLocalAdminUsername string = ''
@secure()
param sessionHostLocalAdminPassword string
param sessionHostLocalAdminPassword string = ''
@description('Specifies if logons to virtual machines should use AD or Entra ID.')
@allowed(['ad', 'entraID'])
param logonType string
Expand Down Expand Up @@ -381,10 +381,9 @@ module diskEncryptionSetModule '../shared-modules/security/diskEncryptionSet.bic
dependsOn: [uamiKvRbacModule]
}

// TODO: Split once into var and re-use var
var hubManagementVmSubscriptionId = split(hubManagementVmId, '/')[2]
var hubManagementVmResourceGroupName = split(hubManagementVmId, '/')[4]
var hubManagementVmName = split(hubManagementVmId, '/')[8]
var hubManagementVmSubscriptionId = !empty(hubManagementVmId) ? split(hubManagementVmId, '/')[2] : ''
var hubManagementVmResourceGroupName = !empty(hubManagementVmId) ? split(hubManagementVmId, '/')[4] : ''
var hubManagementVmName = !empty(hubManagementVmId) ? split(hubManagementVmId, '/')[8] : ''

import { roleAssignmentType } from '../shared-modules/types/roleAssignment.bicep'

Expand Down
2 changes: 1 addition & 1 deletion research-spoke/spoke-modules/storage/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ module storageAccountModule 'storageAccount.bicep' = {
}
}

resource hubManagementRg 'Microsoft.Resources/resourceGroups@2024-03-01' existing = {
resource hubManagementRg 'Microsoft.Resources/resourceGroups@2024-03-01' existing = if (domainJoin && length(fileShareNames) > 0) {
name: hubManagementRgName
scope: subscription(hubSubscriptionId)
}
Expand Down

0 comments on commit 9fa453e

Please sign in to comment.