diff --git a/deployments/azure/all-in-one.json b/deployments/azure/all-in-one.json index 81436f7..24f387c 100644 --- a/deployments/azure/all-in-one.json +++ b/deployments/azure/all-in-one.json @@ -5,7 +5,7 @@ "_generator": { "name": "bicep", "version": "0.24.24.22086", - "templateHash": "7836508991779513085" + "templateHash": "15418479916005263131" } }, "parameters": { @@ -187,6 +187,13 @@ "metadata": { "description": "Use a Network Load Balancer to connect to the Workspace server" } + }, + "Tags": { + "type": "object", + "defaultValue": {}, + "metadata": { + "description": "Tags to apply to all newly created resources, in the form of {\"key_one\":\"value_one\",\"key_two\":\"value_two\"}" + } } }, "variables": { @@ -236,6 +243,9 @@ }, "userClientId": { "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, parameters('ResourceGroupName')), 'Microsoft.Resources/deployments', 'workspaces'), '2022-09-01').outputs.PrincipleId.value]" + }, + "tags": { + "value": "[parameters('Tags')]" } }, "template": { @@ -244,8 +254,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.23.1.45101", - "templateHash": "10179246844067754393" + "version": "0.24.24.22086", + "templateHash": "11274348200796028004" } }, "parameters": { @@ -258,6 +268,10 @@ "location": { "type": "string" }, + "tags": { + "type": "object", + "defaultValue": {} + }, "userClientId": { "type": "securestring" } @@ -268,6 +282,7 @@ "apiVersion": "2023-02-01", "name": "[parameters('keyVaultName')]", "location": "[parameters('location')]", + "tags": "[parameters('tags')]", "properties": { "sku": { "family": "A", @@ -353,6 +368,9 @@ }, "detinationAppSecGroups": { "value": "[parameters('detinationAppSecGroups')]" + }, + "tags": { + "value": "[parameters('Tags')]" } }, "template": { @@ -362,7 +380,7 @@ "_generator": { "name": "bicep", "version": "0.24.24.22086", - "templateHash": "1018858806142179392" + "templateHash": "3088606472882204851" } }, "parameters": { @@ -399,6 +417,10 @@ "jupyterHttpPort": { "type": "string", "defaultValue": "None" + }, + "tags": { + "type": "object", + "defaultValue": {} } }, "resources": [ @@ -406,6 +428,7 @@ "type": "Microsoft.Network/networkSecurityGroups", "apiVersion": "2022-11-01", "name": "[parameters('name')]", + "tags": "[parameters('tags')]", "location": "[parameters('location')]" }, { @@ -616,6 +639,9 @@ }, "jupyterHttpPort": { "value": "[int(parameters('JupyterHttpPort'))]" + }, + "tags": { + "value": "[parameters('Tags')]" } }, "template": { @@ -625,7 +651,7 @@ "_generator": { "name": "bicep", "version": "0.24.24.22086", - "templateHash": "6905843737085590430" + "templateHash": "3385554541683646128" } }, "parameters": { @@ -646,13 +672,17 @@ "jupyterHttpPort": { "type": "int", "defaultValue": 0 + }, + "tags": { + "type": "object", + "defaultValue": {} } }, "resources": [ { "type": "Microsoft.Network/publicIPAddresses", "apiVersion": "2021-08-01", - "name": "inbound", + "name": "[format('{0}-inbound', parameters('name'))]", "location": "[parameters('location')]", "sku": { "name": "Standard" @@ -660,12 +690,13 @@ "properties": { "publicIPAddressVersion": "IPv4", "publicIPAllocationMethod": "Static" - } + }, + "tags": "[parameters('tags')]" }, { "type": "Microsoft.Network/publicIPAddresses", "apiVersion": "2021-08-01", - "name": "outbound", + "name": "[format('{0}-outbound', parameters('name'))]", "location": "[parameters('location')]", "sku": { "name": "Standard" @@ -673,7 +704,8 @@ "properties": { "publicIPAddressVersion": "IPv4", "publicIPAllocationMethod": "Static" - } + }, + "tags": "[parameters('tags')]" }, { "type": "Microsoft.Network/loadBalancers", @@ -689,7 +721,7 @@ "name": "[format('{0}Inbound', parameters('name'))]", "properties": { "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses', 'inbound')]" + "id": "[resourceId('Microsoft.Network/publicIPAddresses', format('{0}-inbound', parameters('name')))]" } } }, @@ -697,7 +729,7 @@ "name": "[format('{0}Outbound', parameters('name'))]", "properties": { "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses', 'outbound')]" + "id": "[resourceId('Microsoft.Network/publicIPAddresses', format('{0}-outbound', parameters('name')))]" } } } @@ -732,9 +764,10 @@ } ] }, + "tags": "[parameters('tags')]", "dependsOn": [ - "[resourceId('Microsoft.Network/publicIPAddresses', 'inbound')]", - "[resourceId('Microsoft.Network/publicIPAddresses', 'outbound')]" + "[resourceId('Microsoft.Network/publicIPAddresses', format('{0}-inbound', parameters('name')))]", + "[resourceId('Microsoft.Network/publicIPAddresses', format('{0}-outbound', parameters('name')))]" ] } ], @@ -748,7 +781,7 @@ }, "PublicIp": { "type": "string", - "value": "[reference(resourceId('Microsoft.Network/publicIPAddresses', 'inbound'), '2021-08-01').ipAddress]" + "value": "[reference(resourceId('Microsoft.Network/publicIPAddresses', format('{0}-inbound', parameters('name'))), '2021-08-01').ipAddress]" } } } @@ -808,6 +841,9 @@ "nlbPoolNames": "[if(parameters('UseNLB'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, parameters('ResourceGroupName')), 'Microsoft.Resources/deployments', 'loadbalancer'), '2022-09-01').outputs.nlbPools.value), createObject('value', createArray()))]", "usePublicIp": { "value": "[not(parameters('UseNLB'))]" + }, + "tags": { + "value": "[parameters('Tags')]" } }, "template": { @@ -817,7 +853,7 @@ "_generator": { "name": "bicep", "version": "0.24.24.22086", - "templateHash": "994520545106154152" + "templateHash": "8152473424343277729" } }, "parameters": { @@ -871,6 +907,10 @@ "nlbPoolNames": { "type": "array", "defaultValue": [] + }, + "tags": { + "type": "object", + "defaultValue": {} } }, "variables": { @@ -933,6 +973,7 @@ "apiVersion": "2023-04-02", "name": "[format('{0}-disk', parameters('name'))]", "location": "[parameters('location')]", + "tags": "[parameters('tags')]", "properties": { "creationData": { "createOption": "Empty" @@ -947,6 +988,7 @@ "apiVersion": "2022-11-01", "name": "[variables('networkInterfaceName')]", "location": "[parameters('location')]", + "tags": "[parameters('tags')]", "properties": { "ipConfigurations": [ "[if(parameters('usePublicIp'), createObject('name', 'ipconfigpublic', 'properties', createObject('privateIPAllocationMethod', 'Dynamic', 'subnet', createObject('id', parameters('subnetId')), 'publicIPAddress', createObject('id', resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))), 'loadBalancerBackendAddressPools', variables('resourcePools'))), createObject('name', 'ipconfigprivate', 'properties', createObject('privateIPAllocationMethod', 'Dynamic', 'subnet', createObject('id', parameters('subnetId')), 'loadBalancerBackendAddressPools', variables('resourcePools'))))]" @@ -965,6 +1007,7 @@ "apiVersion": "2022-11-01", "name": "[variables('publicIPAddressName')]", "location": "[parameters('location')]", + "tags": "[parameters('tags')]", "sku": { "name": "Basic" }, @@ -982,6 +1025,7 @@ "apiVersion": "2023-03-01", "name": "[parameters('name')]", "location": "[parameters('location')]", + "tags": "[parameters('tags')]", "identity": { "type": "SystemAssigned" }, @@ -1029,6 +1073,7 @@ "type": "Microsoft.Compute/virtualMachines/extensions", "apiVersion": "2023-03-01", "name": "[format('{0}/{1}', parameters('name'), variables('trustedExtensionName'))]", + "tags": "[parameters('tags')]", "location": "[parameters('location')]", "properties": { "publisher": "[variables('trustedExtensionPublisher')]", @@ -1052,6 +1097,7 @@ "type": "Microsoft.Compute/virtualMachines/extensions", "apiVersion": "2023-03-01", "name": "[format('{0}/{1}', parameters('name'), variables('dockerExtensionName'))]", + "tags": "[parameters('tags')]", "location": "[parameters('location')]", "properties": { "publisher": "[variables('dockerExtensionPublisher')]", diff --git a/deployments/azure/bicep/all-in-one.bicep b/deployments/azure/bicep/all-in-one.bicep index a9b4eaa..ab22be2 100644 --- a/deployments/azure/bicep/all-in-one.bicep +++ b/deployments/azure/bicep/all-in-one.bicep @@ -80,6 +80,9 @@ param JupyterToken string = uniqueString(subscription().id, utcNow()) @description('Use a Network Load Balancer to connect to the Workspace server') param UseNLB bool = false +@description('Tags to apply to all newly created resources, in the form of {"key_one":"value_one","key_two":"value_two"}') +param Tags object = {} + var roleAssignmentName = guid(subscription().id, WorkspacesName, rg.id, RoleDefinitionId) var registry = 'teradata' @@ -138,6 +141,7 @@ module vault '../modules/vault.bicep' = if (UseKeyVault == 'New') { keyVaultName: WorkspacesName location: rg.location userClientId: workspaces.outputs.PrincipleId + tags: Tags } } @@ -154,6 +158,7 @@ module firewall '../modules/firewall.bicep' = { jupyterHttpPort: JupyterHttpPort sourceAppSecGroups: SourceAppSecGroups detinationAppSecGroups: detinationAppSecGroups + tags: Tags } } @@ -166,6 +171,7 @@ module nlb '../modules/nlb.bicep' = if (UseNLB) { workspacesHttpPort: int(WorkspacesHttpPort) workspacesGrpcPort: int(WorkspacesGrpcPort) jupyterHttpPort: int(JupyterHttpPort) + tags: Tags } } @@ -189,6 +195,7 @@ module workspaces '../modules/instance.bicep' = { nlbName: UseNLB ? WorkspacesName : '' nlbPoolNames: UseNLB ? nlb.outputs.nlbPools : [] usePublicIp: !UseNLB + tags: Tags } } diff --git a/deployments/azure/bicep/all-in-one.bicepparam b/deployments/azure/bicep/all-in-one.bicepparam index e89153c..4b5a39d 100644 --- a/deployments/azure/bicep/all-in-one.bicepparam +++ b/deployments/azure/bicep/all-in-one.bicepparam @@ -26,3 +26,4 @@ param WorkspacesVersion = 'latest' param JupyterVersion = 'latest' param JupyterToken = 'USE_A_SECURE_TOKEN' /* TODO : please fix the value assigned to this parameter `uniqueString()` */ param UseNLB = false +param Tags = {} diff --git a/deployments/azure/bicep/jupyter.bicep b/deployments/azure/bicep/jupyter.bicep index 5e55eef..48078f6 100644 --- a/deployments/azure/bicep/jupyter.bicep +++ b/deployments/azure/bicep/jupyter.bicep @@ -64,6 +64,9 @@ param JupyterToken string = uniqueString(subscription().id, utcNow()) @description('Use a Network Load Balancer to connect to the Jupyter Labs server') param UseNLB bool = false +@description('Tags to apply to all newly created resources, in the form of {"key_one":"value_one","key_two":"value_two"}') +param Tags object = {} + var registry = 'teradata' var jupyterRepository = 'ai-unlimited-jupyter' @@ -110,6 +113,7 @@ module firewall '../modules/firewall.bicep' = { jupyterHttpPort: JupyterHttpPort sourceAppSecGroups: SourceAppSecGroups detinationAppSecGroups: detinationAppSecGroups + tags: Tags } } @@ -120,6 +124,7 @@ module nlb '../modules/nlb.bicep' = if (UseNLB) { name: JupyterName location: rg.location jupyterHttpPort: int(JupyterHttpPort) + tags: Tags } } @@ -143,12 +148,13 @@ module jupyter '../modules/instance.bicep' = { nlbName: UseNLB ? JupyterName : '' nlbPoolNames: UseNLB ? nlb.outputs.nlbPools : [] usePublicIp: !UseNLB + tags: Tags } } output PublicIP string = UseNLB ? nlb.outputs.PublicIp : jupyter.outputs.PublicIP output PrivateIP string = jupyter.outputs.PrivateIP -output JupyterLabPublicHttpAccess string = 'http://${jupyter.outputs.PublicIP}:${JupyterHttpPort}?token=${JupyterToken}' +output JupyterLabPublicHttpAccess string = 'http://${UseNLB ? nlb.outputs.PublicIp : jupyter.outputs.PublicIP}:${JupyterHttpPort}?token=${JupyterToken}' output JupyterLabPrivateHttpAccess string = 'http://${jupyter.outputs.PrivateIP}:${JupyterHttpPort}?token=${JupyterToken}' output sshCommand string = 'ssh azureuser@${jupyter.outputs.PublicIP}' output SecurityGroup string = firewall.outputs.Id diff --git a/deployments/azure/bicep/jupyter.bicepparam b/deployments/azure/bicep/jupyter.bicepparam index df4e719..f77f467 100644 --- a/deployments/azure/bicep/jupyter.bicepparam +++ b/deployments/azure/bicep/jupyter.bicepparam @@ -21,3 +21,4 @@ param ExistingPersistentVolume = 'NONE' param JupyterVersion = 'latest' param JupyterToken = 'USE_A_SECURE_TOKEN' /* TODO : please fix the value assigned to this parameter `uniqueString()` */ param UseNLB = false +param Tags = {} diff --git a/deployments/azure/bicep/resources.bicep b/deployments/azure/bicep/resources.bicep index 7b96058..22c5e5f 100644 --- a/deployments/azure/bicep/resources.bicep +++ b/deployments/azure/bicep/resources.bicep @@ -13,9 +13,13 @@ param networkCidr array = [ '10.0.0.0/16' ] @description('New subnet CIDR.') param subnetCidr string = '10.0.0.0/24' +@description('Tags to apply to all newly created resources, in the form of {"key_one":"value_one","key_two":"value_two"}') +param Tags object = {} + resource rg 'Microsoft.Resources/resourceGroups@2022-09-01' = { name: name location: location + tags: Tags } module network '../modules/network.bicep' = { @@ -26,6 +30,7 @@ module network '../modules/network.bicep' = { networkCidr: networkCidr subnetCidr: subnetCidr location: location + tags: Tags } } diff --git a/deployments/azure/bicep/resources.bicepparam b/deployments/azure/bicep/resources.bicepparam index 8130b6b..62af40e 100644 --- a/deployments/azure/bicep/resources.bicepparam +++ b/deployments/azure/bicep/resources.bicepparam @@ -6,4 +6,5 @@ param networkCidr = [ '10.0.0.0/16' ] param subnetCidr = '10.0.0.0/24' +param Tags = {} diff --git a/deployments/azure/bicep/workspaces.bicep b/deployments/azure/bicep/workspaces.bicep index bcb848e..995ea4b 100644 --- a/deployments/azure/bicep/workspaces.bicep +++ b/deployments/azure/bicep/workspaces.bicep @@ -71,6 +71,9 @@ param WorkspacesVersion string = 'latest' @description('Use a Network Load Balancer to connect to the Workspace server') param UseNLB bool = false +@description('Tags to apply to all newly created resources, in the form of {"key_one":"value_one","key_two":"value_two"}') +param Tags object = {} + var roleAssignmentName = guid(subscription().id, WorkspacesName, rg.id, RoleDefinitionId) var registry = 'teradata' @@ -118,6 +121,7 @@ module vault '../modules/vault.bicep' = if (UseKeyVault == 'New') { keyVaultName: WorkspacesName location: rg.location userClientId: workspaces.outputs.PrincipleId + tags: Tags } } @@ -133,6 +137,7 @@ module firewall '../modules/firewall.bicep' = { workspacesGrpcPort: WorkspacesGrpcPort sourceAppSecGroups: SourceAppSecGroups detinationAppSecGroups: detinationAppSecGroups + tags: Tags } } @@ -144,6 +149,7 @@ module nlb '../modules/nlb.bicep' = if (UseNLB) { location: rg.location workspacesHttpPort: int(WorkspacesHttpPort) workspacesGrpcPort: int(WorkspacesGrpcPort) + tags: Tags } } @@ -167,6 +173,7 @@ module workspaces '../modules/instance.bicep' = { nlbName: UseNLB ? WorkspacesName : '' nlbPoolNames: UseNLB ? nlb.outputs.nlbPools : [] usePublicIp: !UseNLB + tags: Tags } } diff --git a/deployments/azure/bicep/workspaces.bicepparam b/deployments/azure/bicep/workspaces.bicepparam index 075b27c..3f7e57d 100644 --- a/deployments/azure/bicep/workspaces.bicepparam +++ b/deployments/azure/bicep/workspaces.bicepparam @@ -23,4 +23,5 @@ param PersistentVolumeSize = 100 param ExistingPersistentVolume = 'NONE' param WorkspacesVersion = 'latest' param UseNLB = false +param Tags = {} diff --git a/deployments/azure/jupyter.json b/deployments/azure/jupyter.json index 1a47b95..55deabe 100644 --- a/deployments/azure/jupyter.json +++ b/deployments/azure/jupyter.json @@ -5,7 +5,7 @@ "_generator": { "name": "bicep", "version": "0.24.24.22086", - "templateHash": "7551054961389377101" + "templateHash": "11790579766503591956" } }, "parameters": { @@ -149,6 +149,13 @@ "metadata": { "description": "Use a Network Load Balancer to connect to the Jupyter Labs server" } + }, + "Tags": { + "type": "object", + "defaultValue": {}, + "metadata": { + "description": "Tags to apply to all newly created resources, in the form of {\"key_one\":\"value_one\",\"key_two\":\"value_two\"}" + } } }, "variables": { @@ -191,6 +198,9 @@ }, "detinationAppSecGroups": { "value": "[parameters('detinationAppSecGroups')]" + }, + "tags": { + "value": "[parameters('Tags')]" } }, "template": { @@ -200,7 +210,7 @@ "_generator": { "name": "bicep", "version": "0.24.24.22086", - "templateHash": "1018858806142179392" + "templateHash": "3088606472882204851" } }, "parameters": { @@ -237,6 +247,10 @@ "jupyterHttpPort": { "type": "string", "defaultValue": "None" + }, + "tags": { + "type": "object", + "defaultValue": {} } }, "resources": [ @@ -244,6 +258,7 @@ "type": "Microsoft.Network/networkSecurityGroups", "apiVersion": "2022-11-01", "name": "[parameters('name')]", + "tags": "[parameters('tags')]", "location": "[parameters('location')]" }, { @@ -448,6 +463,9 @@ }, "jupyterHttpPort": { "value": "[int(parameters('JupyterHttpPort'))]" + }, + "tags": { + "value": "[parameters('Tags')]" } }, "template": { @@ -457,7 +475,7 @@ "_generator": { "name": "bicep", "version": "0.24.24.22086", - "templateHash": "6905843737085590430" + "templateHash": "3385554541683646128" } }, "parameters": { @@ -478,13 +496,17 @@ "jupyterHttpPort": { "type": "int", "defaultValue": 0 + }, + "tags": { + "type": "object", + "defaultValue": {} } }, "resources": [ { "type": "Microsoft.Network/publicIPAddresses", "apiVersion": "2021-08-01", - "name": "inbound", + "name": "[format('{0}-inbound', parameters('name'))]", "location": "[parameters('location')]", "sku": { "name": "Standard" @@ -492,12 +514,13 @@ "properties": { "publicIPAddressVersion": "IPv4", "publicIPAllocationMethod": "Static" - } + }, + "tags": "[parameters('tags')]" }, { "type": "Microsoft.Network/publicIPAddresses", "apiVersion": "2021-08-01", - "name": "outbound", + "name": "[format('{0}-outbound', parameters('name'))]", "location": "[parameters('location')]", "sku": { "name": "Standard" @@ -505,7 +528,8 @@ "properties": { "publicIPAddressVersion": "IPv4", "publicIPAllocationMethod": "Static" - } + }, + "tags": "[parameters('tags')]" }, { "type": "Microsoft.Network/loadBalancers", @@ -521,7 +545,7 @@ "name": "[format('{0}Inbound', parameters('name'))]", "properties": { "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses', 'inbound')]" + "id": "[resourceId('Microsoft.Network/publicIPAddresses', format('{0}-inbound', parameters('name')))]" } } }, @@ -529,7 +553,7 @@ "name": "[format('{0}Outbound', parameters('name'))]", "properties": { "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses', 'outbound')]" + "id": "[resourceId('Microsoft.Network/publicIPAddresses', format('{0}-outbound', parameters('name')))]" } } } @@ -564,9 +588,10 @@ } ] }, + "tags": "[parameters('tags')]", "dependsOn": [ - "[resourceId('Microsoft.Network/publicIPAddresses', 'inbound')]", - "[resourceId('Microsoft.Network/publicIPAddresses', 'outbound')]" + "[resourceId('Microsoft.Network/publicIPAddresses', format('{0}-inbound', parameters('name')))]", + "[resourceId('Microsoft.Network/publicIPAddresses', format('{0}-outbound', parameters('name')))]" ] } ], @@ -580,7 +605,7 @@ }, "PublicIp": { "type": "string", - "value": "[reference(resourceId('Microsoft.Network/publicIPAddresses', 'inbound'), '2021-08-01').ipAddress]" + "value": "[reference(resourceId('Microsoft.Network/publicIPAddresses', format('{0}-inbound', parameters('name'))), '2021-08-01').ipAddress]" } } } @@ -640,6 +665,9 @@ "nlbPoolNames": "[if(parameters('UseNLB'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, parameters('ResourceGroupName')), 'Microsoft.Resources/deployments', 'loadbalancer'), '2022-09-01').outputs.nlbPools.value), createObject('value', createArray()))]", "usePublicIp": { "value": "[not(parameters('UseNLB'))]" + }, + "tags": { + "value": "[parameters('Tags')]" } }, "template": { @@ -649,7 +677,7 @@ "_generator": { "name": "bicep", "version": "0.24.24.22086", - "templateHash": "994520545106154152" + "templateHash": "8152473424343277729" } }, "parameters": { @@ -703,6 +731,10 @@ "nlbPoolNames": { "type": "array", "defaultValue": [] + }, + "tags": { + "type": "object", + "defaultValue": {} } }, "variables": { @@ -765,6 +797,7 @@ "apiVersion": "2023-04-02", "name": "[format('{0}-disk', parameters('name'))]", "location": "[parameters('location')]", + "tags": "[parameters('tags')]", "properties": { "creationData": { "createOption": "Empty" @@ -779,6 +812,7 @@ "apiVersion": "2022-11-01", "name": "[variables('networkInterfaceName')]", "location": "[parameters('location')]", + "tags": "[parameters('tags')]", "properties": { "ipConfigurations": [ "[if(parameters('usePublicIp'), createObject('name', 'ipconfigpublic', 'properties', createObject('privateIPAllocationMethod', 'Dynamic', 'subnet', createObject('id', parameters('subnetId')), 'publicIPAddress', createObject('id', resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))), 'loadBalancerBackendAddressPools', variables('resourcePools'))), createObject('name', 'ipconfigprivate', 'properties', createObject('privateIPAllocationMethod', 'Dynamic', 'subnet', createObject('id', parameters('subnetId')), 'loadBalancerBackendAddressPools', variables('resourcePools'))))]" @@ -797,6 +831,7 @@ "apiVersion": "2022-11-01", "name": "[variables('publicIPAddressName')]", "location": "[parameters('location')]", + "tags": "[parameters('tags')]", "sku": { "name": "Basic" }, @@ -814,6 +849,7 @@ "apiVersion": "2023-03-01", "name": "[parameters('name')]", "location": "[parameters('location')]", + "tags": "[parameters('tags')]", "identity": { "type": "SystemAssigned" }, @@ -861,6 +897,7 @@ "type": "Microsoft.Compute/virtualMachines/extensions", "apiVersion": "2023-03-01", "name": "[format('{0}/{1}', parameters('name'), variables('trustedExtensionName'))]", + "tags": "[parameters('tags')]", "location": "[parameters('location')]", "properties": { "publisher": "[variables('trustedExtensionPublisher')]", @@ -884,6 +921,7 @@ "type": "Microsoft.Compute/virtualMachines/extensions", "apiVersion": "2023-03-01", "name": "[format('{0}/{1}', parameters('name'), variables('dockerExtensionName'))]", + "tags": "[parameters('tags')]", "location": "[parameters('location')]", "properties": { "publisher": "[variables('dockerExtensionPublisher')]", @@ -929,7 +967,7 @@ }, "JupyterLabPublicHttpAccess": { "type": "string", - "value": "[format('http://{0}:{1}?token={2}', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, parameters('ResourceGroupName')), 'Microsoft.Resources/deployments', 'jupyter'), '2022-09-01').outputs.PublicIP.value, parameters('JupyterHttpPort'), parameters('JupyterToken'))]" + "value": "[format('http://{0}:{1}?token={2}', if(parameters('UseNLB'), reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, parameters('ResourceGroupName')), 'Microsoft.Resources/deployments', 'loadbalancer'), '2022-09-01').outputs.PublicIp.value, reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, parameters('ResourceGroupName')), 'Microsoft.Resources/deployments', 'jupyter'), '2022-09-01').outputs.PublicIP.value), parameters('JupyterHttpPort'), parameters('JupyterToken'))]" }, "JupyterLabPrivateHttpAccess": { "type": "string", diff --git a/deployments/azure/modules/firewall.bicep b/deployments/azure/modules/firewall.bicep index df0d1ec..1a80528 100644 --- a/deployments/azure/modules/firewall.bicep +++ b/deployments/azure/modules/firewall.bicep @@ -7,9 +7,11 @@ param sshAccess bool = false param workspacesHttpPort string = 'None' param workspacesGrpcPort string = 'None' param jupyterHttpPort string = 'None' +param tags object = {} resource networkSecurityGroup 'Microsoft.Network/networkSecurityGroups@2022-11-01' = { name: name + tags: tags location: location } diff --git a/deployments/azure/modules/instance.bicep b/deployments/azure/modules/instance.bicep index 137e9cd..dcc886b 100644 --- a/deployments/azure/modules/instance.bicep +++ b/deployments/azure/modules/instance.bicep @@ -14,7 +14,7 @@ param cloudInitData string param usePublicIp bool param nlbName string = '' param nlbPoolNames array = [] - +param tags object = {} var imageReference = { 'Ubuntu-1804': { publisher: 'Canonical' @@ -69,7 +69,7 @@ resource existingPersistentDisk 'Microsoft.Compute/disks@2023-04-02' existing = resource newPersistentDisk 'Microsoft.Compute/disks@2023-04-02' = if (usePersistentVolume == 'New') { location: location name: '${name}-disk' - + tags: tags properties: { creationData: { createOption: 'Empty' @@ -83,6 +83,7 @@ resource newPersistentDisk 'Microsoft.Compute/disks@2023-04-02' = if (usePersist resource networkInterface 'Microsoft.Network/networkInterfaces@2022-11-01' = { name: networkInterfaceName location: location + tags: tags properties: { ipConfigurations: [ usePublicIp ? { name: 'ipconfigpublic' @@ -116,6 +117,7 @@ resource networkInterface 'Microsoft.Network/networkInterfaces@2022-11-01' = { resource publicIPAddress 'Microsoft.Network/publicIPAddresses@2022-11-01' = if (usePublicIp) { name: publicIPAddressName location: location + tags: tags sku: { name: 'Basic' } @@ -132,6 +134,7 @@ resource publicIPAddress 'Microsoft.Network/publicIPAddresses@2022-11-01' = if ( resource vm 'Microsoft.Compute/virtualMachines@2023-03-01' = { name: name location: location + tags: tags identity: { type: 'SystemAssigned' } @@ -184,6 +187,7 @@ resource vm 'Microsoft.Compute/virtualMachines@2023-03-01' = { resource workspacesName_extension_trusted 'Microsoft.Compute/virtualMachines/extensions@2023-03-01' = { parent: vm name: trustedExtensionName + tags: tags location: location properties: { publisher: trustedExtensionPublisher @@ -204,6 +208,7 @@ resource workspacesName_extension_trusted 'Microsoft.Compute/virtualMachines/ext resource workspacesName_extension_docker 'Microsoft.Compute/virtualMachines/extensions@2023-03-01' = { parent: vm name: dockerExtensionName + tags: tags location: location properties: { publisher: dockerExtensionPublisher diff --git a/deployments/azure/modules/network.bicep b/deployments/azure/modules/network.bicep index 52dacd7..ba961ef 100644 --- a/deployments/azure/modules/network.bicep +++ b/deployments/azure/modules/network.bicep @@ -2,10 +2,12 @@ param networkName string param networkCidr array param subnetCidr string param location string +param tags object = {} resource network 'Microsoft.Network/virtualNetworks@2022-11-01' = { name: networkName location: location + tags: tags properties: { addressSpace: { addressPrefixes: networkCidr diff --git a/deployments/azure/modules/nlb.bicep b/deployments/azure/modules/nlb.bicep index b9893a7..7533f59 100644 --- a/deployments/azure/modules/nlb.bicep +++ b/deployments/azure/modules/nlb.bicep @@ -3,9 +3,10 @@ param location string param workspacesHttpPort int = 0 param workspacesGrpcPort int = 0 param jupyterHttpPort int = 0 +param tags object = {} resource lbPublicIPAddress 'Microsoft.Network/publicIPAddresses@2021-08-01' = { - name: 'inbound' + name: '${name}-inbound' location: location sku: { name: 'Standard' @@ -14,10 +15,11 @@ resource lbPublicIPAddress 'Microsoft.Network/publicIPAddresses@2021-08-01' = { publicIPAddressVersion: 'IPv4' publicIPAllocationMethod: 'Static' } + tags: tags } resource lbPublicIPAddressOutbound 'Microsoft.Network/publicIPAddresses@2021-08-01' = { - name: 'outbound' + name: '${name}-outbound' location: location sku: { name: 'Standard' @@ -26,6 +28,7 @@ resource lbPublicIPAddressOutbound 'Microsoft.Network/publicIPAddresses@2021-08- publicIPAddressVersion: 'IPv4' publicIPAllocationMethod: 'Static' } + tags: tags } resource lb 'Microsoft.Network/loadBalancers@2021-08-01' = { @@ -177,6 +180,7 @@ resource lb 'Microsoft.Network/loadBalancers@2021-08-01' = { } ] } + tags: tags } output nlbPools array = [ '${name}InboundBackendPool', '${name}OutboundBackendPool' ] diff --git a/deployments/azure/modules/vault.bicep b/deployments/azure/modules/vault.bicep index 3fc34d7..9a5ec83 100644 --- a/deployments/azure/modules/vault.bicep +++ b/deployments/azure/modules/vault.bicep @@ -1,12 +1,14 @@ param encryptVolumes bool param keyVaultName string param location string +param tags object = {} @secure() param userClientId string resource vault 'Microsoft.KeyVault/vaults@2023-02-01' = { location: location name: keyVaultName + tags: tags properties: { sku: { family: 'A' diff --git a/deployments/azure/parameters/all-in-one.parameters.json b/deployments/azure/parameters/all-in-one.parameters.json index 3bc533d..cbb215b 100644 --- a/deployments/azure/parameters/all-in-one.parameters.json +++ b/deployments/azure/parameters/all-in-one.parameters.json @@ -75,6 +75,9 @@ }, "UseNLB": { "value": false + }, + "Tags": { + "value": {} } } } \ No newline at end of file diff --git a/deployments/azure/parameters/jupyter.parameters.json b/deployments/azure/parameters/jupyter.parameters.json index b3a1495..0f12016 100644 --- a/deployments/azure/parameters/jupyter.parameters.json +++ b/deployments/azure/parameters/jupyter.parameters.json @@ -60,6 +60,9 @@ }, "UseNLB": { "value": false + }, + "Tags": { + "value": {} } } } \ No newline at end of file diff --git a/deployments/azure/parameters/resources.json b/deployments/azure/parameters/resources.parameters.json similarity index 90% rename from deployments/azure/parameters/resources.json rename to deployments/azure/parameters/resources.parameters.json index 527a177..5dc185b 100644 --- a/deployments/azure/parameters/resources.json +++ b/deployments/azure/parameters/resources.parameters.json @@ -15,6 +15,9 @@ }, "subnetCidr": { "value": "10.0.0.0/24" + }, + "Tags": { + "value": {} } } } \ No newline at end of file diff --git a/deployments/azure/parameters/role-policy.json b/deployments/azure/parameters/role-policy.parameters.json similarity index 100% rename from deployments/azure/parameters/role-policy.json rename to deployments/azure/parameters/role-policy.parameters.json diff --git a/deployments/azure/parameters/workspaces.parameters.json b/deployments/azure/parameters/workspaces.parameters.json index 499276b..b4deb1c 100644 --- a/deployments/azure/parameters/workspaces.parameters.json +++ b/deployments/azure/parameters/workspaces.parameters.json @@ -66,6 +66,9 @@ }, "UseNLB": { "value": false + }, + "Tags": { + "value": {} } } } \ No newline at end of file diff --git a/deployments/azure/resources.json b/deployments/azure/resources.json index bb56132..65d649c 100644 --- a/deployments/azure/resources.json +++ b/deployments/azure/resources.json @@ -4,8 +4,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.23.1.45101", - "templateHash": "1606176255021497120" + "version": "0.24.24.22086", + "templateHash": "2340957522267203160" } }, "parameters": { @@ -13,7 +13,7 @@ "type": "string", "defaultValue": "workspaces", "metadata": { - "description": "name for the resource group and derived network name." + "description": "name for the resource group, role and derived network and subnet names." } }, "location": { @@ -41,6 +41,13 @@ "metadata": { "description": "New subnet CIDR." } + }, + "Tags": { + "type": "object", + "defaultValue": {}, + "metadata": { + "description": "Tags to apply to all newly created resources, in the form of {\"key_one\":\"value_one\",\"key_two\":\"value_two\"}" + } } }, "resources": [ @@ -48,7 +55,8 @@ "type": "Microsoft.Resources/resourceGroups", "apiVersion": "2022-09-01", "name": "[parameters('name')]", - "location": "[parameters('location')]" + "location": "[parameters('location')]", + "tags": "[parameters('Tags')]" }, { "type": "Microsoft.Authorization/roleDefinitions", @@ -143,6 +151,9 @@ }, "location": { "value": "[parameters('location')]" + }, + "tags": { + "value": "[parameters('Tags')]" } }, "template": { @@ -151,8 +162,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.23.1.45101", - "templateHash": "2636051152564020606" + "version": "0.24.24.22086", + "templateHash": "13399660050737531743" } }, "parameters": { @@ -167,6 +178,10 @@ }, "location": { "type": "string" + }, + "tags": { + "type": "object", + "defaultValue": {} } }, "resources": [ @@ -175,6 +190,7 @@ "apiVersion": "2022-11-01", "name": "[parameters('networkName')]", "location": "[parameters('location')]", + "tags": "[parameters('tags')]", "properties": { "addressSpace": { "addressPrefixes": "[parameters('networkCidr')]" diff --git a/deployments/azure/role-policy.json b/deployments/azure/role-policy.json new file mode 100644 index 0000000..112502c --- /dev/null +++ b/deployments/azure/role-policy.json @@ -0,0 +1,96 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.24.24.22086", + "templateHash": "15069971641571422826" + } + }, + "parameters": { + "name": { + "type": "string", + "defaultValue": "workspaces-deployment-role", + "metadata": { + "description": "name for the role to create for use with the workspaces instance." + } + } + }, + "resources": [ + { + "type": "Microsoft.Authorization/roleDefinitions", + "apiVersion": "2022-04-01", + "name": "[guid(parameters('name'), subscription().id)]", + "properties": { + "roleName": "[format('Custom Role - Workspaces {0} Regulus Deployment Permissions', parameters('name'))]", + "description": "Subscription level permissions for workspaces to create ai-unlimited deployments in there own resource groups", + "type": "customRole", + "permissions": [ + { + "actions": [ + "Microsoft.Compute/disks/read", + "Microsoft.Compute/disks/write", + "Microsoft.Compute/disks/delete", + "Microsoft.Compute/sshPublicKeys/read", + "Microsoft.Compute/sshPublicKeys/write", + "Microsoft.Compute/sshPublicKeys/delete", + "Microsoft.Compute/virtualMachines/read", + "Microsoft.Compute/virtualMachines/write", + "Microsoft.Compute/virtualMachines/delete", + "Microsoft.KeyVault/vaults/read", + "Microsoft.KeyVault/vaults/write", + "Microsoft.KeyVault/vaults/delete", + "Microsoft.KeyVault/vaults/accessPolicies/write", + "Microsoft.KeyVault/locations/operationResults/read", + "Microsoft.KeyVault/locations/deletedVaults/purge/action", + "Microsoft.ManagedIdentity/userAssignedIdentities/delete", + "Microsoft.ManagedIdentity/userAssignedIdentities/assign/action", + "Microsoft.ManagedIdentity/userAssignedIdentities/listAssociatedResources/action", + "Microsoft.ManagedIdentity/userAssignedIdentities/read", + "Microsoft.ManagedIdentity/userAssignedIdentities/write", + "Microsoft.Network/applicationSecurityGroups/read", + "Microsoft.Network/applicationSecurityGroups/write", + "Microsoft.Network/applicationSecurityGroups/joinIpConfiguration/action", + "Microsoft.Network/applicationSecurityGroups/delete", + "Microsoft.Network/virtualNetworks/read", + "Microsoft.Network/virtualNetworks/write", + "Microsoft.Network/virtualNetworks/delete", + "Microsoft.Network/virtualNetworks/subnets/read", + "Microsoft.Network/virtualNetworks/subnets/write", + "Microsoft.Network/virtualNetworks/subnets/delete", + "Microsoft.Network/virtualNetworks/subnets/join/action", + "Microsoft.Network/networkInterfaces/read", + "Microsoft.Network/networkInterfaces/write", + "Microsoft.Network/networkInterfaces/delete", + "Microsoft.Network/networkInterfaces/join/action", + "Microsoft.Network/networkSecurityGroups/read", + "Microsoft.Network/networkSecurityGroups/write", + "Microsoft.Network/networkSecurityGroups/delete", + "Microsoft.Network/networkSecurityGroups/securityRules/read", + "Microsoft.Network/networkSecurityGroups/securityRules/write", + "Microsoft.Network/networkSecurityGroups/securityRules/delete", + "Microsoft.Network/networkSecurityGroups/join/action", + "Microsoft.Network/publicIPAddresses/read", + "Microsoft.Network/publicIPAddresses/write", + "Microsoft.Network/publicIPAddresses/join/action", + "Microsoft.Network/publicIPAddresses/delete", + "Microsoft.Resources/subscriptions/resourcegroups/read", + "Microsoft.Resources/subscriptions/resourcegroups/write", + "Microsoft.Resources/subscriptions/resourcegroups/delete" + ] + } + ], + "assignableScopes": [ + "[subscription().id]" + ] + } + } + ], + "outputs": { + "RoleDefinitionId": { + "type": "string", + "value": "[guid(parameters('name'), subscription().id)]" + } + } +} \ No newline at end of file diff --git a/deployments/azure/workspaces.json b/deployments/azure/workspaces.json index 7fc93ee..88536b5 100644 --- a/deployments/azure/workspaces.json +++ b/deployments/azure/workspaces.json @@ -5,7 +5,7 @@ "_generator": { "name": "bicep", "version": "0.24.24.22086", - "templateHash": "4241018356025120269" + "templateHash": "14046707337037786478" } }, "parameters": { @@ -116,6 +116,17 @@ "description": "allow access the workspaces ssh port from the access cidr." } }, + "UseKeyVault": { + "type": "string", + "defaultValue": "New", + "allowedValues": [ + "New", + "None" + ], + "metadata": { + "description": "should we create a new Azure Key Vault for bootstrapping the AI Unlimited Engine nodes." + } + }, "UsePersistentVolume": { "type": "string", "defaultValue": "New", @@ -155,6 +166,13 @@ "metadata": { "description": "Use a Network Load Balancer to connect to the Workspace server" } + }, + "Tags": { + "type": "object", + "defaultValue": {}, + "metadata": { + "description": "Tags to apply to all newly created resources, in the form of {\"key_one\":\"value_one\",\"key_two\":\"value_two\"}" + } } }, "variables": { @@ -179,6 +197,117 @@ "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, parameters('ResourceGroupName')), 'Microsoft.Resources/deployments', 'workspaces')]" ] }, + { + "condition": "[equals(parameters('UseKeyVault'), 'New')]", + "type": "Microsoft.Resources/deployments", + "apiVersion": "2022-09-01", + "name": "vault", + "resourceGroup": "[parameters('ResourceGroupName')]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "encryptVolumes": { + "value": true + }, + "keyVaultName": { + "value": "[parameters('WorkspacesName')]" + }, + "location": { + "value": "[reference(subscriptionResourceId('Microsoft.Resources/resourceGroups', parameters('ResourceGroupName')), '2022-09-01', 'full').location]" + }, + "userClientId": { + "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, parameters('ResourceGroupName')), 'Microsoft.Resources/deployments', 'workspaces'), '2022-09-01').outputs.PrincipleId.value]" + }, + "tags": { + "value": "[parameters('Tags')]" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.24.24.22086", + "templateHash": "11274348200796028004" + } + }, + "parameters": { + "encryptVolumes": { + "type": "bool" + }, + "keyVaultName": { + "type": "string" + }, + "location": { + "type": "string" + }, + "tags": { + "type": "object", + "defaultValue": {} + }, + "userClientId": { + "type": "securestring" + } + }, + "resources": [ + { + "type": "Microsoft.KeyVault/vaults", + "apiVersion": "2023-02-01", + "name": "[parameters('keyVaultName')]", + "location": "[parameters('location')]", + "tags": "[parameters('tags')]", + "properties": { + "sku": { + "family": "A", + "name": "standard" + }, + "tenantId": "[subscription().tenantId]", + "softDeleteRetentionInDays": 7, + "enableSoftDelete": true, + "enablePurgeProtection": "[if(parameters('encryptVolumes'), true(), null())]", + "enabledForDiskEncryption": "[parameters('encryptVolumes')]", + "accessPolicies": [ + { + "tenantId": "[subscription().tenantId]", + "objectId": "[parameters('userClientId')]", + "permissions": { + "keys": "[if(parameters('encryptVolumes'), createArray('Create', 'Delete', 'Get', 'List', 'Update', 'Purge', 'Recover', 'Decrypt', 'Encrypt', 'Sign', 'UnwrapKey', 'Verify', 'WrapKey', 'GetRotationPolicy', 'SetRotationPolicy'), createArray('Get', 'List'))]", + "secrets": [ + "Get", + "Set", + "Delete", + "List", + "Purge" + ], + "storage": [ + "Get" + ] + } + } + ] + } + } + ], + "outputs": { + "id": { + "type": "string", + "value": "[resourceId('Microsoft.KeyVault/vaults', parameters('keyVaultName'))]" + }, + "name": { + "type": "string", + "value": "[parameters('keyVaultName')]" + } + } + } + }, + "dependsOn": [ + "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, parameters('ResourceGroupName')), 'Microsoft.Resources/deployments', 'workspaces')]" + ] + }, { "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", @@ -213,6 +342,9 @@ }, "detinationAppSecGroups": { "value": "[parameters('detinationAppSecGroups')]" + }, + "tags": { + "value": "[parameters('Tags')]" } }, "template": { @@ -222,7 +354,7 @@ "_generator": { "name": "bicep", "version": "0.24.24.22086", - "templateHash": "1018858806142179392" + "templateHash": "3088606472882204851" } }, "parameters": { @@ -259,6 +391,10 @@ "jupyterHttpPort": { "type": "string", "defaultValue": "None" + }, + "tags": { + "type": "object", + "defaultValue": {} } }, "resources": [ @@ -266,6 +402,7 @@ "type": "Microsoft.Network/networkSecurityGroups", "apiVersion": "2022-11-01", "name": "[parameters('name')]", + "tags": "[parameters('tags')]", "location": "[parameters('location')]" }, { @@ -473,6 +610,9 @@ }, "workspacesGrpcPort": { "value": "[int(parameters('WorkspacesGrpcPort'))]" + }, + "tags": { + "value": "[parameters('Tags')]" } }, "template": { @@ -482,7 +622,7 @@ "_generator": { "name": "bicep", "version": "0.24.24.22086", - "templateHash": "6905843737085590430" + "templateHash": "3385554541683646128" } }, "parameters": { @@ -503,13 +643,17 @@ "jupyterHttpPort": { "type": "int", "defaultValue": 0 + }, + "tags": { + "type": "object", + "defaultValue": {} } }, "resources": [ { "type": "Microsoft.Network/publicIPAddresses", "apiVersion": "2021-08-01", - "name": "inbound", + "name": "[format('{0}-inbound', parameters('name'))]", "location": "[parameters('location')]", "sku": { "name": "Standard" @@ -517,12 +661,13 @@ "properties": { "publicIPAddressVersion": "IPv4", "publicIPAllocationMethod": "Static" - } + }, + "tags": "[parameters('tags')]" }, { "type": "Microsoft.Network/publicIPAddresses", "apiVersion": "2021-08-01", - "name": "outbound", + "name": "[format('{0}-outbound', parameters('name'))]", "location": "[parameters('location')]", "sku": { "name": "Standard" @@ -530,7 +675,8 @@ "properties": { "publicIPAddressVersion": "IPv4", "publicIPAllocationMethod": "Static" - } + }, + "tags": "[parameters('tags')]" }, { "type": "Microsoft.Network/loadBalancers", @@ -546,7 +692,7 @@ "name": "[format('{0}Inbound', parameters('name'))]", "properties": { "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses', 'inbound')]" + "id": "[resourceId('Microsoft.Network/publicIPAddresses', format('{0}-inbound', parameters('name')))]" } } }, @@ -554,7 +700,7 @@ "name": "[format('{0}Outbound', parameters('name'))]", "properties": { "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses', 'outbound')]" + "id": "[resourceId('Microsoft.Network/publicIPAddresses', format('{0}-outbound', parameters('name')))]" } } } @@ -589,9 +735,10 @@ } ] }, + "tags": "[parameters('tags')]", "dependsOn": [ - "[resourceId('Microsoft.Network/publicIPAddresses', 'inbound')]", - "[resourceId('Microsoft.Network/publicIPAddresses', 'outbound')]" + "[resourceId('Microsoft.Network/publicIPAddresses', format('{0}-inbound', parameters('name')))]", + "[resourceId('Microsoft.Network/publicIPAddresses', format('{0}-outbound', parameters('name')))]" ] } ], @@ -605,7 +752,7 @@ }, "PublicIp": { "type": "string", - "value": "[reference(resourceId('Microsoft.Network/publicIPAddresses', 'inbound'), '2021-08-01').ipAddress]" + "value": "[reference(resourceId('Microsoft.Network/publicIPAddresses', format('{0}-inbound', parameters('name'))), '2021-08-01').ipAddress]" } } } @@ -665,6 +812,9 @@ "nlbPoolNames": "[if(parameters('UseNLB'), createObject('value', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, parameters('ResourceGroupName')), 'Microsoft.Resources/deployments', 'loadbalancer'), '2022-09-01').outputs.nlbPools.value), createObject('value', createArray()))]", "usePublicIp": { "value": "[not(parameters('UseNLB'))]" + }, + "tags": { + "value": "[parameters('Tags')]" } }, "template": { @@ -674,7 +824,7 @@ "_generator": { "name": "bicep", "version": "0.24.24.22086", - "templateHash": "994520545106154152" + "templateHash": "8152473424343277729" } }, "parameters": { @@ -728,6 +878,10 @@ "nlbPoolNames": { "type": "array", "defaultValue": [] + }, + "tags": { + "type": "object", + "defaultValue": {} } }, "variables": { @@ -790,6 +944,7 @@ "apiVersion": "2023-04-02", "name": "[format('{0}-disk', parameters('name'))]", "location": "[parameters('location')]", + "tags": "[parameters('tags')]", "properties": { "creationData": { "createOption": "Empty" @@ -804,6 +959,7 @@ "apiVersion": "2022-11-01", "name": "[variables('networkInterfaceName')]", "location": "[parameters('location')]", + "tags": "[parameters('tags')]", "properties": { "ipConfigurations": [ "[if(parameters('usePublicIp'), createObject('name', 'ipconfigpublic', 'properties', createObject('privateIPAllocationMethod', 'Dynamic', 'subnet', createObject('id', parameters('subnetId')), 'publicIPAddress', createObject('id', resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))), 'loadBalancerBackendAddressPools', variables('resourcePools'))), createObject('name', 'ipconfigprivate', 'properties', createObject('privateIPAllocationMethod', 'Dynamic', 'subnet', createObject('id', parameters('subnetId')), 'loadBalancerBackendAddressPools', variables('resourcePools'))))]" @@ -822,6 +978,7 @@ "apiVersion": "2022-11-01", "name": "[variables('publicIPAddressName')]", "location": "[parameters('location')]", + "tags": "[parameters('tags')]", "sku": { "name": "Basic" }, @@ -839,6 +996,7 @@ "apiVersion": "2023-03-01", "name": "[parameters('name')]", "location": "[parameters('location')]", + "tags": "[parameters('tags')]", "identity": { "type": "SystemAssigned" }, @@ -886,6 +1044,7 @@ "type": "Microsoft.Compute/virtualMachines/extensions", "apiVersion": "2023-03-01", "name": "[format('{0}/{1}', parameters('name'), variables('trustedExtensionName'))]", + "tags": "[parameters('tags')]", "location": "[parameters('location')]", "properties": { "publisher": "[variables('trustedExtensionPublisher')]", @@ -909,6 +1068,7 @@ "type": "Microsoft.Compute/virtualMachines/extensions", "apiVersion": "2023-03-01", "name": "[format('{0}/{1}', parameters('name'), variables('dockerExtensionName'))]", + "tags": "[parameters('tags')]", "location": "[parameters('location')]", "properties": { "publisher": "[variables('dockerExtensionPublisher')]",