Member-only story

Enhance Azure SQL post-deployments privately with Bicep

Gijs Reijn
6 min readNov 19, 2023

--

Figure 1: Pre- and post-deployment scripts on Tech Community

After deploying a database in your enterprise environment, certain tasks must be performed for each introduced database. While using pre- or post-deployment scripts using DacPac method is an option for databases, consider scenarios where tasks outside Azure SQL are necessary yet remain integral to your overall deployment strategy.

These tasks can consist of:

  • Create database users
  • Seeding database
  • Setup required database configuration
  • Adding keys from Azure Key Vault

Hence, having all your configurations accessible in your Infrastructure as Code (also known as Iac) through Bicep can prove beneficial.

Within this guide, you will utilize the deploymentScripts resource for carrying out post-deployment tasks on Azure SQL. This article complements the content of “Efficient database management on Azure SQL — Leveraging Microsoft Entra ID for maintenance tasks.” If you wish to follow this guide step-by-step, ensure that you have completed that tutorial beforehand.

Setup Azure Virtual Network
Deployment scripts are resources created within Azure and run under a Container Instance. You can use Azure PowerShell or Azure CLI to execute the scripts you want. As Azure SQL is not…

--

--

Gijs Reijn
Gijs Reijn

Written by Gijs Reijn

Sharing my experience through the IT world. Tutorials, guides, and opinions. Follow my newsletter at: http://eepurl.com/i1hSUw

No responses yet