How to provision Resource group and synapse workspace with ADLSGen2 using ARM template?

kk 41 Reputation points
2022-08-24T18:48:34.243+00:00

Hi,

I want to create an ARM template which will create resource group, and under that resource group we want to create synapse workspace with adls gen2 and under the synapse workspace all the artifacts like pipelines, linkedservices will be there. I want to the create the infra using ARM template so that i can use it to deploy using CD pipeline.

Any help will be appreciated.
Thanks.

Azure DevTest Labs
Azure DevTest Labs
An Azure service that is used for provisioning development and test environments.
254 questions
Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,323 questions
{count} votes

Accepted answer
  1. BhargavaGunnam-MSFT 25,801 Reputation points Microsoft Employee
    2022-08-28T15:06:51.95+00:00

    Hello @kk ,

    Currently, linked services deployment using the ARM template is not supported. As a workaround, please follow the below two-step process.

    1) Set up a blank workspace, the default storage using ARM template
    2) Once you create the initial workspace, set up git integration for the artifacts deployment(linked services, pipelines, SQL sripts, notebooks etc) (or) use the Synapse REST API or PowerShell

    Refer to this document that provides guidance on how to use the API.
    https://learn.microsoft.com/en-us/powershell/module/az.synapse/set-azsynapselinkedservice?view=azps-7.1.0

    Please note:

    1. Spark pools and self-hosted integration runtimes aren't created in a workspace deployment task. If you have a linked service that uses a self-hosted integration runtime, manually create the runtime in the new workspace.
    2. If the items in the development workspace are attached to the specific pools, make sure that you create or parameterize the same names for the pools in the target workspace in the parameter file.
    3. If your provisioned SQL pools are paused when you attempt to deploy, the deployment might fail.

    CICD documentation: https://learn.microsoft.com/en-us/azure/synapse-analytics/cicd/continuous-integration-delivery#azure-synapse-analytics

    Other prerequisites: https://learn.microsoft.com/en-us/azure/synapse-analytics/cicd/continuous-integration-delivery#other-prerequisites

    The below "template" creates storage account, SQL account, and workspace.

    https://learn.microsoft.com/en-us/azure/synapse-analytics/quickstart-deployment-template-workspaces

    {  
        "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",  
        "contentVersion": "1.0.0.0",  
        "parameters": {  
            "workspaceName": {  
                "type": "String",  
                "metadata": {  
                    "description": "The name of the Workspace."  
                }  
            },  
            "storageAccountName": {  
                "type": "String",  
                "metadata": {  
                    "description": "The primary ADLS Gen2 Storage Account name. If not provided, the workspace name will be used."  
                }  
            },  
            "sqlAdministratorLogin": {  
                "type": "String",  
                 "metadata": {  
                    "description": "Provide the user name for SQL login."  
                }  
            },  
            "sqlAdministratorPassword": {  
                "type": "SecureString",  
                "metadata": {  
                    "description": "The passwords must meet the following guidelines:<ul><li> The password does not contain the account name of the user.</li><li> The password is at least eight characters long.</li><li> The password contains characters from three of the following four categories:</li><ul><li>Latin uppercase letters (A through Z)</li><li>Latin lowercase letters (a through z)</li><li>Base 10 digits (0 through 9)</li><li>Non-alphanumeric characters such as: exclamation point (!), dollar sign ($), number sign (#), or percent (%).</li></ul></ul> Passwords can be up to 128 characters long. Use passwords that are as long and complex as possible. Visit <a href=https://aka.ms/azuresqlserverpasswordpolicy>aka.ms/azuresqlserverpasswordpolicy</a> for more details."  
                }  
            },  
            "tagValues": {  
                "defaultValue": {"Created with":"Synapse Azure Resource Manager deploment template"},  
                "type": "Object"  
            },  
            "cmkUri": {  
                "type": "String",  
                "defaultValue": "",  
                "metadata": {  
                    "description": "The uri to a key in your Key Vault to add a second layer of encryption on top of the default infrastructure encryption"  
                }  
            },  
             "setSbdcRbacOnStorageAccount": {  
                "type": "bool",  
                "defaultValue": false  
            }  
        },  
        "variables": {  
            "dataLakeStorageName": "[if(empty(parameters('storageAccountName')), replace(tolower(parameters('workspaceName')),'-',''), tolower(parameters('storageAccountName')))]",  
            "cmkUriStripVersion": "[if(empty(parameters('cmkUri')), '', substring(parameters('cmkUri'), 0, lastIndexOf(parameters('cmkUri'), '/')))]",  
            "withCmk": {  
                "cmk": {  
                    "key": {  
                        "name": "default",  
                        "keyVaultUrl": "[variables('cmkUriStripVersion')]"  
                    }  
                }  
            },  
            "encryption": "[if(empty(parameters('cmkUri')), json('{}'), variables('withCmk'))]"  
        },  
        "resources": [  
            {  
                "type": "Microsoft.Resources/deployments",  
                "apiVersion": "2018-05-01",  
                "name": "storage",  
                "properties": {  
                  "mode": "Incremental",  
                  "templateLink": {  
                    "uri": "[uri(deployment().properties.templateLink.uri, '/Azure-Samples/Synapse/master/Manage/DeployWorkspace/storage/azuredeploy.json')]",  
                    "contentVersion": "1.0.0.0"  
                  },  
                  "parameters":{  
                    "storageAccount":{"value": "[variables('dataLakeStorageName')]"},  
                    "workspaceContainer":{"value": "[tolower(parameters('workspaceName'))]"}  
                  }  
                }  
            },  
            {  
                "type": "Microsoft.Resources/deployments",  
                "apiVersion": "2018-05-01",  
                "name": "workspace",  
                "properties": {  
                  "mode": "Incremental",  
                  "templateLink": {  
                    "uri": "[uri(deployment().properties.templateLink.uri, '/Azure-Samples/Synapse/master/Manage/DeployWorkspace/workspace/azuredeploy.json')]",  
                    "contentVersion": "1.0.0.0"  
                  },  
                  "parameters":{  
                    "name":{"value": "[tolower(parameters('workspaceName'))]"},  
                    "sqlAdministratorLogin":{"value": "[parameters('sqlAdministratorLogin')]"},  
                    "sqlAdministratorPassword":{"value": "[parameters('sqlAdministratorPassword')]"},  
                    "setSbdcRbacOnStorageAccount":{"value": "[parameters('setSbdcRbacOnStorageAccount')]"},  
                    "defaultDataLakeStorageAccountName":{"value": "[variables('dataLakeStorageName')]"},  
                    "defaultDataLakeStorageFilesystemName":{"value": "[tolower(parameters('workspaceName'))]"},  
                    "tagValues":{"value": "[parameters('tagValues')]"},  
                    "encryption":{"value": "[variables('encryption')]"}  
                  }  
                },  
                "dependsOn": [  
                    "storage"  
                ]  
            }  
        ],  
        "outputs": {}  
    }  
    

    I hope this helps.


    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators
    0 comments No comments

0 additional answers

Sort by: Most helpful