View on GitHub

SqlBuildManager

SQL Build Manager is an all-in-one database management tool to easily update your fleet SQL Server databases - from one to tens of thousands.

Template Scripts reference

NOTE: All scripts will require the Azure CLI be installed. See here for installation instructions.


create_azure_resources.ps1

This is a one-stop script for creating all of the resources you will need to leverage SQL Build Manager.

It will always create these Azure resources:

It will also create:

You can change this behavior by providing a -testDatabaseCount value of 0 (zero) to skip the creation of the SQL resources or a different positive integer to change the number of databases per server

And finally it will:


azuredeploy.bicep

The Azure Bicep file that is used to generate the azuredeploy.json ARM template for the creation of the Storage Account. Batch Account, Service Bus Topic, Event Hub, Key Vault and Managed Identity


azuredbdeploy.bicep

The Azure Bicep file that is used to generate the azuredbdeploy.json ARM template for the creation of the Azure SQL Servers, elastic pools and data bases


add_secrets_to_keyvault_fromprefix.ps1

Collects secrets from resources in the specified resource group with the matching $prefix values and saves them to Azure Key Vault. To specify your own resource names, use add_secrets_to_keyvault.ps1


build_and_upload_batch_fromprefix.ps1

Builds the sbm.csproj for both Windows and Linux and uploads the zip files into the proper Azure Batch application for the Azure Batch account in the resource group with the associated name $prefix. To specify your own resource names, use build_and_upload_batch.ps1. You can upload only if you have created zip packages on your own with the -uploadonly $true argument


create_aci_settingsfile_fromprefix.ps1

Creates a settings file settingsfile-linux-aci-queue-keyvault.json file that include ACI information, Key Vault name and additional settings for ACI builds for resources matching the $prefix values. To specify your own resource names, use create_aci_settingsfile.ps1


create_aks_cluster.ps1

Deploys an AKS cluster and associates it with the appropriate user assigned Managed Identity


create_aks_settingsfile_fromprefix.ps1

Creates settingsfile-k8s.*.json files that include all of the information used to execute Kubernetes builds for resources matching the $prefix values. To specify your own resource names, use create_aks_settingsfile.ps1


create_batch_settingsfiles_fromprefix.ps1

Creates 6 Azure batch settings-*.json files that include the secrets and values for the Azure resources created in the target resource group with the target name prefix. To specify your own resource names, use create_batch_settingsfiles.ps1


create_database_firewall_rule.ps1

By default, creates firewall rules for the Azure SQL databases created in the target resource group that match the current machine public IP address. Can also be used to create a rule for a specific IP address by adding the -ipAddress parameter. This is useful when running integration tests from your local machine.


create_database_override_files.ps1

Creates two database target override config files databasetargets.cfg and clientdbtargets.cfg, pulling that information from the Azure resources created in the target resource group. These files are used by the integration testing project.