The Order Book runs on LocalDB, and for the pilot customer, the web API and later the Container Apps, the database has to be reachable from outside, backed up and maintained. This lesson moves the database to Azure SQL. It does so first locally, from one LocalDB database to another, because the technique is the same and a mistake costs nothing there. The step to Azure is optional and ends with the teardown. Azure basics and databases in the cloud are covered in K3, modules 3.1 and 3.6; here is only what the Order Book makes of them.
The options
Microsoft's documentation names three products of the Azure SQL family that use the same SQL Server database engine:
| Product | Kind | Microsoft describes it as | For the Order Book |
|---|---|---|---|
| Azure SQL Database | platform as a service | managed service for modern cloud applications, with a single database or a pool, with serverless compute as an option | the first choice |
| Azure SQL Managed Instance | platform as a service | nearly full feature parity with SQL Server, "best for most migrations" | if the database needs features that Azure SQL Database does not have |
| SQL Server on Azure VMs | infrastructure as a service | full control over engine and operating system, but the virtual machine is your job | only if you need access to the operating system |
The question Microsoft poses for the choice is: Do you want to manage your database yourself, apply updates and make backups, or do you want to leave that to Azure? On top of that comes what the application needs. Microsoft points out that not all SQL Server features are available in Azure SQL Database and that migration can be hard for applications with dependencies on the operating system or on SQL Server Agent; the CLR is given there as an example.
So before you decide, check what the Order Book actually uses. The inventory from lesson M1.3 listed it: three tables, one trigger, one procedure, one view and one role (since lesson M3.3); no SQL Server Agent jobs, no CLR, no access to files on the server. That speaks for Azure SQL Database. The feature list in Microsoft's documentation (under "Further reading") is the source against which you check every feature of your own database; the move test below is the proof for ours.
The lesson leaves two decisions within Azure SQL Database open and enters them in the modernization plan: the compute model (Microsoft describes a serverless one with automatic pause and a provisioned one) and the redundancy. Both depend on how often and when the Order Book is used, and you will know that better after the pilot than now.