I need help with configuring a local SQL Server database for my Azure DevOps pipeline testing.
Background:
I’m working on a C# application that requires a SQL Server database connection. My team needs to run automated tests through Azure DevOps pipelines using windows-latest hosted agents. The application has a utility that restores the database from backup files and runs SQL scripts to populate test data.
The Problem:
Most documentation I’ve found covers connecting to external SQL servers or manual installations. I haven’t seen good examples of creating a temporary SQL instance directly inside the pipeline VM for testing purposes.
Current Setup:
Locally we use SQL Server Express 15.0.2130 and manage everything through SSMS. Our app depends on database data during startup, so we need the database ready before running tests.
Question:
What’s the best approach to spin up a SQL Server instance within the Azure DevOps pipeline VM? Is there a reason this approach isn’t commonly documented? I’m looking for a way to create a temporary database environment that gets torn down after tests complete.
Any guidance on implementing this would be really helpful. I want to make sure our CI/CD process can fully validate the application without external dependencies.