powershell 将Microsoft Fabric的Synapse数据仓库连接到Azure DevOps CI/CD发布管道

h5qlskok  于 5个月前  发布在  Shell
关注(0)|答案(1)|浏览(42)

我有一个Microsoft Fabric仓库,我们在Azure DevOps中有几个脚本,我们的目标是通过CI/CD发布管道执行。我正在寻求有关在Azure DevOps和Microsoft Fabric中的发布管道之间建立连接的指导。此外,这里是我们用于运行Fabric脚本的PowerShell脚本:

# 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
}
}

字符串
我还尝试使用服务主体和个人访问令牌,但没有成功。

7vux5j2d

7vux5j2d1#

我还尝试使用服务主体和个人访问令牌,但没有成功。
在使用服务主体时是否有任何错误消息?
通过查看文档CI CD in Azure Synapse Analytics,我建议您可以为资源组创建Azure Resource Manager服务连接,以连接Synapse Data Warehouse。
您可以查看下面的步骤。
1.为资源组创建Azure资源管理器服务连接。
https://learn.microsoft.com/en-us/azure/devops/pipelines/library/service-endpoints?view=azure-devops&tabs=yaml&preserve-view=true
1.给予我们的Azure DevOps Service Principal访问Azure Synapse Workspace的权限。
https://techcommunity.microsoft.com/t5/data-architecture-blog/ci-cd-in-azure-synapse-analytics-part-4-the-release-pipeline/ba-p/2034434
1.添加一个“Azure PowerShell”任务并选择在步骤1中创建的服务连接,然后编写要运行的脚本,看看是否适合您。


的数据

相关问题