Skip to content

Commit

Permalink
Fixed vm name prefix in vm template (Azure#1011)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamasten authored Apr 20, 2024
1 parent 1392713 commit f6faf0e
Show file tree
Hide file tree
Showing 3 changed files with 168 additions and 140 deletions.
5 changes: 4 additions & 1 deletion src/bicep/add-ons/azureVirtualDesktop/modules/logic.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ param imagePublisher string
param imageSku string
param locations object
param locationVirtualMachines string
param networkName string
param resourceGroupControlPlane string
param resourceGroupFeedWorkspace string
param resourceGroupHosts string
param resourceGroupManagement string
param resourceGroupsNetwork array
param resourceGroupStorage string
param securityPrincipals array
param serviceName string
param sessionHostCount int
param sessionHostIndex int
param virtualMachineNamePrefix string
Expand Down Expand Up @@ -64,13 +66,14 @@ var roleDefinitions = {
VirtualMachineUserLogin: 'fb879df8-f326-4884-b1cf-06f3ad86be52'
}
var securityPrincipalsCount = length(securityPrincipals)
var sessionHostNamePrefix = replace(virtualMachineNamePrefix, '${serviceName}${networkName}', '')
var smbServerLocation = locations[locationVirtualMachines].abbreviation
var storageSku = fslogixStorageService == 'None' ? 'None' : split(fslogixStorageService, ' ')[1]
var storageService = split(fslogixStorageService, ' ')[0]
var storageSuffix = environment().suffixes.storage
var timeDifference = locations[locationVirtualMachines].timeDifference
var timeZone = locations[locationVirtualMachines].timeZone
var vmTemplate = '{"domain":"${domainName}","galleryImageOffer":"${imageOffer}","galleryImagePublisher":"${imagePublisher}","galleryImageSKU":"${imageSku}","imageType":"Gallery","imageUri":null,"customImageId":null,"namePrefix":"${virtualMachineNamePrefix}","osDiskType":"${diskSku}","useManagedDisks":true,"VirtualMachineSize":{"id":"${virtualMachineSize}","cores":null,"ram":null},"galleryItemId":"${imagePublisher}.${imageOffer}${imageSku}"}'
var vmTemplate = '{"domain":"${domainName}","galleryImageOffer":"${imageOffer}","galleryImagePublisher":"${imagePublisher}","galleryImageSKU":"${imageSku}","imageType":"Gallery","imageUri":null,"customImageId":null,"namePrefix":"${sessionHostNamePrefix}","osDiskType":"${diskSku}","useManagedDisks":true,"VirtualMachineSize":{"id":"${virtualMachineSize}","cores":null,"ram":null},"galleryItemId":"${imagePublisher}.${imageOffer}${imageSku}"}'

output availabilitySetsCount int = availabilitySetsCount
output beginAvSetRange int = beginAvSetRange
Expand Down
2 changes: 2 additions & 0 deletions src/bicep/add-ons/azureVirtualDesktop/solution.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -317,13 +317,15 @@ module logic 'modules/logic.bicep' = {
imageSku: imageSku
locations: names.outputs.locations
locationVirtualMachines: locationVirtualMachines
networkName: names.outputs.networkName
resourceGroupControlPlane: names.outputs.resources.resourceGroupControlPlane
resourceGroupFeedWorkspace: names.outputs.resources.resourceGroupFeedWorkspace
resourceGroupHosts: names.outputs.resources.resourceGroupHosts
resourceGroupManagement: names.outputs.resources.resourceGroupManagement
resourceGroupsNetwork: names.outputs.resources.resourceGroupsNetwork
resourceGroupStorage: names.outputs.resources.resourceGroupStorage
securityPrincipals: securityPrincipals
serviceName: names.outputs.serviceName
sessionHostCount: sessionHostCount
sessionHostIndex: sessionHostIndex
virtualMachineNamePrefix: names.outputs.resources.virtualMachineNamePrefix
Expand Down
Loading

0 comments on commit f6faf0e

Please sign in to comment.