Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
41adc25
Add Relay Support
jeremytbrun Jun 2, 2023
187c70b
Update modules/relay/namespaces/.test/common/main.test.bicep
jeremytbrun Jun 20, 2023
6061a1b
Update modules/relay/namespaces/.test/min/main.test.bicep
jeremytbrun Jun 20, 2023
71ad159
Update modules/relay/namespaces/README.md
jeremytbrun Jun 20, 2023
c86ab04
Update modules/relay/namespaces/authorization-rules/README.md
jeremytbrun Jun 20, 2023
299fda3
Update modules/relay/namespaces/authorization-rules/metadata.json
jeremytbrun Jun 20, 2023
ed59934
Update modules/relay/namespaces/hybrid-connections/README.md
jeremytbrun Jun 20, 2023
1a1e051
Update modules/web/sites/slots/hybrid-connection-namespaces/relays/me…
jeremytbrun Jun 20, 2023
de76a90
Update modules/web/sites/slots/hybrid-connection-namespaces/relays/me…
jeremytbrun Jun 20, 2023
58df166
Update modules/web/sites/slots/main.bicep
jeremytbrun Jun 20, 2023
b5e582d
Update modules/web/sites/main.bicep
jeremytbrun Jun 20, 2023
d92add0
Update modules/relay/namespaces/.test/pe/main.test.bicep
jeremytbrun Jun 20, 2023
243596e
Update modules/relay/namespaces/hybrid-connections/authorization-rule…
jeremytbrun Jun 20, 2023
acca845
Update modules/relay/namespaces/hybrid-connections/authorization-rule…
jeremytbrun Jun 20, 2023
600721a
Update modules/relay/namespaces/hybrid-connections/authorization-rule…
jeremytbrun Jun 20, 2023
54016fd
Update modules/relay/namespaces/hybrid-connections/authorization-rule…
jeremytbrun Jun 20, 2023
164d63f
Update modules/relay/namespaces/hybrid-connections/main.bicep
jeremytbrun Jun 20, 2023
35d6f04
Update modules/relay/namespaces/hybrid-connections/main.bicep
jeremytbrun Jun 20, 2023
3c6e25d
Update modules/relay/namespaces/hybrid-connections/main.bicep
jeremytbrun Jun 20, 2023
05bc249
Update modules/relay/namespaces/hybrid-connections/main.bicep
jeremytbrun Jun 20, 2023
62dd71d
Update modules/relay/namespaces/hybrid-connections/metadata.json
jeremytbrun Jun 20, 2023
bf88c3f
Update modules/relay/namespaces/hybrid-connections/metadata.json
jeremytbrun Jun 20, 2023
c69963d
Update modules/relay/namespaces/main.bicep
jeremytbrun Jun 20, 2023
9eec142
Update modules/relay/namespaces/main.bicep
jeremytbrun Jun 20, 2023
c9a14da
Update modules/relay/namespaces/main.bicep
jeremytbrun Jun 20, 2023
ef52f7f
Update modules/relay/namespaces/main.bicep
jeremytbrun Jun 20, 2023
4de1712
Update modules/relay/namespaces/metadata.json
jeremytbrun Jun 20, 2023
3185a49
Update modules/relay/namespaces/network-rule-sets/README.md
jeremytbrun Jun 20, 2023
04fbdfb
Update modules/relay/namespaces/network-rule-sets/metadata.json
jeremytbrun Jun 20, 2023
a46dc9c
Update modules/relay/namespaces/network-rule-sets/metadata.json
jeremytbrun Jun 20, 2023
0cfb96c
Update modules/relay/namespaces/wcf-relays/README.md
jeremytbrun Jun 20, 2023
40bfd2c
Update modules/relay/namespaces/wcf-relays/authorization-rules/README.md
jeremytbrun Jun 20, 2023
5bf7526
Update modules/relay/namespaces/wcf-relays/authorization-rules/main.b…
jeremytbrun Jun 20, 2023
08cb478
Update modules/relay/namespaces/wcf-relays/authorization-rules/metada…
jeremytbrun Jun 20, 2023
4a38c31
Update modules/relay/namespaces/wcf-relays/main.bicep
jeremytbrun Jun 20, 2023
572dc8a
Update modules/relay/namespaces/hybrid-connections/main.bicep
jeremytbrun Jun 20, 2023
7cfe2d7
Update modules/web/sites/hybrid-connection-namespaces/relays/README.md
jeremytbrun Jun 20, 2023
0193b33
Update modules/web/sites/hybrid-connection-namespaces/relays/main.bicep
jeremytbrun Jun 20, 2023
ea53a62
Update modules/web/sites/hybrid-connection-namespaces/relays/main.bicep
jeremytbrun Jun 20, 2023
2087f62
resolving comments
jeremytbrun Jun 20, 2023
8f666dc
Merge branch '3033-Add-Relay-Support' of https://github.com/jeremytbr…
jeremytbrun Jun 20, 2023
706188d
Update modules/web/sites/hybrid-connection-namespaces/relays/main.bicep
jeremytbrun Jun 20, 2023
4df12d6
Update modules/web/sites/hybrid-connection-namespaces/relays/main.bicep
jeremytbrun Jun 20, 2023
52bcfe2
updated resource hierarchy
jeremytbrun Jun 20, 2023
e7f51f4
Merge branch '3033-Add-Relay-Support' of https://github.com/jeremytbr…
jeremytbrun Jun 20, 2023
e36f3f2
additional resource hiararchy ref changes
jeremytbrun Jun 20, 2023
7e56fa6
Update modules/web/sites/hybrid-connection-namespaces/relays/metadata…
jeremytbrun Jun 20, 2023
40df9f0
Update modules/web/sites/slots/main.bicep
jeremytbrun Jun 20, 2023
5280e5d
Update modules/web/sites/main.bicep
jeremytbrun Jun 20, 2023
0cd9866
Update modules/web/sites/slots/hybrid-connection-namespaces/relays/ma…
jeremytbrun Jun 20, 2023
9abe5c7
Update modules/web/sites/slots/hybrid-connection-namespaces/relays/ma…
jeremytbrun Jun 20, 2023
9d8db7e
Update modules/web/sites/slots/hybrid-connection-namespaces/relays/ma…
jeremytbrun Jun 20, 2023
ed9c6a5
fix resource hierarchy
jeremytbrun Jun 20, 2023
ebb4165
Merge branch '3033-Add-Relay-Support' of https://github.com/jeremytbr…
jeremytbrun Jun 20, 2023
c6389ff
update param name
jeremytbrun Jun 20, 2023
22f35b0
fixed diag logs allowed
jeremytbrun Jun 20, 2023
d3dc28a
Update modules/relay/namespaces/wcf-relays/metadata.json
jeremytbrun Jun 21, 2023
68984dd
Update modules/relay/namespaces/wcf-relays/metadata.json
jeremytbrun Jun 21, 2023
347b1f0
Update modules/web/sites/.test/webAppCommon/dependencies.bicep
jeremytbrun Jun 21, 2023
67c0437
Update modules/web/sites/slots/config--appsettings/main.bicep
jeremytbrun Jun 21, 2023
d618dbd
Update modules/web/sites/.test/webAppCommon/dependencies.bicep
jeremytbrun Jun 21, 2023
c14ecbc
Update modules/web/sites/.test/webAppCommon/main.test.bicep
jeremytbrun Jun 21, 2023
9730a7e
Update modules/web/sites/config--appsettings/main.bicep
jeremytbrun Jun 21, 2023
4d70bd6
Update modules/web/sites/slots/hybrid-connection-namespaces/relays/ma…
jeremytbrun Jun 21, 2023
961c097
cleanup and add outputs
jeremytbrun Jun 21, 2023
cc51889
Merge branch '3033-Add-Relay-Support' of https://github.com/jeremytbr…
jeremytbrun Jun 21, 2023
4a5a87e
further cleanup
jeremytbrun Jun 21, 2023
138f826
standardize param usage
jeremytbrun Jun 21, 2023
48eba1b
updates to sites readme
jeremytbrun Jun 21, 2023
c21330d
updates to relay readmes
jeremytbrun Jun 21, 2023
fe2b8c4
Merge branch 'main' into 3033-Add-Relay-Support
jeremytbrun Jun 23, 2023
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
51 changes: 51 additions & 0 deletions .azuredevops/modulePipelines/ms.relay.namespaces.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: 'Relay - Namespaces'

