Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e090753
Added support for Synapse Private Link Hubs
renepajta Jan 3, 2022
b28e949
Fixed typo in Github workflow
renepajta Jan 3, 2022
9ceb44f
Create new workflow for deploying Synapse Private Link Hub
renepajta Jan 4, 2022
33153b8
Added support for Locks, RBAC and Private Endpoints
renepajta Jan 4, 2022
91e836a
Updated ReadMe file
renepajta Jan 4, 2022
397a443
Fixed outputs & updated ReadMe
renepajta Jan 4, 2022
e6f02c3
Merge pull request #1 from DataStoics/users/repajta/852_synapse_template
renepajta Jan 4, 2022
2cc98e8
Switched back to main branch
renepajta Jan 4, 2022
671f0cd
Update arm/Microsoft.Synapse/privateLinkHubs/.bicep/nested_rbac.bicep
renepajta Jan 4, 2022
84f66c3
Update arm/Microsoft.Synapse/privateLinkHubs/.bicep/nested_rbac.bicep
renepajta Jan 4, 2022
9577641
Update arm/Microsoft.Synapse/privateLinkHubs/deploy.bicep
renepajta Jan 4, 2022
db2c4f3
Update arm/Microsoft.Synapse/privateLinkHubs/deploy.bicep
renepajta Jan 4, 2022
c2338ef
Update arm/Microsoft.Synapse/privateLinkHubs/deploy.bicep
renepajta Jan 4, 2022
3b3f449
Update arm/Microsoft.Synapse/privateLinkHubs/deploy.bicep
renepajta Jan 4, 2022
fe2c8b2
Update arm/Microsoft.Synapse/privateLinkHubs/deploy.bicep
renepajta Jan 4, 2022
e4eee89
Update arm/Microsoft.Synapse/privateLinkHubs/deploy.bicep
renepajta Jan 4, 2022
a53fe3a
Update arm/Microsoft.Synapse/privateLinkHubs/deploy.bicep
renepajta Jan 4, 2022
9f1df97
Update arm/Microsoft.Synapse/privateLinkHubs/readme.md
renepajta Jan 4, 2022
bbb8aac
Update arm/Microsoft.Synapse/privateLinkHubs/deploy.bicep
renepajta Jan 4, 2022
7ba75c6
Update arm/Microsoft.Synapse/privateLinkHubs/deploy.bicep
renepajta Jan 4, 2022
7ef7850
Update arm/Microsoft.Synapse/privateLinkHubs/readme.md
renepajta Jan 4, 2022
4a55a60
Update arm/Microsoft.Synapse/privateLinkHubs/readme.md
renepajta Jan 4, 2022
5a104b9
Update arm/Microsoft.Synapse/privateLinkHubs/readme.md
renepajta Jan 4, 2022
5ed3496
Fixed naming, added ADO pipeline, updated README
renepajta Jan 4, 2022
1688fe1
Removed TODOs in ReadMe
renepajta Jan 4, 2022
b6487be
Reversed changes in auto-generated Readme to avoid conflicts
renepajta Jan 4, 2022
99ad149
Remove lock settings from parameter file
renepajta Jan 4, 2022
a060ddf
Updated based on comments
renepajta Jan 4, 2022
8e316f9
Updated readme.md
renepajta Jan 4, 2022
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
63 changes: 63 additions & 0 deletions .azuredevops/modulePipelines/ms.synapse.privatelinkhubs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: 'Synapse - PrivateLinkHubs'

parameters:
- name: removeDeployment
displayName: Remove deployed module
type: boolean
default: true
- name: versioningOption
displayName: The mode to handle the version increments [major|minor|patch]
type: string
default: patch
values:
- patch
- minor
- major
- name: customVersion
displayName: Custom version to apply. Used only if higher than latest
type: string
default: '0.0.1'

