I realize this extraordinarily late to the game, but I came across this blog post that demonstrates using a task in a pipeline yaml file to start the service on a Windows hosted agent:
http://jannikbuschke.de/blog/azure-devops-enable-mssqllocaldb/[
^]
Basically it's this task:
- task: PowerShell@2
displayName: 'start mssqllocaldb'
inputs:
targetType: 'inline'
script: 'sqllocaldb start mssqllocaldb'
On a Linux hosted agent, only MS SQL tools are available, it would probably be best to use a custom Docker container with SQL Server for Linux (Express) and the Azure DevOps agent.