Skip to content

Instantly share code, notes, and snippets.

View kunalworldwide's full-sized avatar
🎯
Focusing

Kunal Das kunalworldwide

🎯
Focusing
View GitHub Profile
# @Author : Kunal Das
# Date : 30-12-2022
variables:
poolstagingarea: $(Build.ArtifactStagingDirectory)\poolstaging
BuildConfiguration: release
SQLPoolartifactname: AzureSQLPool
SQLPooldacpacfile: $(System.ArtifactsDirectory)\$(SQLPoolartifactname)\synapseSQLpoolDEV.sqlproj
steps:
- task: AzureSynapseWorkspace.synapsecicd-deploy.toggle-trigger.toggle-triggers-dev@2
displayName: 'Toggle Azure Synapse Triggers'
inputs:
azureSubscription: 'syn-sp'
ResourceGroupName: 'Synapseqa-RG'
WorkspaceName: 'synapse-qa'
ToggleOn: false
(Get-Content -path $(System.DefaultWorkingDirectory)/_Synapse-CI-pipeline/drop/ARM/TemplateForWorkspace.json) -replace 'LS_AKV_DEV','LS_AKV_QA' | Set-Content -Path $(System.DefaultWorkingDirectory)/_Synapse-CI-pipeline/drop/ARM/TemplateForWorkspace.json
(Get-Content -path $(System.DefaultWorkingDirectory)/_Synapse-CI-pipeline/drop/ARM/TemplateParametersForWorkspace.json) -replace 'LS_AKV_DEV','LS_AKV_QA' | Set-Content -Path $(System.DefaultWorkingDirectory)/_Synapse-CI-pipeline/drop/ARM/TemplateParametersForWorkspace.json
steps:
- task: PythonScript@0
displayName: 'Change SQL Pool'
inputs:
scriptSource: inline
script: |
search_text = 'synapsesqlpooldev'
replace_text = 'synapsesqlpoolqa'
with open(r'$(System.DefaultWorkingDirectory)/_Synapse-CI-pipeline/drop/ARM/TemplateForWorkspace.json', 'r') as file:
steps:
- task: AzureSynapseWorkspace.synapsecicd-deploy.synapse-deploy.Synapse workspace deployment@2
displayName: 'Synpase deployment task for workspace: synapse-qa'
inputs:
TemplateFile: '$(System.DefaultWorkingDirectory)/_Synapse-CI-pipeline/drop/ARM/TemplateForWorkspace.json'
ParametersFile: '$(System.DefaultWorkingDirectory)/_Synapse-CI-pipeline/drop/ARM/TemplateParametersForWorkspace.json'
azureSubscription: 'syn-sp'
ResourceGroupName: 'synapseQA-RG'
TargetWorkspaceName: 'synapse-qa'
OverrideArmParameters: '-LS_AKV_QA_properties_typeProperties_baseUrl https://synapse-qa.vault.azure.net/'
# The pipeline copies files from workspace publish branch and publishes artifact
# @author Kunal Das
# @version 1.0
# @since 10-11-2022
name:
-synapse-CI-low
trigger:
- workspace_publish
pool:
steps:
- bash: |
git config --global user.email "[email protected]"
git config --global user.name "Azure DevOps"
REPO="$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_git/$(Build.Repository.Name)"
EXTRAHEADER="Authorization: Bearer $(System.AccessToken)"
git -c http.extraheader="$EXTRAHEADER" clone $REPO
cd $(Build.Repository.Name)
@kunalworldwide
kunalworldwide / publishartifact.yaml
Created December 26, 2022 16:19
PublishPipelineArtifact@1 task of azure devops pipeline
- task: PublishPipelineArtifact@1
displayName: 'Publish Pipeline Artifact'
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifact: drop
az synapse workspace firewall-rule create --name devops-build-agent-ip\
--workspace-name synapse-prod --resource-group synapse-prod-rg --yes
steps:
- task: AzureCLI@2
displayName: 'Add Build agent Ip to firewall'
inputs:
azureSubscription: 'sp-dev'
scriptType: ps
scriptLocation: inlineScript
inlineScript: 'az synapse workspace firewall-rule create --name devops-build-agent-ip --workspace-name qa1-ause-asy-01 --resource-group QA1-AUSE-ASY-ARG-01 --start-ip-address (Invoke-RestMethod http://ipinfo.io/json | Select -exp ip) --end-ip-address (Invoke-RestMethod http://ipinfo.io/json | Select -exp ip)'