parameters:
- name: staticValidation
displayName: Execute static validation
type: boolean
default: true
- name: deploymentValidation
displayName: Execute deployment validation
type: boolean
default: true
- name: removeDeployment
displayName: Remove deployed module
type: boolean
default: true
- name: prerelease
displayName: Publish prerelease module
type: boolean
default: false

pr: none

trigger:
batch: true
branches:
include:
- main
paths:
include:
- '/modules/relay/namespaces/*'
- '/modules/network/private-endpoints/*'
- '/.azuredevops/modulePipelines/ms.relay.namespaces.yml'
- '/.azuredevops/pipelineTemplates/*.yml'
- '/utilities/pipelines/*'
exclude:
- '/utilities/pipelines/deploymentRemoval/*'
- '/**/*.md'

variables:
- template: '../../settings.yml'
- group: 'PLATFORM_VARIABLES'
- name: modulePath
value: '/modules/relay/namespaces'

stages:
- template: /.azuredevops/pipelineTemplates/stages.module.yml
parameters:
staticValidation: '${{ parameters.staticValidation }}'
deploymentValidation: '${{ parameters.deploymentValidation }}'
removeDeployment: '${{ parameters.removeDeployment }}'
prerelease: '${{ parameters.prerelease }}'
85 changes: 85 additions & 0 deletions .github/workflows/ms.relay.namespaces.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: 'Relay - Namespaces'

