Forum Discussion

Data3ngneersu's avatar
Data3ngneersu
Copper Contributor
Nov 13, 2023

Connecting Synapse Data Warehouse of Microsoft Fabric to Azure DevOps CI/CD Release Pipeline

I have a Microsoft Fabric warehouse, and we have several scripts in Azure DevOps that we aim to execute through a CI/CD release pipeline. I'm seeking guidance on establishing a connection between our release pipeline in Azure DevOps and Microsoft Fabric. Additionally, here is the PowerShell script we use to run the Fabric scripts:

 

# Define authentication details for Azure Synapse SQL Data Warehouse
$userName = " xx"
$password = "yy"

# Define the Azure Synapse SQL Data Warehouse server name
$connectionString = " V7PULMP2UPRULHPJ3OYUMXKS7Y-ZDY7HCDTEL2EJLFT4SSIWSHTVA.datawarehouse.pbidedicated.windows.net" 
$databaseName = "MSF warehouse"

# Loop through all files in the specified directory
$sqlFiles = Get-ChildItem -Path "$(System.DefaultWorkingDirectory)\_copy directory\build artifact\ELT\scripts"

foreach ($file in $sqlFiles) {
if ($file.Extension -eq ".sql") {
Write-Host ("Executing SQL file: " + $file.Name)
$sqlFilePath = $file.FullName

# Run the SQL script using SQLCMD (or use Invoke-Sqlcmd if available)
sqlcmd -S $connectionString -d $databaseName -U $userName -P $password -i $sqlFilePath
}
}

No RepliesBe the first to reply

Resources