trigger:
batch: true
branches:
include:
- main
paths:
include:
- '/.azuredevops/modulePipelines/ms.synapse.privatelinkhubs.yml'
- '/.azuredevops/pipelineTemplates/module.*.yml'
- '/arm/Microsoft.Synapse/privateLinkHubs/*'
exclude:
- '/**/*.md'

variables:
- template: '/.azuredevops/pipelineVariables/global.variables.yml'
- group: 'PLATFORM_VARIABLES'
- name: modulePath
value: '/arm/Microsoft.Synapse/privateLinkHubs'

stages:
- stage: Validation
displayName: Pester tests
jobs:
- template: /.azuredevops/pipelineTemplates/module.jobs.validate.yml

- stage: Deployment
displayName: Deployment tests
jobs:
- template: /.azuredevops/pipelineTemplates/module.jobs.deploy.yml
parameters:
removeDeployment: '${{ parameters.removeDeployment }}'
deploymentBlocks:
- path: $(modulePath)/.parameters/min.parameters.json
- path: $(modulePath)/.parameters/parameters.json

- stage: Publishing
displayName: Publish module
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
jobs:
- template: /.azuredevops/pipelineTemplates/module.jobs.publish.yml
parameters:
versioningOption: '${{ parameters.versioningOption }}'
customVersion: '${{ parameters.customVersion }}'
146 changes: 146 additions & 0 deletions .github/workflows/ms.synapse.privatelinkhubs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
name: 'Synapse: PrivateLinkHubs'

on:
workflow_dispatch:
inputs:
removeDeployment:
type: boolean
description: 'Remove deployed module'
required: false
default: 'true'
versioningOption:
type: choice
description: 'The mode to handle the version increments [major|minor|patch]'
required: false
default: 'patch'
options:
- major
- minor
- patch
customVersion:
description: 'Custom version to apply. Used only if higher than latest'
required: false
default: '0.0.1'
push:
branches:
- main
paths:
- '.github/actions/templates/**'
- '.github/workflows/ms.synapse.privatelinkhubs.yml'
- 'arm/Microsoft.Synapse/privateLinkHubs/**'
- '!*/**/readme.md'
- 'utilities/pipelines/**'
- '!utilities/pipelines/dependencies/**'

env:
modulePath: 'arm/Microsoft.Synapse/privateLinkHubs'
workflowPath: '.github/workflows/ms.synapse.privatelinkhubs.yml'
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}'
ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}'
ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}'
DEPLOYMENT_SP_ID: '${{ secrets.DEPLOYMENT_SP_ID }}'

jobs:
############################
# SET INPUT PARAMETERS #
############################
job_set_workflow_param:
runs-on: ubuntu-20.04
name: 'Set input parameters to output variables'
steps:
- name: 'Checkout'
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: 'Set input parameters'
id: get-workflow-param
uses: ./.github/actions/templates/getWorkflowInput
with:
workflowPath: '${{ env.workflowPath}}'
outputs:
removeDeployment: ${{ steps.get-workflow-param.outputs.removeDeployment }}
versioningOption: ${{ steps.get-workflow-param.outputs.versioningOption }}
customVersion: ${{ steps.get-workflow-param.outputs.customVersion }}

####################
# Pester Tests #
####################
job_module_pester_validation:
runs-on: ubuntu-20.04
name: 'Pester tests'
steps:
- name: 'Checkout'
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: 'Run tests'
uses: ./.github/actions/templates/validateModulePester
with:
modulePath: '${{ env.modulePath }}'

####################
# Deployment tests #
####################
job_module_deploy_validation:
runs-on: ubuntu-20.04
name: 'Deployment tests'
needs:
- job_set_workflow_param
- job_module_pester_validation
strategy:
fail-fast: false
matrix:
parameterFilePaths: ['min.parameters.json', 'parameters.json']
steps:
- name: 'Checkout'
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set environment variables
uses: deep-mm/set-variables@v1.0
with:
variableFileName: 'global.variables'
- name: 'Using parameter file [${{ matrix.parameterFilePaths }}]'
uses: ./.github/actions/templates/validateModuleDeployment
with:
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
parameterFilePath: '${{ env.modulePath }}/.parameters/${{ matrix.parameterFilePaths }}'
location: '${{ env.defaultLocation }}'
resourceGroupName: '${{ env.resourceGroupName }}'
subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}'
managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}'
removeDeployment: '${{ needs.job_set_workflow_param.outputs.removeDeployment }}'

