Using SQL Server Express LocalDB in Azure DevOps

AzureDevOps

Actually it is quite easy to use SQL Server Express LocalDB in Azure DevOps. The service just needs to be started with a command line (i.e. using the Powershell task):

- task: PowerShell@2
  displayName: 'start mssqllocaldb'
  inputs:
    targetType: 'inline'
    script: 'sqllocaldb start mssqllocaldb'

In all subsequent tasks, the database engine can be used. I.e. following connection string is valid:

Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=my-db;Integrated Security=True;