on:
workflow_dispatch:
inputs:
staticValidation:
type: boolean
description: 'Execute static validation'
required: false
default: true
deploymentValidation:
type: boolean
description: 'Execute deployment validation'
required: false
default: true
removeDeployment:
type: boolean
description: 'Remove deployed module'
required: false
default: true
prerelease:
type: boolean
description: 'Publish prerelease module'
required: false
default: false
push:
branches:
- main
paths:
- 'modules/relay/namespaces/**'
- 'modules/network/private-endpoints/**'
- '.github/actions/templates/**'
- '.github/workflows/template.module.yml'
- '.github/workflows/ms.relay.namespaces.yml'
- 'utilities/pipelines/**'
- '!utilities/pipelines/deploymentRemoval/**'
- '!*/**/README.md'

env:
modulePath: 'modules/relay/namespaces'
workflowPath: '.github/workflows/ms.relay.namespaces.yml'

concurrency:
group: ${{ github.workflow }}

jobs:
###########################
# Initialize pipeline #
###########################
job_initialize_pipeline:
runs-on: ubuntu-20.04
name: 'Initialize pipeline'
steps:
- name: 'Checkout'
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: 'Set input parameters to output variables'
id: get-workflow-param
uses: ./.github/actions/templates/getWorkflowInput
with:
workflowPath: '${{ env.workflowPath}}'
- name: 'Get parameter file paths'
id: get-module-test-file-paths
uses: ./.github/actions/templates/getModuleTestFiles
with:
modulePath: '${{ env.modulePath }}'
outputs:
workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }}
moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }}
modulePath: '${{ env.modulePath }}'

##############################
# Call reusable workflow #
##############################
call-workflow-passing-data:
name: 'Module'
needs:
- job_initialize_pipeline
uses: ./.github/workflows/template.module.yml
with:
workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}'
moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}'
modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}'
secrets: inherit
72 changes: 72 additions & 0 deletions modules/relay/namespaces/.bicep/nested_roleAssignments.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
@sys.description('Required. The IDs of the principals to assign the role to.')
param principalIds array

@sys.description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
param roleDefinitionIdOrName string

@sys.description('Required. The resource ID of the resource to apply the role assignment to.')
param resourceId string

@sys.description('Optional. The principal type of the assigned principal ID.')
@allowed([
'ServicePrincipal'
'Group'
'User'
'ForeignGroup'
'Device'
''
])
param principalType string = ''

@sys.description('Optional. The description of the role assignment.')
param description string = ''

@sys.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".')
param condition string = ''

