-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (108 loc) · 4.24 KB
/
synapseDeploymentTemplate.yml
File metadata and controls
117 lines (108 loc) · 4.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Synapse Deployment Template
on:
workflow_call:
inputs:
environment:
required: true
type: string
default: "dev"
description: "Specifies the environment of the deployment."
source_synapse_workspace_name:
required: true
type: string
description: "Specifies the name of the synapse workspace."
target_synapse_workspace_name:
required: true
type: string
description: "Specifies the name of the synapse workspace."
secrets:
azure_subscription_id:
required: true
description: "Specifies the subscription id of the deployment."
azure_resource_group_name:
required: true
description: "Specifies the name of the resource group for the deployment."
tenant_id:
required: true
description: "Specifies the tenant id of the deployment."
client_id:
required: true
description: "Specifies the client id."
client_secret:
required: true
description: "Specifies the client secret."
jobs:
deployment:
name: Deployment to ${{ inputs.environment }}
runs-on: ubuntu-latest
continue-on-error: false
if: github.event_name == 'push' || github.event_name == 'release'
environment: ${{ inputs.environment }}
steps:
# Check Out Repository
- name: Check Out Repository
id: checkout_repository
uses: actions/checkout@v3
# Login to Azure
- name: Azure Login
id: azure_login
uses: azure/login@v1
with:
creds: '{"clientId":"${{ secrets.client_id }}","clientSecret":"${{ secrets.client_secret }}","subscriptionId":"${{ secrets.azure_subscription_id }}","tenantId":"${{ secrets.tenant_id }}"}'
enable-AzPSSession: true
# Install Required Modules
- name: Install Required Modules
id: install_modules
run: |
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module Az -ErrorAction Stop
shell: pwsh
working-directory: ${{ github.workspace }}/code/Scripts
# Synapse Pre-Processing Step
- name: Synapse Pre-Processing Step
id: synapse_preprocessing
run: |
./SynapseRolloutPreprocessing.ps1 `
-SubscriptionId "${{ secrets.azure_subscription_id }}" `
-SynapseWorkspaceName "${{ inputs.target_synapse_workspace_name }}" `
-CheckPastDaysOfPipelineRuns 1
shell: pwsh
working-directory: ${{ github.workspace }}/code/Scripts
# Deploy Synapse Artifacts
- name: Deploy Synapse Artifacts
id: deployment_synapse
uses: azure/synapse-workspace-deployment@V1.8.0
with:
TargetWorkspaceName: ${{ inputs.target_synapse_workspace_name }}
TemplateFile: ${{ github.workspace }}/${{ inputs.source_synapse_workspace_name }}/TemplateForWorkspace.json
ParametersFile: ${{ github.workspace }}/code/synapseParameters/params.${{ inputs.target_synapse_workspace_name }}.json
# ArtifactsFolder:
operation: "deploy"
deployManagedPrivateEndpoint: true
# OverrideArmParameters:
DeleteArtifactsNotInTemplate: true
Environment: "Azure Public"
tenantId: ${{ secrets.tenant_id }}
subscriptionId: ${{ secrets.azure_subscription_id }}
resourceGroup: ${{ secrets.azure_resource_group_name }}
clientId: ${{ secrets.client_id }}
clientSecret: ${{ secrets.client_secret }}
managedIdentity: false
# # Synapse Post-Processing Step
# - name: Synapse Post-Processing Step
# id: synapse_postprocessing
# run: |
# ./SynapseRolloutPostprocessing.ps1 `
# -SubscriptionId "${{ secrets.azure_subscription_id }}" `
# -SynapseWorkspaceName "${{ inputs.target_synapse_workspace_name }}" `
# -TriggerNames "${{ steps.synapse_preprocessing.outputs.triggerNames }}"
# shell: pwsh
# working-directory: ${{ github.workspace }}/code/Scripts
# Log out from Azure
- name: Log out from Azure
id: azure_logout
uses: azure/cli@v1
with:
azcliversion: "agentazcliversion"
inlineScript: |
az logout