584 строки
18 KiB
JSON
584 строки
18 KiB
JSON
{
|
|
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
|
|
"contentVersion": "1.0.0.0",
|
|
"parameters": {
|
|
"companyTla": {
|
|
"type": "string",
|
|
"metadata": {
|
|
"description": "This is a Three Letter Acronym for your company name. 'CON' for Contoso for example."
|
|
}
|
|
},
|
|
"allowAllConnections": {
|
|
"type": "string",
|
|
"allowedValues": [
|
|
"true",
|
|
"false"
|
|
],
|
|
"defaultValue": "true"
|
|
},
|
|
"sparkDeployment": {
|
|
"type": "string",
|
|
"defaultValue": "true",
|
|
"allowedValues": [
|
|
"true",
|
|
"false"
|
|
],
|
|
"metadata": {
|
|
"description": "'True' deploys an Apache Spark pool as well as a SQL pool. 'False' does not deploy an Apache Spark pool."
|
|
}
|
|
},
|
|
"sparkNodeSize": {
|
|
"type": "string",
|
|
"defaultValue": "Small",
|
|
"allowedValues": [
|
|
"Small",
|
|
"Medium",
|
|
"Large"
|
|
],
|
|
"metadata": {
|
|
"description": "This parameter will determine the node size if SparkDeployment is true"
|
|
}
|
|
},
|
|
"sqlAdministratorLogin": {
|
|
"type": "string",
|
|
"metadata": {
|
|
"description": "The username of the SQL Administrator"
|
|
}
|
|
},
|
|
"sqlAdministratorLoginPassword": {
|
|
"type": "securestring",
|
|
"metadata": {
|
|
"description": "The password for the SQL Administrator"
|
|
}
|
|
},
|
|
"sku": {
|
|
"type": "string",
|
|
"defaultValue": "DW100c",
|
|
"allowedValues": [
|
|
"DW100c",
|
|
"DW200c",
|
|
"DW300c",
|
|
"DW400c",
|
|
"DW500c",
|
|
"DW1000c",
|
|
"DW1500c",
|
|
"DW2000c",
|
|
"DW2500c",
|
|
"DW3000c"
|
|
],
|
|
"metadata": {
|
|
"description": "Select the SKU of the SQL pool."
|
|
}
|
|
},
|
|
"metadataSync": {
|
|
"type": "bool",
|
|
"defaultValue": false,
|
|
"metadata": {
|
|
"description": "Choose whether you want to synchronise metadata."
|
|
}
|
|
},
|
|
"Frequency": {
|
|
"type": "string",
|
|
"defaultValue": "Weekdays",
|
|
"allowedValues": [
|
|
"Daily",
|
|
"Weekdays"
|
|
],
|
|
"metadata": {
|
|
"description": "Choose whether to run schedule every day of the week, or only on weekdays"
|
|
}
|
|
},
|
|
"timeZone": {
|
|
"type": "string",
|
|
"defaultValue": "Eastern Standard Time",
|
|
"allowedValues": [
|
|
"Dateline Standard Time",
|
|
"Samoa Standard Time",
|
|
"Hawaiian Standard Time",
|
|
"Alaskan Standard Time",
|
|
"Pacific Standard Time",
|
|
"Mountain Standard Time",
|
|
"Mexico Standard Time 2",
|
|
"Central Standard Time",
|
|
"Canada Central Standard Time",
|
|
"Mexico Standard Time",
|
|
"Central America Standard Time",
|
|
"Eastern Standard Time",
|
|
"Atlantic Standard Time",
|
|
"Newfoundland and Labrador Standard Time",
|
|
"E. South America Standard Time",
|
|
"S.A. Eastern Standard Time",
|
|
"Greenland Standard Time",
|
|
"Mid-Atlantic Standard Time",
|
|
"Azores Standard Time",
|
|
"Cape Verde Standard Time",
|
|
"GMT Standard Time",
|
|
"Greenwich Standard Time",
|
|
"Central Europe Standard Time",
|
|
"Central European Standard Time",
|
|
"Romance Standard Time",
|
|
"W. Europe Standard Time",
|
|
"W. Central Africa Standard Time",
|
|
"E. Europe Standard Time",
|
|
"Egypt Standard Time",
|
|
"FLE Standard Time",
|
|
"GTB Standard Time",
|
|
"Israel Standard Time",
|
|
"South Africa Standard Time",
|
|
"Russian Standard Time",
|
|
"Arab Standard Time",
|
|
"E. Africa Standard Time",
|
|
"Arabic Standard Time",
|
|
"Iran Standard Time",
|
|
"Arabian Standard Time",
|
|
"Caucasus Standard Time",
|
|
"Transitional Islamic State of Afghanistan Standard Time",
|
|
"Ekaterinburg Standard Time",
|
|
"West Asia Standard Time",
|
|
"India Standard Time",
|
|
"Nepal Standard Time",
|
|
"Central Asia Standard Time",
|
|
"Sri Lanka Standard Time",
|
|
"Myanmar Standard Time",
|
|
"North Asia Standard Time",
|
|
"China Standard Time",
|
|
"Singapore Standard Time",
|
|
"Taipei Standard Time",
|
|
"North Asia East Standard Time",
|
|
"Korea Standard Time",
|
|
"Tokyo Standard Time",
|
|
"Yakutsk Standard Time",
|
|
"Tasmania Standard Time",
|
|
"Vladivostok Standard Time",
|
|
"West Pacific Standard Time",
|
|
"Central Pacific Standard Time",
|
|
"Fiji Islands Standard Time",
|
|
"New Zealand Standard Time",
|
|
"Tonga Standard Time"
|
|
],
|
|
"metadata": {
|
|
"description": "Timezone for the schedule. Consult https://msdn.microsoft.com/en-us/library/ms912391(v=winembedded.11).aspx for more information"
|
|
}
|
|
},
|
|
"ResumeTime": {
|
|
"type": "string",
|
|
"defaultValue": "09:00 AM ( 9:00 )",
|
|
"allowedValues": [
|
|
"12:00 AM ( 0:00 )",
|
|
"01:00 AM ( 1:00 )",
|
|
"02:00 AM ( 2:00 )",
|
|
"03:00 AM ( 3:00 )",
|
|
"04:00 AM ( 4:00 )",
|
|
"05:00 AM ( 5:00 )",
|
|
"06:00 AM ( 6:00 )",
|
|
"07:00 AM ( 7:00 )",
|
|
"08:00 AM ( 8:00 )",
|
|
"09:00 AM ( 9:00 )",
|
|
"10:00 AM ( 10:00 )",
|
|
"11:00 AM ( 11:00 )",
|
|
"12:00 PM ( 12:00 )",
|
|
"01:00 PM ( 13:00 )",
|
|
"02:00 PM ( 14:00 )",
|
|
"03:00 PM ( 15:00 )",
|
|
"04:00 PM ( 16:00 )",
|
|
"05:00 PM ( 17:00 )",
|
|
"06:00 PM ( 18:00 )",
|
|
"07:00 PM ( 19:00 )",
|
|
"08:00 PM ( 20:00 )",
|
|
"09:00 PM ( 21:00 )",
|
|
"10:00 PM ( 22:00 )",
|
|
"11:00 PM ( 23:00 )"
|
|
],
|
|
"metadata": {
|
|
"description": "Time of Day when the data warehouse will be resumed"
|
|
}
|
|
},
|
|
"PauseTime": {
|
|
"type": "string",
|
|
"defaultValue": "05:00 PM ( 17:00 )",
|
|
"allowedValues": [
|
|
"12:00 AM ( 0:00 )",
|
|
"01:00 AM ( 1:00 )",
|
|
"02:00 AM ( 2:00 )",
|
|
"03:00 AM ( 3:00 )",
|
|
"04:00 AM ( 4:00 )",
|
|
"05:00 AM ( 5:00 )",
|
|
"06:00 AM ( 6:00 )",
|
|
"07:00 AM ( 7:00 )",
|
|
"08:00 AM ( 8:00 )",
|
|
"09:00 AM ( 9:00 )",
|
|
"10:00 AM ( 10:00 )",
|
|
"11:00 AM ( 11:00 )",
|
|
"12:00 PM ( 12:00 )",
|
|
"01:00 PM ( 13:00 )",
|
|
"02:00 PM ( 14:00 )",
|
|
"03:00 PM ( 15:00 )",
|
|
"04:00 PM ( 16:00 )",
|
|
"05:00 PM ( 17:00 )",
|
|
"06:00 PM ( 18:00 )",
|
|
"07:00 PM ( 19:00 )",
|
|
"08:00 PM ( 20:00 )",
|
|
"09:00 PM ( 21:00 )",
|
|
"10:00 PM ( 22:00 )",
|
|
"11:00 PM ( 23:00 )"
|
|
],
|
|
"metadata": {
|
|
"description": "Time of day when the data warehouse will be paused"
|
|
}
|
|
},
|
|
"githubUsername": {
|
|
"type": "string",
|
|
"metadata": {
|
|
"description": "Username of your github account hosting synapse workspace resources"
|
|
}
|
|
}
|
|
},
|
|
"variables": {
|
|
"_artifactsLocation": "[deployment().properties.templatelink.uri]",
|
|
"location": "[resourceGroup().location]",
|
|
"deploymentType": "poc",
|
|
"synapseName": "[toLower(concat(parameters('companyTla'),uniquestring(resourceGroup().id),variables('deploymentType')))]",
|
|
"dlsName": "[toLower(concat(parameters('companyTla'),uniquestring(resourceGroup().id),variables('deploymentType')))]",
|
|
"dlsFsName": "[toLower(concat('dls',parameters('companyTla'),variables('deploymentType'),'fs1'))]",
|
|
"sqlPoolName": "[toLower(concat(variables('workspaceName'),'p1'))]",
|
|
"workspaceName": "[toLower(concat(variables('synapseName'),'ws1'))]",
|
|
"sparkPoolName": "[toLower('ws1sparkpool1')]",
|
|
"keyVaultName": "[toLower(concat('kv',parameters('companyTla'),uniquestring(resourceGroup().id),variables('deploymentType')))]",
|
|
"storageAccountId": "[resourceId('Microsoft.Storage/storageAccounts', variables('dlsName'))]",
|
|
"logicApps": [
|
|
"SynapsePauseSchedule",
|
|
"SynapseResumeSchedule"
|
|
]
|
|
},
|
|
"resources": [
|
|
{
|
|
"name": "keyVaultDeployment",
|
|
"type": "Microsoft.Resources/deployments",
|
|
"apiVersion": "2018-05-01",
|
|
"dependsOn": [
|
|
"[resourceId('Microsoft.Storage/storageAccounts', variables('dlsName'))]"
|
|
],
|
|
"properties": {
|
|
"mode": "Incremental",
|
|
"templatelink": {
|
|
"uri": "[uri(variables('_artifactsLocation'), concat('nestedtemplates/keyvault.json'))]"
|
|
},
|
|
"parameters": {
|
|
"location": {
|
|
"value": "[variables('location')]"
|
|
},
|
|
"keyVaultName": {
|
|
"value": "[variables('keyVaultName')]"
|
|
},
|
|
"sqlAdministratorLoginPassword": {
|
|
"value": "[parameters('sqlAdministratorLoginPassword')]"
|
|
},
|
|
"datalakeAccountAccessKeyValue": {
|
|
"value": "[listKeys(variables('storageAccountId'), '2019-06-01').keys[0].value]"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "keyVaultPermissionsUpdate",
|
|
"type": "Microsoft.Resources/deployments",
|
|
"apiVersion": "2018-05-01",
|
|
"dependsOn": [
|
|
"[variables('workspaceName')]",
|
|
"[resourceId('Microsoft.Resources/deployments','keyVaultDeployment')]"
|
|
],
|
|
"properties": {
|
|
"mode": "Incremental",
|
|
"templatelink": {
|
|
"uri": "[uri(variables('_artifactsLocation'), concat('nestedtemplates/keyvaultpermissionsupdate.json'))]"
|
|
},
|
|
"parameters": {
|
|
"location": {
|
|
"value": "[variables('location')]"
|
|
},
|
|
"keyVaultName": {
|
|
"value": "[variables('keyVaultName')]"
|
|
},
|
|
"workspaceName": {
|
|
"value": "[variables('workspaceName')]"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "Microsoft.Resources/deployments",
|
|
"apiVersion": "2020-06-01",
|
|
"name": "logicAppPauseDeployment",
|
|
"properties": {
|
|
"mode": "Incremental",
|
|
"templatelink": {
|
|
"uri": "[uri(variables('_artifactsLocation'), concat('nestedtemplates/pausetemplate.json'))]"
|
|
},
|
|
"parameters": {
|
|
"logicAppName": {
|
|
"value": "[variables('logicApps')[0]]"
|
|
},
|
|
"Frequency": {
|
|
"value": "[parameters('Frequency')]"
|
|
},
|
|
"companyTla": {
|
|
"value": "[parameters('companyTla')]"
|
|
},
|
|
"deploymentType": {
|
|
"value": "[variables('deploymentType')]"
|
|
},
|
|
"timeZone": {
|
|
"value": "[parameters('timeZone')]"
|
|
},
|
|
"PauseTime": {
|
|
"value": "[parameters('PauseTime')]"
|
|
},
|
|
"location": {
|
|
"value": "[variables('location')]"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "Microsoft.Resources/deployments",
|
|
"apiVersion": "2020-06-01",
|
|
"name": "logicAppResumeDeployment",
|
|
"properties": {
|
|
"mode": "Incremental",
|
|
"templatelink": {
|
|
"uri": "[uri(variables('_artifactsLocation'), concat('nestedtemplates/resumetemplate.json'))]"
|
|
},
|
|
"parameters": {
|
|
"logicAppName": {
|
|
"value": "[variables('logicApps')[1]]"
|
|
},
|
|
"Frequency": {
|
|
"value": "[parameters('Frequency')]"
|
|
},
|
|
"companyTla": {
|
|
"value": "[parameters('companyTla')]"
|
|
},
|
|
"deploymentType": {
|
|
"value": "[variables('deploymentType')]"
|
|
},
|
|
"timeZone": {
|
|
"value": "[parameters('timeZone')]"
|
|
},
|
|
"ResumeTime": {
|
|
"value": "[parameters('ResumeTime')]"
|
|
},
|
|
"location": {
|
|
"value": "[variables('location')]"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "Microsoft.Storage/storageAccounts",
|
|
"apiVersion": "2019-06-01",
|
|
"name": "[variables('dlsName')]",
|
|
"location": "[variables('location')]",
|
|
"sku": {
|
|
"name": "Standard_LRS"
|
|
},
|
|
"kind": "StorageV2",
|
|
"properties": {
|
|
"accessTier": "Hot",
|
|
"supportsHttpsTrafficOnly": true,
|
|
"isHnsEnabled": true
|
|
},
|
|
"resources": [
|
|
{
|
|
"name": "[concat('default/', variables('dlsFsName'))]",
|
|
"type": "blobServices/containers",
|
|
"apiVersion": "2019-06-01",
|
|
"dependsOn": [
|
|
"[variables('dlsName')]"
|
|
],
|
|
"properties": {
|
|
"publicAccess": "None"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "Microsoft.Synapse/workspaces",
|
|
"apiVersion": "2019-06-01-preview",
|
|
"name": "[variables('workspaceName')]",
|
|
"location": "[variables('location')]",
|
|
"identity": {
|
|
"type": "SystemAssigned"
|
|
},
|
|
"dependsOn": [
|
|
"[variables('dlsName')]",
|
|
"[variables('dlsFsName')]"
|
|
],
|
|
"properties": {
|
|
"defaultDataLakeStorage": {
|
|
"accountUrl": "[reference(variables('dlsName')).primaryEndpoints.dfs]",
|
|
"filesystem": "[variables('dlsFsName')]"
|
|
},
|
|
"sqlAdministratorLogin": "[parameters('sqlAdministratorLogin')]",
|
|
"sqlAdministratorLoginPassword": "[parameters('sqlAdministratorLoginPassword')]",
|
|
"managedVirtualNetwork": "default",
|
|
"workspaceRepositoryConfiguration": {
|
|
"type": "WorkspaceGitHubConfiguration",
|
|
"hostName": "https://github.com",
|
|
"accountName": "[parameters('githubUsername')]",
|
|
"repositoryName": "Test-Drive-Synapse-Link-For-DataVerse",
|
|
"rootFolder": "/synapsepoc",
|
|
"collaborationBranch": "main"
|
|
}
|
|
},
|
|
"resources": [
|
|
{
|
|
"condition": "[equals(parameters('allowAllConnections'),'true')]",
|
|
"type": "firewallrules",
|
|
"apiVersion": "2019-06-01-preview",
|
|
"name": "allowAll",
|
|
"location": "[variables('location')]",
|
|
"dependsOn": [ "[variables('workspaceName')]" ],
|
|
"properties": {
|
|
"startIpAddress": "0.0.0.0",
|
|
"endIpAddress": "255.255.255.255"
|
|
}
|
|
},
|
|
{
|
|
"type": "firewallrules",
|
|
"apiVersion": "2019-06-01-preview",
|
|
"name": "AllowAllWindowsAzureIps",
|
|
"location": "[variables('location')]",
|
|
"dependsOn": [ "[variables('workspaceName')]" ],
|
|
"properties": {
|
|
"startIpAddress": "0.0.0.0",
|
|
"endIpAddress": "0.0.0.0"
|
|
}
|
|
},
|
|
{
|
|
"type": "managedIdentitySqlControlSettings",
|
|
"apiVersion": "2019-06-01-preview",
|
|
"name": "default",
|
|
"location": "[variables('location')]",
|
|
"dependsOn": [ "[variables('workspaceName')]" ],
|
|
"properties": {
|
|
"grantSqlControlToManagedIdentity": {
|
|
"desiredState": "Enabled"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "Microsoft.Synapse/workspaces/sqlPools",
|
|
"apiVersion": "2019-06-01-preview",
|
|
"name": "[concat(variables('workspaceName'), '/', variables('sqlPoolName'))]",
|
|
"location": "[variables('location')]",
|
|
"sku": {
|
|
"name": "[parameters('sku')]"
|
|
},
|
|
"dependsOn": [
|
|
"[variables('workspaceName')]"
|
|
],
|
|
"properties": {
|
|
"createMode": "Default",
|
|
"collation": "SQL_Latin1_General_CP1_CI_AS"
|
|
},
|
|
"resources": [
|
|
{
|
|
"condition": "[parameters('metadataSync')]",
|
|
"type": "metadataSync",
|
|
"apiVersion": "2019-06-01-preview",
|
|
"name": "config",
|
|
"location": "[variables('location')]",
|
|
"dependsOn": [
|
|
"[variables('sqlPoolName')]"
|
|
],
|
|
"properties": {
|
|
"Enabled": "[parameters('metadataSync')]"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"condition": "[equals(parameters('sparkDeployment'),'true')]",
|
|
"type": "Microsoft.Synapse/workspaces/bigDataPools",
|
|
"apiVersion": "2019-06-01-preview",
|
|
"name": "[concat(variables('workspaceName'), '/', variables('sparkPoolName'))]",
|
|
"location": "[variables('location')]",
|
|
"dependsOn": [
|
|
"[variables('workspaceName')]"
|
|
],
|
|
"properties": {
|
|
"nodeCount": 5,
|
|
"nodeSizeFamily": "MemoryOptimized",
|
|
"nodeSize": "[parameters('sparkNodeSize')]",
|
|
"autoScale": {
|
|
"enabled": true,
|
|
"minNodeCount": 3,
|
|
"maxNodeCount": 25
|
|
},
|
|
"autoPause": {
|
|
"enabled": true,
|
|
"delayInMinutes": 15
|
|
},
|
|
"sparkVersion": "2.4"
|
|
}
|
|
},
|
|
{
|
|
"scope": "[concat('Microsoft.Storage/storageAccounts/', variables('dlsName'))]",
|
|
"type": "Microsoft.Authorization/roleAssignments",
|
|
"apiVersion": "2020-04-01-preview",
|
|
"name": "[guid(uniqueString(variables('dlsName')))]",
|
|
"location": "[variables('location')]",
|
|
"dependsOn": [
|
|
"[variables('workspaceName')]"
|
|
],
|
|
"properties": {
|
|
"roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe')]",
|
|
"principalId": "[reference(resourceId('Microsoft.Synapse/workspaces', variables('workspaceName')), '2019-06-01-preview', 'Full').identity.principalId]",
|
|
"principalType": "ServicePrincipal"
|
|
}
|
|
},
|
|
{
|
|
"type": "Microsoft.Resources/deployments",
|
|
"apiVersion": "2020-06-01",
|
|
"name": "MSIRBACOnResourceGroup0",
|
|
"dependsOn": [
|
|
"logicAppResumeDeployment",
|
|
"logicAppPauseDeployment"
|
|
],
|
|
"properties": {
|
|
"mode": "Incremental",
|
|
"templatelink": {
|
|
"uri": "[uri(variables('_artifactsLocation'), concat('nestedtemplates/logicapproleassignments.json'))]"
|
|
},
|
|
"parameters": {
|
|
"logicAppName": {
|
|
"value": "[variables('logicApps')[0]]"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "Microsoft.Resources/deployments",
|
|
"apiVersion": "2020-06-01",
|
|
"name": "MSIRBACOnResourceGroup1",
|
|
"dependsOn": [
|
|
"logicAppResumeDeployment",
|
|
"logicAppPauseDeployment"
|
|
],
|
|
"properties": {
|
|
"mode": "Incremental",
|
|
"templatelink": {
|
|
"uri": "[uri(variables('_artifactsLocation'), concat('nestedtemplates/logicapproleassignments.json'))]"
|
|
},
|
|
"parameters": {
|
|
"logicAppName": {
|
|
"value": "[variables('logicApps')[1]]"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|