Search code examples
azure-devopsazure-keyvaultsql-server-data-toolsdacpacsqlpackage

Azure Devops SQL DacpacTask failing for Azure Key Vault


I'm trying to deploy a dacpac to an Azure Sql Database with Always encrypted enabled. The Devops agent is running in a self-hosted VM with sqlpackage.exe version 19 with build 16.0.5400.1 installed on it.

I've been able to trace down the issues by adding /diagnostics as an argument to the task and the exception that is raised is:

Unexpected exception executing KeyVault extension 'Object reference not set to an instance of an object.' at Microsoft.SqlServer.Dac.KeyVault.DacKeyVaultAuthenticator.Validate(IList`1 keyVaultUrls, CancellationToken cancelToken)

Anybody have a suggestion on how to solve this?


Solution

  • I managed to find a solution. I downgraded the sqlpackage.exe version. If I understand it correctly apparently version 19 seems to be targeted for SQL Server compatibility level 160 which is shipped with SQL Server 2022. When using version 18 it seems to be working with the current 150 that my Azure DB is set to.