0

Am using sqlpackage.exe for synapse deployment, version 162.0.52.1.

During the initialization, it stucks at this step:

enter image description here Does anybody know, how to solve it?

Pratik Lad
  • 4,343
  • 2
  • 3
  • 11
R. Maier
  • 340
  • 2
  • 13

2 Answers2

0

I tried publishing Dacpac File to Azure SQL and via sql.exe package and SqlAzureDacpacDeployment the Yaml pipeline ran successfully:-

I installed microsoft.sqlpackage in my agent and then checked the SQL package version, Then I ran sql.exe command to publish the dacpac file into Azure SQL. You can replace my sql.exe command below with yours. I also ran separate SQLAzureDacpacDeployment task. Refer below:-

My repository:-

enter image description here

YAML Script:-

trigger:
- master

pool:
  vmImage: windows-latest

steps:
- script: echo Hello, world!
  displayName: 'Run a one-line script'

- task: Bash@3
  inputs:
    targetType: 'inline'
    script: 'dotnet tool install -g microsoft.sqlpackage'

- script: SqlPackage /version
  workingDirectory: $(System.DefaultWorkingDirectory)
  displayName: 'get sqlpackage version'

- script: sqlpackage.exe /action:Publish /SourceFile:"$(System.DefaultWorkingDirectory)/Database1.dacpac"  /TargetServerName:"xxxxnserver.database.windows.net,1433" /TargetDatabaseName:"username" /TargetUser:"CloudSAbe337ad4" /TargetPassword:"Password"
  workingDirectory: $(System.DefaultWorkingDirectory)
  displayName: 'get sqlpackage version'
- task: SqlAzureDacpacDeployment@1
  inputs:
    azureSubscription: 'devopsappsilicon'
    AuthenticationType: 'server'
    ServerName: 'xxxxserver.database.windows.net'
    DatabaseName: 'silicondb'
    SqlUsername: 'username'
    SqlPassword: 'Password'
    deployType: 'DacpacTask'
    DeploymentAction: 'Publish'
    DacpacFile: '$(System.DefaultWorkingDirectory)/Database1.dacpac'
    IpDetectionMethod: 'IPAddressRange'
    StartIpAddress: '0.0.0.0'
    EndIpAddress: '255.255.255.255'

enter image description here

enter image description here

References:-

SqlPackage for Azure Synapse Analytics - SQL Server | Microsoft Learn

SqlPackage in development pipelines - SQL Server | Microsoft Learn

Pratik Lad
  • 4,343
  • 2
  • 3
  • 11
  • In my case, am using the Azure DevOps sql deployment task: https://github.com/microsoft/azure-pipelines-tasks/blob/master/Tasks/SqlAzureDacpacDeploymentV1/README.md It's also using the sqlpackage.exe and am adding these additional parameters: /p:DropObjectsNotInSource=TRUE /d /p:ExcludeObjectTypes="Permissions;Users;RoleMembership;Logins;ServerRoles;ServerRoleMembership;ExternalDataSources" I figured out, that it always stops here: Perf: Operation started (name, details): CompareAllElementsForOneType,SqlSchema So, sqlpackage in general works, but anything within DB not ok? – R. Maier Jul 19 '23 at 07:30
0

There were to less RAM on agent for the schema comparison there.

The schema comparison step of sqlpackage.exe increased the RAM utilization from 3GB to 14GB: enter image description here

In this case, there was a Azure DevOps Agent used for the execution. By default, there are only 7GB RAM available for hosted Agents: enter image description here

https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml#hardware

R. Maier
  • 340
  • 2
  • 13