Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Modules] New child module for Synapse workspace Integration Runtime #3194

Merged
merged 17 commits into from
May 16, 2023
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
7 changes: 7 additions & 0 deletions modules/Synapse/workspaces/.test/common/main.test.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ module testDeployment '../../main.bicep' = {
}
}
]
managedVirtualNetwork: true
integrationRuntimes: [
{
type: 'SelfHosted'
name: 'shir01'
}
]
diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: diagnosticDependencies.outputs.storageAccountResourceId
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
Expand Down
20 changes: 20 additions & 0 deletions modules/Synapse/workspaces/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ This module deploys a Synapse Workspace.
| `Microsoft.Network/privateEndpoints` | [2022-07-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Network/2022-07-01/privateEndpoints) |
| `Microsoft.Network/privateEndpoints/privateDnsZoneGroups` | [2022-07-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Network/2022-07-01/privateEndpoints/privateDnsZoneGroups) |
| `Microsoft.Synapse/workspaces` | [2021-06-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Synapse/2021-06-01/workspaces) |
| `Microsoft.Synapse/workspaces/integrationRuntimes` | [2021-06-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Synapse/2021-06-01/workspaces/integrationRuntimes) |
| `Microsoft.Synapse/workspaces/keys` | [2021-06-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Synapse/2021-06-01/workspaces/keys) |