###############
# PUBLISH #
###############
job_publish_module:
name: 'Publish module'
if: contains(fromJson('["refs/heads/main", "refs/heads/master"]'), github.ref)
runs-on: ubuntu-20.04
needs:
- job_set_workflow_param
- job_module_deploy_validation
steps:
- name: 'Checkout'
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set environment variables
uses: deep-mm/set-variables@v1.0
with:
variableFileName: 'global.variables'
- name: 'Publish module'
uses: ./.github/actions/templates/publishModule
with:
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
versioningOption: '${{ needs.job_set_workflow_param.outputs.versioningOption }}'
customVersion: '${{ needs.job_set_workflow_param.outputs.customVersion }}'
templateSpecsRGName: '${{ env.templateSpecsRGName }}'
templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}'
templateSpecsDescription: '${{ env.templateSpecsDescription }}'
templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}'
bicepRegistryName: '${{ env.bicepRegistryName }}'
bicepRegistryRGName: '${{ env.bicepRegistryRGName }}'
bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}'
82 changes: 40 additions & 42 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,45 +1,43 @@
{
"[bicep]": {
"editor.insertSpaces": true,
"editor.tabSize": 2
},
"[markdown]": {
"files.encoding": "utf8"
},
"[powershell]": {
"editor.insertSpaces": true,
"editor.tabSize": 4,
"files.encoding": "utf8bom"
},
"[yaml]": {
"editor.insertSpaces": true,
"editor.tabSize": 2
},
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"[bicep]": {
"editor.insertSpaces": true,
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,
"markdown.extension.orderedList.marker": "one",
"markdown.extension.tableFormatter.enabled": false,
"markdownlint.config": {
"MD034": true
},
"powershell.codeFormatting.autoCorrectAliases": true,
"powershell.codeFormatting.newLineAfterCloseBrace": false,
"powershell.codeFormatting.pipelineIndentationStyle": "IncreaseIndentationForFirstPipeline",
"powershell.codeFormatting.preset": "OTBS",
"powershell.codeFormatting.trimWhitespaceAroundPipe": true,
"powershell.codeFormatting.useConstantStrings": true,
"powershell.codeFormatting.useCorrectCasing": true,
"powershell.codeFormatting.whitespaceBetweenParameters": true,
"spellright.documentTypes": [
"markdown",
"latex",
"plaintext"
],
"spellright.language": [
"en"
],
"yaml.format.singleQuote": true
"editor.tabSize": 2
},
"[markdown]": {
"files.encoding": "utf8"
},
"[powershell]": {
"editor.insertSpaces": true,
"editor.tabSize": 4,
"files.encoding": "utf8bom"
},
"[yaml]": {
"editor.insertSpaces": true,
"editor.tabSize": 2
},
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.insertSpaces": true,
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,
"markdown.extension.orderedList.marker": "one",
"markdown.extension.tableFormatter.enabled": false,
"markdownlint.config": {
"MD034": true,
"MD028": false,
"MD025": {
"front_matter_title": ""
}
},
"powershell.codeFormatting.autoCorrectAliases": true,
"powershell.codeFormatting.newLineAfterCloseBrace": false,
"powershell.codeFormatting.pipelineIndentationStyle": "IncreaseIndentationForFirstPipeline",
"powershell.codeFormatting.preset": "OTBS",
"powershell.codeFormatting.trimWhitespaceAroundPipe": true,
"powershell.codeFormatting.useConstantStrings": true,
"powershell.codeFormatting.useCorrectCasing": true,
"powershell.codeFormatting.whitespaceBetweenParameters": true,
"spellright.documentTypes": ["markdown", "latex", "plaintext"],
"spellright.language": ["en"],
"yaml.format.singleQuote": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
param privateEndpointResourceId string
param privateEndpointVnetLocation string
param privateEndpointObj object
param tags object

var privateEndpointResourceName = last(split(privateEndpointResourceId, '/'))
var privateEndpoint_var = {
name: contains(privateEndpointObj, 'name') ? (empty(privateEndpointObj.name) ? '${privateEndpointResourceName}-${privateEndpointObj.service}' : privateEndpointObj.name) : '${privateEndpointResourceName}-${privateEndpointObj.service}'
subnetResourceId: privateEndpointObj.subnetResourceId
service: [
privateEndpointObj.service
]
privateDnsZoneResourceIds: contains(privateEndpointObj, 'privateDnsZoneResourceIds') ? (empty(privateEndpointObj.privateDnsZoneResourceIds) ? [] : privateEndpointObj.privateDnsZoneResourceIds) : []
customDnsConfigs: contains(privateEndpointObj, 'customDnsConfigs') ? (empty(privateEndpointObj.customDnsConfigs) ? null : privateEndpointObj.customDnsConfigs) : null
}

resource privateEndpoint 'Microsoft.Network/privateEndpoints@2021-03-01' = {
name: privateEndpoint_var.name
location: privateEndpointVnetLocation
tags: tags
properties: {
privateLinkServiceConnections: [
{
name: privateEndpoint_var.name
properties: {
privateLinkServiceId: privateEndpointResourceId
groupIds: privateEndpoint_var.service
}
}
]
manualPrivateLinkServiceConnections: []
subnet: {
id: privateEndpoint_var.subnetResourceId
}
customDnsConfigs: privateEndpoint_var.customDnsConfigs
}
}

resource privateDnsZoneGroups 'Microsoft.Network/privateEndpoints/privateDnsZoneGroups@2021-03-01' = if (!empty(privateEndpoint_var.privateDnsZoneResourceIds)) {
name: 'default'
properties: {
privateDnsZoneConfigs: [for privateDnsZoneResourceId in privateEndpoint_var.privateDnsZoneResourceIds: {
name: last(split(privateDnsZoneResourceId, '/'))
properties: {
privateDnsZoneId: privateDnsZoneResourceId
}
}]
}
parent: privateEndpoint
}
32 changes: 32 additions & 0 deletions arm/Microsoft.Synapse/privateLinkHubs/.bicep/nested_rbac.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
param principalIds array
param roleDefinitionIdOrName string
param resourceId string

var builtInRoleNames = {
'Owner': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '8e3af657-a8ff-443c-a75c-2fe8c4bcb635')
'Contributor': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b24988ac-6180-42a0-ab88-20f7382dd24c')
'Reader': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
'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 Metrics Publisher': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '3913510d-42f4-4e42-8a64-420c390055eb')
'Monitoring Reader': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '43d0d8ad-25c7-4714-9337-8ba259a9fe05')
'Resource Policy Contributor': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '36243c78-bf99-498c-9df9-86d9f8d28608')
'User Access Administrator': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '18d7d88d-d35e-4fb5-a5c3-7773c20a72d9')
}

resource privateLinkHub 'Microsoft.Synapse/privateLinkHubs@2021-06-01' existing = {
name: last(split(resourceId, '/'))
}

resource roleAssignment 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = [for principalId in principalIds: {
name: guid(privateLinkHub.name, principalId, roleDefinitionIdOrName)
properties: {
roleDefinitionId: contains(builtInRoleNames, roleDefinitionIdOrName) ? builtInRoleNames[roleDefinitionIdOrName] : roleDefinitionIdOrName
principalId: principalId
}
scope: privateLinkHub
}]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"name": {
"value": "synplhmin001"
}
}
}
Loading