Azure Database

Learn how to provision databases in instances running in an Azure Database


Azure Databases are way of providing relational databases in the cloud. Azure Databases are available for several engines including PostgreSQL, MySQL, MariaDB, SQL Server. At this time, Humanitec provides out of the box support for PostgreSQL, MySQL and MariaDB types with SQL Server coming soon.

Creating a resource definition for an Azure Database managed instance

You can easily connect Humanitec to an Azure managed database instance. The following paragraph explains how.
If you are experimenting with Humanitec and Azure Databases, we recommend that you start with a public i as this is the easiest to debug.
  1. 2.
    Click on the Show all resources button. An overlay with all available resource categories and types will be presented to you.
  2. 3.
    Below Data storages click on the type of database you want to create. This will open an overlay.
  3. 4.
    Choose an ID that you will use to identify the resource definition in Humanitec later.
  4. 5.
    Select a driver, here - mariadb. Based on your resource driver, a form will be shown with the required driver parameters which will be passed to the driver on every resource creation.
  5. 6.
    Fill out the connection parameters that Humanitec will use to create/delete databases in the instance. You can find them in the Database section of the Azure Console.
    • Host is called "Server name" in the console.
    • Username and Password are the user and password you created when you set up the instance or a user with privileges to create users and databases in the instance that you subsequently created.
    • It is vital to ensure the "Append host to user" option is selected.
  6. 7.
    Click on Create.
Steps 1 - 3 of creating a resource definition for an AWS managed instance
Steps 4-8 of creating a resource definition for an AWS managed instance
Our CLI is currently in closed beta. Please contact us if you want to learn more.
Dynamic resource definitions can be created via the Create Resource Definition endpoint.

Define Matching

Next, you can configure matching criteria for your database. This enables you to define specific environments or applications to be deployed to this resource.
By clicking on your database in the list of resources, the Matching row will expand and allow you to add or remove matching criteria. Each database resource can be matched to specific Environment Types, App IDs, Environment IDs or Resource IDs. Empty fields are automatically resolved to match all values of the given category.
Define Matching
Based on this Resource Definition, during the deployment on any of the matching environments, an Active Resource will be provisioned if required.
Our CLI is currently in closed beta. Please contact us if you want to learn more.
Matching criteria can be created via the Create new Matching Criteria endpoint.

Creating a resource definition for a private Azure Database managed instance

The most common configuration for an Azure Database instance is for it not to be publicly accessible. This is achieved by placing it in a private VNet. The instance will only be accessible to compute running in that VNet or in VNets that are peered to it.
In order to administer a private instance, it is common to set up a bastion host or jump server. Humanitec can be configured to use such a server to connect to a private RDS instance.

Configuring the bastion host

If you do not already have a bastion host set up to administer your instance, you can follow this guide provided by Azure: [Tutorial: Deploy Bastion using manual settings]](
Once the bastion host is set up, it will need to be configured to allows connections from Humanitec. This is done by adding the Humanitec public key into the .ssh/authorized_keys file on the bastion host.