## Parameters
Expand Down Expand Up @@ -61,6 +62,7 @@ This module deploys a Synapse Workspace.
| `encryption` | bool | `False` | | Double encryption using a customer-managed key. |
| `encryptionActivateWorkspace` | bool | `False` | | Activate workspace by adding the system managed identity in the KeyVault containing the customer managed key and activating the workspace. |
| `initialWorkspaceAdminObjectID` | string | `''` | | AAD object ID of initial workspace admin. |
| `integrationRuntimes` | _[integrationRuntimes](integrationRuntimes/README.md)_ array | `[]` | | The Integration Runtimes to create. |
| `linkedAccessCheckOnTargetResource` | bool | `False` | | Linked Access Check On Target Resource. |
| `location` | string | `[resourceGroup().location]` | | The geo-location where the resource lives. |
| `lock` | string | `''` | `['', CanNotDelete, ReadOnly]` | Specify the type of lock. |
Expand Down Expand Up @@ -367,6 +369,13 @@ module workspaces './Synapse/workspaces/main.bicep' = {
diagnosticWorkspaceId: '<diagnosticWorkspaceId>'
enableDefaultTelemetry: '<enableDefaultTelemetry>'
initialWorkspaceAdminObjectID: '<initialWorkspaceAdminObjectID>'
integrationRuntimes: [
{
name: 'shir01'
type: 'SelfHosted'
}
]
managedVirtualNetwork: true
privateEndpoints: [
{
privateDnsZoneGroup: {
Expand Down Expand Up @@ -454,6 +463,17 @@ module workspaces './Synapse/workspaces/main.bicep' = {
"initialWorkspaceAdminObjectID": {
"value": "<initialWorkspaceAdminObjectID>"
},
"integrationRuntimes": {
"value": [
{
"name": "shir01",
"type": "SelfHosted"
}
]
},
"managedVirtualNetwork": {
"value": true
},
"privateEndpoints": {
"value": [
{
Expand Down
51 changes: 51 additions & 0 deletions modules/Synapse/workspaces/integrationRuntimes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Synapse Workspaces IntegrationRuntimes `[Microsoft.Synapse/workspaces/integrationRuntimes]`

This module deploys Synapse Workspaces IntegrationRuntimes.

## Navigation

- [Resource Types](#Resource-Types)
- [Parameters](#Parameters)
- [Outputs](#Outputs)
- [Cross-referenced modules](#Cross-referenced-modules)

## Resource Types

| Resource Type | API Version |
| :-- | :-- |
| `Microsoft.Synapse/workspaces/integrationRuntimes` | [2021-06-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Synapse/2021-06-01/workspaces/integrationRuntimes) |

## Parameters

**Required parameters**

| Parameter Name | Type | Allowed Values | Description |
| :-- | :-- | :-- | :-- |
| `name` | string | | The name of the Integration Runtime. |
| `type` | string | `[Managed, SelfHosted]` | The type of Integration Runtime. |

**Conditional parameters**

| Parameter Name | Type | Description |
| :-- | :-- | :-- |
| `typeProperties` | object | Integration Runtime type properties. Required if type is "Managed". |
| `workspaceName` | string | The name of the parent Synapse Workspace. Required if the template is used in a standalone deployment. |

**Optional parameters**

| Parameter Name | Type | Default Value | Description |
| :-- | :-- | :-- | :-- |
| `enableDefaultTelemetry` | bool | `True` | Enable telemetry via a Globally Unique Identifier (GUID). |


## Outputs

| Output Name | Type | Description |
| :-- | :-- | :-- |
| `name` | string | The name of the Integration Runtime. |
| `resourceGroupName` | string | The name of the Resource Group the Integration Runtime was created in. |
| `resourceId` | string | The resource ID of the Integration Runtime. |

## Cross-referenced modules

_None_
58 changes: 58 additions & 0 deletions modules/Synapse/workspaces/integrationRuntimes/main.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
@description('Conditional. The name of the parent Synapse Workspace. Required if the template is used in a standalone deployment.')
param workspaceName string

@description('Required. The name of the Integration Runtime.')
param name string

@allowed([
'Managed'
'SelfHosted'
])
@description('Required. The type of Integration Runtime.')
param type string

@description('Conditional. Integration Runtime type properties. Required if type is "Managed".')
param typeProperties object = {}

@description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).')
param enableDefaultTelemetry bool = true

resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) {
name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}'
properties: {
mode: 'Incremental'
template: {
'$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
contentVersion: '1.0.0.0'
resources: []
}
}
}

resource workspace 'Microsoft.Synapse/workspaces@2021-06-01' existing = {
name: workspaceName
}

resource integrationRuntime 'Microsoft.Synapse/workspaces/integrationRuntimes@2021-06-01' = {
name: name
parent: workspace
properties: type == 'Managed' ? {
type: type
managedVirtualNetwork: {
referenceName: 'default'
type: 'ManagedVirtualNetworkReference'
}
typeProperties: typeProperties
} : {
type: type
}
}

@description('The name of the Resource Group the Integration Runtime was created in.')
output resourceGroupName string = resourceGroup().name

@description('The name of the Integration Runtime.')
output name string = integrationRuntime.name

@description('The resource ID of the Integration Runtime.')
output resourceId string = integrationRuntime.id
4 changes: 4 additions & 0 deletions modules/Synapse/workspaces/integrationRuntimes/version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "0.1"
}
15 changes: 15 additions & 0 deletions modules/Synapse/workspaces/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ param managedResourceGroupName string = ''
@description('Optional. Enable this to ensure that connection from your workspace to your data sources use Azure Private Links. You can create managed private endpoints to your data sources.')
param managedVirtualNetwork bool = false

@description('Optional. The Integration Runtimes to create.')
param integrationRuntimes array = []

@description('Optional. Allowed AAD Tenant IDs For Linking.')
param allowedAadTenantIdsForLinking array = []

Expand Down Expand Up @@ -233,6 +236,18 @@ resource workspace 'Microsoft.Synapse/workspaces@2021-06-01' = {
}
}

// Workspace integration runtimes
module synapse_integrationRuntimes 'integrationRuntimes/main.bicep' = [for (integrationRuntime, index) in integrationRuntimes: {
name: '${uniqueString(deployment().name, location)}-Synapse-IntegrationRuntime-${index}'
params: {
workspaceName: workspace.name
name: integrationRuntime.name
type: integrationRuntime.type
typeProperties: contains(integrationRuntime, 'typeProperties') ? integrationRuntime.typeProperties : {}
enableDefaultTelemetry: enableReferencedModulesTelemetry
}
}]

// Workspace encryption with customer managed keys
// - Assign Synapse Workspace MSI access to encryption key
module workspace_cmk_rbac './.bicep/nested_cmkRbac.bicep' = if (encryptionActivateWorkspace) {
Expand Down