Skip to content

Commit

Permalink
More naming changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jamasten committed Feb 9, 2024
1 parent 33bdceb commit 617cc63
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,14 @@ module shares 'shares.bicep' = [for i in range(0, storageCount): {
}]

resource privateEndpoints 'Microsoft.Network/privateEndpoints@2023-04-01' = [for i in range(0, storageCount): {
name: '${replace(storageAccountPrivateEndpointNamePrefix, serviceName, 'file')}${padLeft(i + storageIndex, 2, '0')}'
name: '${replace(storageAccountPrivateEndpointNamePrefix, serviceName, 'file')}-${padLeft(i + storageIndex, 2, '0')}'
location: location
tags: tagsPrivateEndpoints
properties: {
customNetworkInterfaceName: '${replace(storageAccountNetworkInterfaceNamePrefix, serviceName, 'file')}${padLeft(i + storageIndex, 2, '0')}'
customNetworkInterfaceName: '${replace(storageAccountNetworkInterfaceNamePrefix, serviceName, 'file')}-${padLeft(i + storageIndex, 2, '0')}'
privateLinkServiceConnections: [
{
name: '${replace(storageAccountPrivateEndpointNamePrefix, serviceName, 'file')}${padLeft(i + storageIndex, 2, '0')}'
name: '${replace(storageAccountPrivateEndpointNamePrefix, serviceName, 'file')}-${padLeft(i + storageIndex, 2, '0')}'
properties: {
privateLinkServiceId: storageAccounts[i].id
groupIds: [
Expand All @@ -193,7 +193,7 @@ resource privateEndpoints 'Microsoft.Network/privateEndpoints@2023-04-01' = [for

resource privateDnsZoneGroups 'Microsoft.Network/privateEndpoints/privateDnsZoneGroups@2021-08-01' = [for i in range(0, storageCount): {
parent: privateEndpoints[i]
name: '${storageAccountNamePrefix}${padLeft(i + storageIndex, 2, '0')}'
name: '${storageAccountNamePrefix}-${padLeft(i + storageIndex, 2, '0')}'
properties: {
privateDnsZoneConfigs: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ var securityLogAnalyticsWorkspaceResourceGroupName = securityMonitoring ? split(
var securityLogAnalyticsWorkspaceSubscriptionId = securityMonitoring ? split(securityLogAnalyticsWorkspaceResourceId, '/')[2] : subscription().subscriptionId
var securityMonitoring = empty(securityLogAnalyticsWorkspaceResourceId) ? false : true
var securityWorkspaceKey = securityMonitoring ? listKeys(securityLogAnalyticsWorkspaceResourceId, '2021-06-01').primarySharedKey : 'NotApplicable'
var sessionHostNamePrefix = replace(virtualMachineNamePrefix, '${serviceName}${networkName}', '')

resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2021-06-01' existing = if (securityMonitoring) {
name: securitylogAnalyticsWorkspaceName
Expand Down Expand Up @@ -137,7 +138,7 @@ resource networkInterface 'Microsoft.Network/networkInterfaces@2020-05-01' = [fo
}]

resource virtualMachine 'Microsoft.Compute/virtualMachines@2021-03-01' = [for i in range(0, sessionHostCount): {
name: '${replace(virtualMachineNamePrefix, '${serviceName}${networkName}', '')}${padLeft((i + sessionHostIndex), 4, '0')}'
name: '${sessionHostNamePrefix}${padLeft((i + sessionHostIndex), 4, '0')}'
location: location
tags: tagsVirtualMachines
zones: availability == 'AvailabilityZones' ? [
Expand Down Expand Up @@ -174,7 +175,7 @@ resource virtualMachine 'Microsoft.Compute/virtualMachines@2021-03-01' = [for i
dataDisks: []
}
osProfile: {
computerName: '${replace(virtualMachineNamePrefix, '${serviceName}${networkName}', '')}${padLeft((i + sessionHostIndex), 4, '0')}'
computerName: '${sessionHostNamePrefix}${padLeft((i + sessionHostIndex), 4, '0')}'
adminUsername: virtualMachineUsername
adminPassword: virtualMachinePassword
windowsConfiguration: {
Expand Down Expand Up @@ -355,7 +356,7 @@ module drainMode '../common/customScriptExtensions.bicep' = if (enableDrainMode)
'${artifactsUri}Set-AvdDrainMode.ps1'
]
location: location
parameters: '-Environment ${environment().name} -hostPoolName ${hostPoolName} -HostPoolResourceGroupName ${resourceGroupControlPlane} -sessionHostCount ${sessionHostCount} -sessionHostIndex ${sessionHostIndex} -SubscriptionId ${subscription().subscriptionId} -TenantId ${tenant().tenantId} -userAssignedidentityClientId ${deploymentUserAssignedidentityClientId} -virtualMachineNamePrefix ${virtualMachineNamePrefix}'
parameters: '-Environment ${environment().name} -hostPoolName ${hostPoolName} -HostPoolResourceGroupName ${resourceGroupControlPlane} -sessionHostCount ${sessionHostCount} -sessionHostIndex ${sessionHostIndex} -SubscriptionId ${subscription().subscriptionId} -TenantId ${tenant().tenantId} -userAssignedidentityClientId ${deploymentUserAssignedidentityClientId} -virtualMachineNamePrefix ${sessionHostNamePrefix}'
scriptFileName: 'Set-AvdDrainMode.ps1'
tags: tagsVirtualMachines
userAssignedIdentityClientId: deploymentUserAssignedidentityClientId
Expand Down
Loading

0 comments on commit 617cc63

Please sign in to comment.