Skip to content

Commit

Permalink
Tags & Other Fixes (Azure#1010)
Browse files Browse the repository at this point in the history
* Updated tags in MLZ

* Added condition fix for network watcher deployment

* Updated tags for Tier3

* Grouped sizes by family

* Fixed tagging, Added copyright, Fixed formatting

* Updated MLZ tags

* Compiled bicep changes

* Updated environment value in tags

* Fixed deployment name

* Fixed tags for pvt endpoint

* Compiled bicep changes

* Updated tagging

* Fixed param name, Sorted params

* Compiled bicep changes

* Centralized the version number

* Converted workload values from params to vars

* Updated deployment names for consistency

* GitHub Action: Build Bicep to JSON

---------

Co-authored-by: github-actions <[email protected]>
  • Loading branch information
jamasten and github-actions authored Apr 19, 2024
1 parent 0afc053 commit d9866b4
Show file tree
Hide file tree
Showing 79 changed files with 2,251 additions and 1,157 deletions.
8 changes: 4 additions & 4 deletions src/bicep/add-ons/azureVirtualDesktop/uiDefinition.json
Original file line number Diff line number Diff line change
Expand Up @@ -736,17 +736,17 @@
],
"constraints": {
"allowedSizes": [
"Standard_NV4as_v4",
"Standard_NV8as_v4",
"Standard_NV16as_v4",
"Standard_NV32as_v4",
"Standard_NC4as_T4_v3",
"Standard_NC8as_T4_v3",
"Standard_NC16as_T4_v3",
"Standard_NC64as_T4_v3",
"Standard_NV4as_v4",
"Standard_NV6ads_A10_v5",
"Standard_NV8as_v4",
"Standard_NV12ads_A10_v5",
"Standard_NV16as_v4",
"Standard_NV18ads_A10_v5",
"Standard_NV32as_v4",
"Standard_NV36adms_A10_v5",
"Standard_NV36ads_A10_v5",
"Standard_NV72ads_A10_v5"
Expand Down
101 changes: 62 additions & 39 deletions src/bicep/add-ons/imaging/modules/automationAccount.bicep
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
Copyright (c) Microsoft Corporation.
Licensed under the MIT License.
*/

param arcGisProInstaller string
param actionGroupName string
param automationAccountName string
Expand Down Expand Up @@ -43,6 +48,7 @@ param managementVirtualMachineName string
param marketplaceImageOffer string
param marketplaceImagePublisher string
param marketplaceImageSKU string
param mlzTags object
param msrdcwebrtcsvcInstaller string
param officeInstaller string
param oUPath string
Expand Down Expand Up @@ -100,6 +106,7 @@ var parameters = {
marketplaceImageOffer: marketplaceImageOffer
marketplaceImagePublisher: marketplaceImagePublisher
marketplaceImageSKU: marketplaceImageSKU
mlzTags: string(mlzTags)
msrdcwebrtcsvcInstaller: msrdcwebrtcsvcInstaller
officeInstaller: officeInstaller
replicaCount: string(replicaCount)
Expand Down Expand Up @@ -135,7 +142,10 @@ resource virtualMachine 'Microsoft.Compute/virtualMachines@2023-07-01' existing
resource automationAccount 'Microsoft.Automation/automationAccounts@2022-08-08' = {
name: automationAccountName
location: location
tags: contains(tags, 'Microsoft.Automation/automationAccounts') ? tags['Microsoft.Automation/automationAccounts'] : {}
tags: union(
contains(tags, 'Microsoft.Automation/automationAccounts') ? tags['Microsoft.Automation/automationAccounts'] : {},
mlzTags
)
properties: {
disableLocalAuth: false
publicNetworkAccess: false
Expand All @@ -152,12 +162,19 @@ resource automationAccount 'Microsoft.Automation/automationAccounts@2022-08-08'
resource privateEndpoint 'Microsoft.Network/privateEndpoints@2023-05-01' = {
name: privateEndpointName
location: location
tags: contains(tags, 'Microsoft.Network/privateEndpoints') ? tags['Microsoft.Network/privateEndpoints'] : {}
tags: union(
contains(tags, 'Microsoft.Network/privateEndpoints') ? tags['Microsoft.Network/privateEndpoints'] : {},
mlzTags
)
properties: {
privateLinkServiceConnections: [
{
name: privateEndpointName
id: resourceId('Microsoft.Network/privateEndpoints/privateLinkServiceConnections', privateEndpointName, privateEndpointName)
id: resourceId(
'Microsoft.Network/privateEndpoints/privateLinkServiceConnections',
privateEndpointName,
privateEndpointName
)
properties: {
privateLinkServiceId: automationAccount.id
groupIds: [
Expand Down Expand Up @@ -191,7 +208,10 @@ resource privateDnsZoneGroup 'Microsoft.Network/privateEndpoints/privateDnsZoneG
resource runCommand 'Microsoft.Compute/virtualMachines/runCommands@2023-07-01' = {
name: 'runbook'
location: location
tags: contains(tags, 'Microsoft.Compute/virtualMachines') ? tags['Microsoft.Compute/virtualMachines'] : {}
tags: union(
contains(tags, 'Microsoft.Compute/virtualMachines') ? tags['Microsoft.Compute/virtualMachines'] : {},
mlzTags
)
parent: virtualMachine
properties: {
treatFailureAsDeploymentFailure: true
Expand Down Expand Up @@ -325,17 +345,19 @@ resource jobSchedule 'Microsoft.Automation/automationAccounts/jobSchedules@2022-
]
}

module monitoring 'monitoring.bicep' = if (!empty(logAnalyticsWorkspaceResourceId) && !empty(distributionGroup) && !empty(actionGroupName)) {
name: 'monitoring-${deploymentNameSuffix}'
params: {
actionGroupName: actionGroupName
automationAccountName: automationAccount.name
distributionGroup: distributionGroup
location: location
logAnalyticsWorkspaceResourceId: logAnalyticsWorkspaceResourceId
tags: tags
module monitoring 'monitoring.bicep' =
if (!empty(logAnalyticsWorkspaceResourceId) && !empty(distributionGroup) && !empty(actionGroupName)) {
name: 'monitoring-${deploymentNameSuffix}'
params: {
actionGroupName: actionGroupName
automationAccountName: automationAccount.name
distributionGroup: distributionGroup
location: location
logAnalyticsWorkspaceResourceId: logAnalyticsWorkspaceResourceId
mlzTags: mlzTags
tags: tags
}
}
}

resource hybridRunbookWorkerGroup 'Microsoft.Automation/automationAccounts/hybridRunbookWorkerGroups@2022-08-08' = {
parent: automationAccount
Expand Down Expand Up @@ -373,30 +395,31 @@ resource extension_HybridWorker 'Microsoft.Compute/virtualMachines/extensions@20
]
}

resource extension_JsonADDomainExtension 'Microsoft.Compute/virtualMachines/extensions@2021-03-01' = if (!empty(domainJoinUserPrincipalName) && !empty(domainName) && !empty(oUPath)) {
parent: virtualMachine
name: 'JsonADDomainExtension'
location: location
tags: contains(tags, 'Microsoft.Compute/virtualMachines') ? tags['Microsoft.Compute/virtualMachines'] : {}
properties: {
forceUpdateTag: time
publisher: 'Microsoft.Compute'
type: 'JsonADDomainExtension'
typeHandlerVersion: '1.3'
autoUpgradeMinorVersion: true
settings: {
Name: domainName
User: domainJoinUserPrincipalName
Restart: 'true'
Options: '3'
OUPath: oUPath
}
protectedSettings: {
Password: domainJoinPassword
resource extension_JsonADDomainExtension 'Microsoft.Compute/virtualMachines/extensions@2021-03-01' =
if (!empty(domainJoinUserPrincipalName) && !empty(domainName) && !empty(oUPath)) {
parent: virtualMachine
name: 'JsonADDomainExtension'
location: location
tags: contains(tags, 'Microsoft.Compute/virtualMachines') ? tags['Microsoft.Compute/virtualMachines'] : {}
properties: {
forceUpdateTag: time
publisher: 'Microsoft.Compute'
type: 'JsonADDomainExtension'
typeHandlerVersion: '1.3'
autoUpgradeMinorVersion: true
settings: {
Name: domainName
User: domainJoinUserPrincipalName
Restart: 'true'
Options: '3'
OUPath: oUPath
}
protectedSettings: {
Password: domainJoinPassword
}
}
dependsOn: [
extension_HybridWorker
runCommand
]
}
dependsOn: [
extension_HybridWorker
runCommand
]
}
25 changes: 17 additions & 8 deletions src/bicep/add-ons/imaging/modules/baseline.bicep
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
Copyright (c) Microsoft Corporation.
Licensed under the MIT License.
*/

targetScope = 'subscription'

param computeGalleryName string
Expand All @@ -6,18 +11,19 @@ param diskEncryptionSetResourceId string
param enableBuildAutomation bool
param exemptPolicyAssignmentIds array
param location string
param mlzTags object
param resourceGroupName string
param storageAccountResourceId string
param subscriptionId string
param tags object
param userAssignedIdentityName string


module userAssignedIdentity 'userAssignedIdentity.bicep' = {
scope: resourceGroup(subscriptionId, resourceGroupName)
name: 'user-assigned-identity-${deploymentNameSuffix}'
params: {
location: location
mlzTags: mlzTags
name: userAssignedIdentityName
tags: tags
}
Expand Down Expand Up @@ -53,21 +59,24 @@ module computeGallery 'computeGallery.bicep' = {
name: 'gallery-image-${deploymentNameSuffix}'
scope: resourceGroup(subscriptionId, resourceGroupName)
params: {
computeGalleryName: computeGalleryName
enableBuildAutomation: enableBuildAutomation
location: location
computeGalleryName: computeGalleryName
mlzTags: mlzTags
tags: tags
userAssignedIdentityPrincipalId: userAssignedIdentity.outputs.principalId
}
}

module policyExemptions 'exemption.bicep' = [for i in range(0, length(exemptPolicyAssignmentIds)): if (!empty((exemptPolicyAssignmentIds)[0])) {
name: 'PolicyExemption_${i}'
scope: resourceGroup(subscriptionId, resourceGroupName)
params: {
policyAssignmentId: exemptPolicyAssignmentIds[i]
module policyExemptions 'exemption.bicep' = [
for i in range(0, length(exemptPolicyAssignmentIds)): if (!empty((exemptPolicyAssignmentIds)[0])) {
name: 'PolicyExemption_${i}'
scope: resourceGroup(subscriptionId, resourceGroupName)
params: {
policyAssignmentId: exemptPolicyAssignmentIds[i]
}
}
}]
]

output computeGalleryResourceId string = computeGallery.outputs.computeGalleryResourceId
output userAssignedIdentityClientId string = userAssignedIdentity.outputs.clientId
Expand Down
51 changes: 33 additions & 18 deletions src/bicep/add-ons/imaging/modules/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.24.24.22086",
"templateHash": "3810275683162469600"
"version": "0.26.170.59819",
"templateHash": "7690073340382206658"
}
},
"parameters": {
Expand All @@ -27,6 +27,9 @@
"location": {
"type": "string"
},
"mlzTags": {
"type": "object"
},
"resourceGroupName": {
"type": "string"
},
Expand Down Expand Up @@ -59,6 +62,9 @@
"location": {
"value": "[parameters('location')]"
},
"mlzTags": {
"value": "[parameters('mlzTags')]"
},
"name": {
"value": "[parameters('userAssignedIdentityName')]"
},
Expand All @@ -72,14 +78,17 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.24.24.22086",
"templateHash": "13213041153837743619"
"version": "0.26.170.59819",
"templateHash": "6296883959770176834"
}
},
"parameters": {
"location": {
"type": "string"
},
"mlzTags": {
"type": "object"
},
"name": {
"type": "string"
},
Expand All @@ -93,7 +102,7 @@
"apiVersion": "2018-11-30",
"name": "[parameters('name')]",
"location": "[parameters('location')]",
"tags": "[if(contains(parameters('tags'), 'Microsoft.ManagedIdentity/userAssignedIdentities'), parameters('tags')['Microsoft.ManagedIdentity/userAssignedIdentities'], createObject())]"
"tags": "[union(if(contains(parameters('tags'), 'Microsoft.ManagedIdentity/userAssignedIdentities'), parameters('tags')['Microsoft.ManagedIdentity/userAssignedIdentities'], createObject()), parameters('mlzTags'))]"
}
],
"outputs": {
Expand Down Expand Up @@ -135,8 +144,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.24.24.22086",
"templateHash": "12486914288824279509"
"version": "0.26.170.59819",
"templateHash": "1613196570045452117"
}
},
"parameters": {
Expand Down Expand Up @@ -199,8 +208,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.24.24.22086",
"templateHash": "1100663954772220507"
"version": "0.26.170.59819",
"templateHash": "16678314039986560835"
}
},
"parameters": {
Expand Down Expand Up @@ -258,8 +267,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.24.24.22086",
"templateHash": "8640629756451087690"
"version": "0.26.170.59819",
"templateHash": "17953983585809496662"
}
},
"parameters": {
Expand Down Expand Up @@ -304,14 +313,17 @@
},
"mode": "Incremental",
"parameters": {
"computeGalleryName": {
"value": "[parameters('computeGalleryName')]"
},
"enableBuildAutomation": {
"value": "[parameters('enableBuildAutomation')]"
},
"location": {
"value": "[parameters('location')]"
},
"computeGalleryName": {
"value": "[parameters('computeGalleryName')]"
"mlzTags": {
"value": "[parameters('mlzTags')]"
},
"tags": {
"value": "[parameters('tags')]"
Expand All @@ -326,8 +338,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.24.24.22086",
"templateHash": "3726474265381754008"
"version": "0.26.170.59819",
"templateHash": "17328117917467575507"
}
},
"parameters": {
Expand All @@ -340,6 +352,9 @@
"location": {
"type": "string"
},
"mlzTags": {
"type": "object"
},
"tags": {
"type": "object"
},
Expand All @@ -356,7 +371,7 @@
"apiVersion": "2022-01-03",
"name": "[parameters('computeGalleryName')]",
"location": "[parameters('location')]",
"tags": "[if(contains(parameters('tags'), 'Microsoft.Compute/galleries'), parameters('tags')['Microsoft.Compute/galleries'], createObject())]"
"tags": "[union(if(contains(parameters('tags'), 'Microsoft.Compute/galleries'), parameters('tags')['Microsoft.Compute/galleries'], createObject()), parameters('mlzTags'))]"
},
{
"condition": "[parameters('enableBuildAutomation')]",
Expand Down Expand Up @@ -413,8 +428,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.24.24.22086",
"templateHash": "6436250754327901801"
"version": "0.26.170.59819",
"templateHash": "4949441353974629907"
}
},
"parameters": {
Expand Down
Loading

0 comments on commit d9866b4

Please sign in to comment.