Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/ms.compute.availabilitysets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ jobs:
- name: 'Using test file [${{ matrix.moduleTestFilePaths }}]'
uses: ./.github/actions/templates/validateModuleDeployment
with:
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
parameterFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}'
templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}'
location: '${{ env.location }}'
resourceGroupName: '${{ env.resourceGroupName }}'
subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@description('Optional. The location to deploy resources to.')
param location string = resourceGroup().location

@description('Required. The name of the Managed Identity to create.')
param managedIdentityName string

@description('Required. The name of the Proximity Placement Group to create.')
param proximityPlacementGroupName string

resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = {
name: managedIdentityName
location: location
}

resource proximityPlacementGroup 'Microsoft.Compute/proximityPlacementGroups@2022-03-01' = {
name: proximityPlacementGroupName
location: location
}

@description('The principal ID of the created Managed Identity.')
output managedIdentityPrincipalId string = managedIdentity.properties.principalId

@description('The resource ID of the created Proximity Placement Group.')
output proximityPlacementGroupResourceId string = proximityPlacementGroup.id
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
targetScope = 'subscription'

// ========== //
// Parameters //
// ========== //
@description('Optional. The name of the resource group to deploy for testing purposes.')
@maxLength(90)
param resourceGroupName string = 'ms.compute.availabilitysets-${serviceShort}-rg'

@description('Optional. The location to deploy resources to.')
param location string = deployment().location

@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.')
param serviceShort string = 'cascom'

// =========== //
// Deployments //
// =========== //

// General resources
// =================
resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
name: resourceGroupName
location: location
}

module resourceGroupResources 'dependencies.bicep' = {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-paramNested'
params: {
managedIdentityName: 'dep-<<namePrefix>>-msi-${serviceShort}'
proximityPlacementGroupName: 'dep-<<namePrefix>>-ppg-${serviceShort}'
}
}

// ============== //
// Test Execution //
// ============== //

module testDeployment '../../deploy.bicep' = {
scope: resourceGroup
name: '${uniqueString(deployment().name)}-test-${serviceShort}'
params: {
name: '<<namePrefix>>${serviceShort}001'
lock: 'CanNotDelete'
proximityPlacementGroupId: resourceGroupResources.outputs.proximityPlacementGroupResourceId
roleAssignments: [
{
principalIds: [
resourceGroupResources.outputs.managedIdentityPrincipalId
]
roleDefinitionIdOrName: 'Reader'
}
]
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
targetScope = 'subscription'

// ========== //
// Parameters //
// ========== //
@description('Optional. The name of the resource group to deploy for testing purposes.')
@maxLength(90)
param resourceGroupName string = 'ms.compute.availabilitysets-${serviceShort}-rg'

@description('Optional. The location to deploy resources to.')
param location string = deployment().location

@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.')
param serviceShort string = 'casmin'

// =========== //
// Deployments //
// =========== //

// General resources
// =================
resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
name: resourceGroupName
location: location
}

// ============== //
// Test Execution //
// ============== //

module testDeployment '../../deploy.bicep' = {
scope: resourceGroup
name: '${uniqueString(deployment().name)}-test-${serviceShort}'
params: {
name: '<<namePrefix>>${serviceShort}001'
}
}

This file was deleted.

76 changes: 38 additions & 38 deletions modules/Microsoft.Compute/availabilitySets/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,29 @@ The following module usage examples are retrieved from the content of the files

>**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order.

<h3>Example 1: Min</h3>
<h3>Example 1: Common</h3>

<details>

<summary>via Bicep module</summary>

```bicep
module availabilitySets './Microsoft.Compute/availabilitySets/deploy.bicep' = {
name: '${uniqueString(deployment().name)}-AvailabilitySets'
name: '${uniqueString(deployment().name)}-test-cascom'
params: {
name: '<<namePrefix>>-az-avs-min-001'
// Required parameters
name: '<<namePrefix>>cascom001'
// Non-required parameters
lock: 'CanNotDelete'
proximityPlacementGroupId: '<proximityPlacementGroupId>'
roleAssignments: [
{
principalIds: [
'<managedIdentityPrincipalId>'
]
roleDefinitionIdOrName: 'Reader'
}
]
}
}
```
Expand All @@ -186,8 +198,26 @@ module availabilitySets './Microsoft.Compute/availabilitySets/deploy.bicep' = {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
// Required parameters
"name": {
"value": "<<namePrefix>>-az-avs-min-001"
"value": "<<namePrefix>>cascom001"
},
// Non-required parameters
"lock": {
"value": "CanNotDelete"
},
"proximityPlacementGroupId": {
"value": "<proximityPlacementGroupId>"
},
"roleAssignments": {
"value": [
{
"principalIds": [
"<managedIdentityPrincipalId>"
],
"roleDefinitionIdOrName": "Reader"
}
]
}
}
}
Expand All @@ -196,29 +226,17 @@ module availabilitySets './Microsoft.Compute/availabilitySets/deploy.bicep' = {
</details>
<p>

<h3>Example 2: Parameters</h3>
<h3>Example 2: Min</h3>

<details>

<summary>via Bicep module</summary>

```bicep
module availabilitySets './Microsoft.Compute/availabilitySets/deploy.bicep' = {
name: '${uniqueString(deployment().name)}-AvailabilitySets'
name: '${uniqueString(deployment().name)}-test-casmin'
params: {
// Required parameters
name: '<<namePrefix>>-az-avs-x-001'
// Non-required parameters
lock: 'CanNotDelete'
proximityPlacementGroupId: '/subscriptions/<<subscriptionId>>/resourceGroups/validation-rg/providers/Microsoft.Compute/proximityPlacementGroups/adp-<<namePrefix>>-az-ppg-x-001'
roleAssignments: [
{
principalIds: [
'<<deploymentSpId>>'
]
roleDefinitionIdOrName: 'Reader'
}
]
name: '<<namePrefix>>casmin001'
}
}
```
Expand All @@ -235,26 +253,8 @@ module availabilitySets './Microsoft.Compute/availabilitySets/deploy.bicep' = {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
// Required parameters
"name": {
"value": "<<namePrefix>>-az-avs-x-001"
},
// Non-required parameters
"lock": {
"value": "CanNotDelete"
},
"proximityPlacementGroupId": {
"value": "/subscriptions/<<subscriptionId>>/resourceGroups/validation-rg/providers/Microsoft.Compute/proximityPlacementGroups/adp-<<namePrefix>>-az-ppg-x-001"
},
"roleAssignments": {
"value": [
{
"principalIds": [
"<<deploymentSpId>>"
],
"roleDefinitionIdOrName": "Reader"
}
]
"value": "<<namePrefix>>casmin001"
}
}
}
Expand Down