Since K2, the Kladde has been running on Azure SQL. azd created the database back then, in module 3.2 you brought the infrastructure into the repository as Bicep of your own, and in lesson 3.3.1 the server lost its last password: the app signs in with its managed identity. So the database works. In this lesson you take a closer look: what kind of Azure SQL is this, what does it cost, when does it sleep, who can reach it over the network, and how does a schema change get in without the app doing it itself?
At the end of the lesson, the pipeline has a stage of its own for the migrations. It runs before the rollout, with an identity that may change the schema. After that, the app itself no longer may.
SQL Server in Azure: three forms
The same database engine you had in a container in K2 comes in three forms in Azure. They differ in how much Azure takes off your hands and how much of SQL Server you still see yourself.
| Form | What you get | When it fits |
|---|---|---|
| SQL Server on a virtual machine | a whole server with an operating system, you patch and back up yourself (IaaS) | software that needs exactly one version or access to the operating system |
| Azure SQL Managed Instance | a whole SQL Server instance as a service, with SQL Agent, queries across several databases and a virtual network of its own | moving an existing application with many databases that needs instance features |
| Azure SQL Database | a single database as a service (PaaS), Azure takes care of patches, backups and high availability | new applications like the Kladde |
Azure SQL Database comes as a single database or in an elastic pool. A pool is a shared pot of compute that many databases share. It pays off when many small databases work at different times, such as one database per customer. The Kladde has one database and needs no pool.
Every database belongs to a logical server. That is not a machine you see, but a management object with a name
(<name>.database.windows.net), an Entra administrator and firewall rules. The compute sits at the database, not at the server.