chapter twenty one

21 DevOps automation

 

The previous chapters have given you a grounding in dbatools in various areas that relate to a classic database administrator’s role. This chapter will show some examples of ways that you can use dbatools within "A DevOps Process".

First though, we need a definition. You can find a hundred different definitions and understandings of the term DevOps. We like this one from Microsoft azure.microsoft.com/overview/what-is-devops

A compound of development (Dev) and operations (Ops), DevOps is the union of people, processes and technology to continually provide value to customers.

The quote resonates with us because we believe that being able to continually provide value to customers requires people and processes and technology. dbatools is not going to be able to solve DevOps for you but it is a tool (technology) that you (a person) can use within your processes to provide that value.

Overall, though, DevOps means different things to different people, which is why you’ll often find varying definitions. In a conversation with PowerShell MVP and DevOps Engineer Chris Gardner, Chris said "I see a DevOps Engineer as kind of a one-size-fits-all title, but the actual work involved will vary."

21.1 When should you use dbatools in DevOps?

21.2 DACPAC

21.2.1 Exporting a DACPAC from an existing database

21.2.2 Publishing a DACPAC

21.2.3 DACPAC Options

21.3 Running dbatools (and PowerShell) on a CI/CD system

21.3.1 Creating a task

21.3.2 Ensure the dbatools module is available

21.3.3 Understand how to add parameters to the script

21.4 Hands-on Lab