@sys.description('Optional. Version of the condition.')
@allowed([
'2.0'
])
param conditionVersion string = '2.0'

@sys.description('Optional. Id of the delegated managed identity resource.')
param delegatedManagedIdentityResourceId string = ''

var builtInRoleNames = {
'App Compliance Automation Administrator': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '0f37683f-2463-46b6-9ce7-9b788b988ba2')
'Azure Relay Listener': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '26e0b698-aa6d-4085-9386-aadae190014d')
'Azure Relay Owner': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '2787bf04-f1f5-4bfe-8383-c8a24483ee38')
'Azure Relay Sender': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '26baccc8-eea7-41f1-98f4-1762cc7f685d')
Contributor: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b24988ac-6180-42a0-ab88-20f7382dd24c')
'Log Analytics Contributor': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '92aaf0da-9dab-42b6-94a3-d43ce8d16293')
'Log Analytics Reader': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '73c42c96-874c-492b-b04d-ab87d138a893')
'Managed Application Contributor Role': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '641177b8-a67a-45b9-a033-47bc880bb21e')
'Managed Application Operator Role': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'c7393b34-138c-406f-901b-d8cf2b17e6ae')
'Managed Applications Reader': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b9331d33-8a36-4f8c-b097-4f54124fdb44')
'Monitoring Contributor': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '749f88d5-cbae-40b8-bcfc-e573ddc772fa')
'Monitoring Reader': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '43d0d8ad-25c7-4714-9337-8ba259a9fe05')
Owner: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '8e3af657-a8ff-443c-a75c-2fe8c4bcb635')
Reader: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
'Resource Policy Contributor': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '36243c78-bf99-498c-9df9-86d9f8d28608')
'Role Based Access Control Administrator (Preview)': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'f58310d9-a9f6-439a-9e8d-f62e7b41a168')
'User Access Administrator': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '18d7d88d-d35e-4fb5-a5c3-7773c20a72d9')
}

resource namespace 'Microsoft.Relay/namespaces@2021-11-01' existing = {
name: last(split(resourceId, '/'))!
}

resource roleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for principalId in principalIds: {
name: guid(namespace.id, principalId, roleDefinitionIdOrName)
properties: {
description: description
roleDefinitionId: contains(builtInRoleNames, roleDefinitionIdOrName) ? builtInRoleNames[roleDefinitionIdOrName] : roleDefinitionIdOrName
principalId: principalId
principalType: !empty(principalType) ? any(principalType) : null
condition: !empty(condition) ? condition : null
conditionVersion: !empty(conditionVersion) && !empty(condition) ? conditionVersion : null
delegatedManagedIdentityResourceId: !empty(delegatedManagedIdentityResourceId) ? delegatedManagedIdentityResourceId : null
}
scope: namespace
}]
60 changes: 60 additions & 0 deletions modules/relay/namespaces/.test/common/dependencies.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
@description('Optional. The location to deploy resources to.')
param location string = resourceGroup().location

@description('Required. The name of the Virtual Network to create.')
param virtualNetworkName string

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

var addressPrefix = '10.0.0.0/16'

resource virtualNetwork 'Microsoft.Network/virtualNetworks@2022-01-01' = {
name: virtualNetworkName
location: location
properties: {
addressSpace: {
addressPrefixes: [
addressPrefix
]
}
subnets: [
{
name: 'defaultSubnet'
properties: {
addressPrefix: addressPrefix
}
}
]
}
}

resource privateDNSZone 'Microsoft.Network/privateDnsZones@2020-06-01' = {
name: 'privatelink.servicebus.windows.net'
location: 'global'

resource virtualNetworkLinks 'virtualNetworkLinks@2020-06-01' = {
name: '${virtualNetwork.name}-vnetlink'
location: 'global'
properties: {
virtualNetwork: {
id: virtualNetwork.id
}
registrationEnabled: false
}
}
}

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

@description('The resource ID of the created Virtual Network Subnet.')
output subnetResourceId string = virtualNetwork.properties.subnets[0].id

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

@description('The resource ID of the created Private DNS Zone.')
output privateDNSZoneResourceId string = privateDNSZone.id
Loading