Skip to content

Commit

Permalink
Merge branch 'Azure:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
ReneHezser authored Nov 25, 2024
2 parents d00b603 + 0639693 commit 544d25c
Show file tree
Hide file tree
Showing 6 changed files with 372 additions and 468 deletions.
9 changes: 6 additions & 3 deletions avm/res/compute/virtual-machine/extension/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.31.34.60546",
"templateHash": "1194243367873711347"
"version": "0.31.92.45157",
"templateHash": "688718350646227538"
},
"name": "Virtual Machine Extensions",
"description": "This module deploys a Virtual Machine Extension.",
Expand Down Expand Up @@ -121,7 +121,10 @@
"settings": "[if(not(empty(parameters('settings'))), parameters('settings'), null())]",
"protectedSettings": "[if(not(empty(parameters('protectedSettings'))), parameters('protectedSettings'), null())]",
"suppressFailures": "[parameters('supressFailures')]"
}
},
"dependsOn": [
"virtualMachine"
]
}
},
"outputs": {
Expand Down
17 changes: 13 additions & 4 deletions avm/res/dev-ops-infrastructure/pool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This module deploys the Managed DevOps Pool resource.
- [Usage examples](#Usage-examples)
- [Parameters](#Parameters)
- [Outputs](#Outputs)
- [Cross-referenced modules](#Cross-referenced-modules)
- [Notes](#Notes)
- [Data Collection](#Data-Collection)

Expand Down Expand Up @@ -939,7 +940,7 @@ The diagnostic settings of the service.
| [`logCategoriesAndGroups`](#parameter-diagnosticsettingslogcategoriesandgroups) | array | The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to `[]` to disable log collection. |
| [`marketplacePartnerResourceId`](#parameter-diagnosticsettingsmarketplacepartnerresourceid) | string | The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs. |
| [`metricCategories`](#parameter-diagnosticsettingsmetriccategories) | array | The name of metrics that will be streamed. "allMetrics" includes all possible metrics for the resource. Set to `[]` to disable metric collection. |
| [`name`](#parameter-diagnosticsettingsname) | string | The name of diagnostic setting. |
| [`name`](#parameter-diagnosticsettingsname) | string | The name of the diagnostic setting. |
| [`storageAccountResourceId`](#parameter-diagnosticsettingsstorageaccountresourceid) | string | Resource ID of the diagnostic storage account. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub. |
| [`workspaceResourceId`](#parameter-diagnosticsettingsworkspaceresourceid) | string | Resource ID of the diagnostic log analytics workspace. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub. |

Expand Down Expand Up @@ -1049,7 +1050,7 @@ Enable or disable the category explicitly. Default is `true`.

### Parameter: `diagnosticSettings.name`

The name of diagnostic setting.
The name of the diagnostic setting.

- Required: No
- Type: string
Expand Down Expand Up @@ -1144,7 +1145,7 @@ The managed service identities assigned to this resource.
| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`systemAssigned`](#parameter-managedidentitiessystemassigned) | bool | Enables system assigned managed identity on the resource. |
| [`userAssignedResourceIds`](#parameter-managedidentitiesuserassignedresourceids) | array | The resource ID(s) to assign to the resource. |
| [`userAssignedResourceIds`](#parameter-managedidentitiesuserassignedresourceids) | array | The resource ID(s) to assign to the resource. Required if a user assigned identity is used for encryption. |

### Parameter: `managedIdentities.systemAssigned`

Expand All @@ -1155,7 +1156,7 @@ Enables system assigned managed identity on the resource.

### Parameter: `managedIdentities.userAssignedResourceIds`

The resource ID(s) to assign to the resource.
The resource ID(s) to assign to the resource. Required if a user assigned identity is used for encryption.

- Required: No
- Type: array
Expand Down Expand Up @@ -1462,6 +1463,14 @@ Tags of the resource.
| `resourceId` | string | The resource ID of the Managed DevOps Pool. |
| `systemAssignedMIPrincipalId` | string | The principal ID of the system assigned identity. |

## Cross-referenced modules

This section gives you an overview of all local-referenced module files (i.e., other modules that are referenced in this module) and all remote-referenced files (i.e., Bicep modules that are referenced from a Bicep Registry or Template Specs).

| Reference | Type |
| :-- | :-- |
| `br/public:avm/utl/types/avm-common-types:0.3.0` | Remote reference |

## Notes

The Managed DevOps Pool resource requires external permissions in Azure DevOps. Make sure that the deployment principal has permission in Azure DevOps: [Managed DevOps Pools - Verify Azure DevOps Permissions](https://learn.microsoft.com/en-us/azure/devops/managed-devops-pools/prerequisites?view=azure-devops&tabs=azure-portal#verify-azure-devops-permissions)
Expand Down
160 changes: 39 additions & 121 deletions avm/res/dev-ops-infrastructure/pool/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ metadata name = 'Managed DevOps Pool'
metadata description = 'This module deploys the Managed DevOps Pool resource.'
metadata owner = 'Azure/module-maintainers'

// ============ //
// Parameters //
// ============ //

@description('Required. Name of the pool. It needs to be globally unique.')
param name string

Expand Down Expand Up @@ -38,7 +42,7 @@ param osProfile osProfileType = {
}

@description('Optional. The storage profile of the machines in the pool.')
param storageProfile storageProfileType
param storageProfile storageProfileType?

@description('Required. Defines the organization in which the pool will be used.')
param organizationProfile organizationProfileType
Expand All @@ -47,16 +51,19 @@ param organizationProfile organizationProfileType
param tags object?

@description('Optional. The lock settings of the service.')
param lock lockType
param lock lockType?
import { lockType } from 'br/public:avm/utl/types/avm-common-types:0.3.0'

@description('Optional. Array of role assignments to create.')
param roleAssignments roleAssignmentType
param roleAssignments roleAssignmentType[]?
import { roleAssignmentType } from 'br/public:avm/utl/types/avm-common-types:0.3.0'

@description('Optional. Enable/Disable usage telemetry for module.')
param enableTelemetry bool = true

@description('Optional. The diagnostic settings of the service.')
param diagnosticSettings diagnosticSettingType
param diagnosticSettings diagnosticSettingFullType[]?
import { diagnosticSettingFullType } from 'br/public:avm/utl/types/avm-common-types:0.3.0'

@description('Optional. The managed service identities assigned to this resource.')
@metadata({
Expand All @@ -72,7 +79,8 @@ param diagnosticSettings diagnosticSettingType
}
'''
})
param managedIdentities managedIdentitiesType
param managedIdentities managedIdentityAllType?
import { managedIdentityAllType } from 'br/public:avm/utl/types/avm-common-types:0.3.0'

var builtInRoleNames = {
Contributor: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b24988ac-6180-42a0-ab88-20f7382dd24c')
Expand Down Expand Up @@ -127,6 +135,10 @@ var formattedDaysData = !empty(agentProfile.?resourcePredictions.?daysData)
)
: null

// ============== //
// Resources //
// ============== //

#disable-next-line no-deployments-resources
resource avmTelemetry 'Microsoft.Resources/deployments@2024-03-01' = if (enableTelemetry) {
name: '46d3xbcp.res.devopsinfrastructure-pool.${replace('-..--..-', '.', '-')}.${substring(uniqueString(deployment().name, location), 0, 4)}'
Expand Down Expand Up @@ -256,6 +268,10 @@ resource managedDevOpsPool_diagnosticSettings 'Microsoft.Insights/diagnosticSett
}
]

// ============ //
// Outputs //
// ============ //

@description('The name of the Managed DevOps Pool.')
output name string = managedDevOpsPool.name

Expand All @@ -271,6 +287,10 @@ output location string = managedDevOpsPool.location
@description('The principal ID of the system assigned identity.')
output systemAssignedMIPrincipalId string? = managedDevOpsPool.?identity.?principalId

// =============== //
// Definitions //
// =============== //

@export()
type osProfileType = {
@description('Required. The logon type of the machine.')
Expand All @@ -295,20 +315,8 @@ type storageProfileType = {
osDiskStorageAccountType: ('Premium' | 'StandardSSD' | 'Standard')?

@description('Optional. A list of empty data disks to attach.')
dataDisks: {
@description('Optional. The type of caching to be enabled for the data disks. The default value for caching is readwrite. For information about the caching options see: https://blogs.msdn.microsoft.com/windowsazurestorage/2012/06/27/exploring-windows-azure-drives-disks-and-images/.')
caching: ('None' | 'ReadOnly' | 'ReadWrite')?

@description('Optional. The initial disk size in gigabytes.')
diskSizeGiB: int?

@description('Optional. The drive letter for the empty data disk. If not specified, it will be the first available letter. Letters A, C, D, and E are not allowed.')
driveLetter: string?

@description('Optional. The storage Account type to be used for the data disk. If omitted, the default is Standard_LRS.')
storageAccountType: ('Premium_LRS' | 'Premium_ZRS' | 'StandardSSD_LRS' | 'StandardSSD_ZRS' | 'Standard_LRS')?
}[]?
}?
dataDisks: dataDiskType[]?
}

@export()
type imageType = {
Expand Down Expand Up @@ -370,7 +378,7 @@ type dataDiskType = {

@description('Optional. The storage Account type to be used for the data disk. If omitted, the default is Standard_LRS.')
storageAccountType: ('Premium_LRS' | 'Premium_ZRS' | 'StandardSSD_LRS' | 'StandardSSD_ZRS' | 'Standard_LRS')?
}[]?
}

@export()
type resourcePredictionsProfileAutomaticType = {
Expand Down Expand Up @@ -404,7 +412,7 @@ type agentStatefulType = {
timeZone: string

@description('Optional. The number of agents needed at a specific time.')
daysData: daysDataType
daysData: daysDataType?
}?

@discriminator('kind')
Expand All @@ -423,7 +431,7 @@ type agentStatelessType = {
timeZone: string

@description('Optional. The number of agents needed at a specific time.')
daysData: daysDataType
daysData: daysDataType?
}?

@discriminator('kind')
Expand All @@ -435,96 +443,6 @@ type agentStatelessType = {
@export()
type agentProfileType = agentStatefulType | agentStatelessType

@export()
type roleAssignmentType = {
@description('Optional. The name (as GUID) of the role assignment. If not provided, a GUID will be generated.')
name: string?

@description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string

@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
principalId: string

@description('Optional. The principal type of the assigned principal ID.')
principalType: ('ServicePrincipal' | 'Group' | 'User' | 'ForeignGroup' | 'Device')?

@description('Optional. The description of the role assignment.')
description: string?

@description('Optional. The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase "foo_storage_container".')
condition: string?

@description('Optional. Version of the condition.')
conditionVersion: '2.0'?

@description('Optional. The Resource Id of the delegated managed identity resource.')
delegatedManagedIdentityResourceId: string?
}[]?

@export()
type lockType = {
@description('Optional. Specify the name of lock.')
name: string?

@description('Optional. Specify the type of lock.')
kind: ('CanNotDelete' | 'ReadOnly' | 'None')?
}?

@export()
type diagnosticSettingType = {
@description('Optional. The name of diagnostic setting.')
name: string?

@description('Optional. The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to `[]` to disable log collection.')
logCategoriesAndGroups: {
@description('Optional. Name of a Diagnostic Log category for a resource type this setting is applied to. Set the specific logs to collect here.')
category: string?

@description('Optional. Name of a Diagnostic Log category group for a resource type this setting is applied to. Set to `allLogs` to collect all logs.')
categoryGroup: string?

@description('Optional. Enable or disable the category explicitly. Default is `true`.')
enabled: bool?
}[]?

@description('Optional. The name of metrics that will be streamed. "allMetrics" includes all possible metrics for the resource. Set to `[]` to disable metric collection.')
metricCategories: {
@description('Required. Name of a Diagnostic Metric category for a resource type this setting is applied to. Set to `AllMetrics` to collect all metrics.')
category: string

@description('Optional. Enable or disable the category explicitly. Default is `true`.')
enabled: bool?
}[]?

@description('Optional. A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, or use a destination type.')
logAnalyticsDestinationType: ('Dedicated' | 'AzureDiagnostics')?

@description('Optional. Resource ID of the diagnostic log analytics workspace. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub.')
workspaceResourceId: string?

@description('Optional. Resource ID of the diagnostic storage account. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub.')
storageAccountResourceId: string?

@description('Optional. Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to.')
eventHubAuthorizationRuleResourceId: string?

@description('Optional. Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub.')
eventHubName: string?

@description('Optional. The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs.')
marketplacePartnerResourceId: string?
}[]?

@export()
type managedIdentitiesType = {
@description('Optional. Enables system assigned managed identity on the resource.')
systemAssigned: bool?

@description('Optional. The resource ID(s) to assign to the resource.')
userAssignedResourceIds: string[]?
}?

@export()
type standbyAgentsConfigType = {
@description('Required. The time at which the agents are needed.')
Expand All @@ -538,28 +456,28 @@ type standbyAgentsConfigType = {

@description('Required. The number of agents needed at the end time.')
endAgentCount: int
}?
}

@export()
type daysDataType = {
@description('Optional. The number of agents needed at a specific time for Monday.')
monday: standbyAgentsConfigType
monday: standbyAgentsConfigType?

@description('Optional. The number of agents needed at a specific time for Tuesday.')
tuesday: standbyAgentsConfigType
tuesday: standbyAgentsConfigType?

@description('Optional. The number of agents needed at a specific time for Wednesday.')
wednesday: standbyAgentsConfigType
wednesday: standbyAgentsConfigType?

@description('Optional. The number of agents needed at a specific time for Thursday.')
thursday: standbyAgentsConfigType
thursday: standbyAgentsConfigType?

@description('Optional. The number of agents needed at a specific time for Friday.')
friday: standbyAgentsConfigType
friday: standbyAgentsConfigType?

@description('Optional. The number of agents needed at a specific time for Saturday.')
saturday: standbyAgentsConfigType
saturday: standbyAgentsConfigType?

@description('Optional. The number of agents needed at a specific time for Sunday.')
sunday: standbyAgentsConfigType
}?
sunday: standbyAgentsConfigType?
}
Loading

0 comments on commit 544d25c

Please sign in to comment.