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.web.connections.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,14 @@
@description('Optional. The location to deploy to.')
param location string = resourceGroup().location

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

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

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

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

// ========== //
// Parameters //
// ========== //
@description('Optional. The name of the resource group to deploy for testing purposes.')
@maxLength(90)
param resourceGroupName string = 'ms.web.connections-${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 = 'wccom'

// =========== //
// 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}'
}
}

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

module testDeployment '../../deploy.bicep' = {
scope: resourceGroup
name: '${uniqueString(deployment().name)}-test-${serviceShort}'
params: {
displayName: 'azuremonitorlogs'
name: 'azuremonitor'
connectionApi: {
id: '/subscriptions/<<subscriptionId>>/providers/Microsoft.Web/locations/westeurope/managedApis/azuremonitorlogs'
}
lock: 'CanNotDelete'
roleAssignments: [
{
principalIds: [
resourceGroupResources.outputs.managedIdentityPrincipalId
]
roleDefinitionIdOrName: 'Reader'
}
]
}
}
30 changes: 0 additions & 30 deletions modules/Microsoft.Web/connections/.test/parameters.json

This file was deleted.

8 changes: 4 additions & 4 deletions modules/Microsoft.Web/connections/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@ 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: Parameters</h3>
<h3>Example 1: Common</h3>

<details>

<summary>via Bicep module</summary>

```bicep
module connections './Microsoft.Web/connections/deploy.bicep' = {
name: '${uniqueString(deployment().name)}-Connections'
name: '${uniqueString(deployment().name)}-test-wccom'
params: {
// Required parameters
displayName: 'azuremonitorlogs'
Expand All @@ -186,7 +186,7 @@ module connections './Microsoft.Web/connections/deploy.bicep' = {
roleAssignments: [
{
principalIds: [
'<<deploymentSpId>>'
'<managedIdentityPrincipalId>'
]
roleDefinitionIdOrName: 'Reader'
}
Expand Down Expand Up @@ -227,7 +227,7 @@ module connections './Microsoft.Web/connections/deploy.bicep' = {
"value": [
{
"principalIds": [
"<<deploymentSpId>>"
"<managedIdentityPrincipalId>"
],
"roleDefinitionIdOrName": "Reader"
}
Expand Down