Liquibase Enterprise was formerly known as Datical DB.
Azure REST API for the Ephemeral Deploy Packager Process
Liquibase Enterprise uses the Azure REST API to perform a point-in-time restore during packaging for Azure SQL Managed Instances. The Deployment Packager uses the Azure REST API to manage backup and restore operations for the reference database.
You can authenticate with the Azure SQL Database REST API using certificates and a Client Secret
. In your Azure REST API settings, you can choose Certificate Authentication or Client Secret Authentication. Also, the following attributes are available in the Datical DB GUI:
Azure Client ID
Azure Tenant ID
Azure Client Secret (for Client Secret Authentication only)
Azure Resource Group
Azure Subscription ID
The REST API Client Secret is a sensitive credential. For this reason, it is strongly recommended that this credential be provided at runtime in an environment variable and not stored in the GUI. For more information, see the Runtime Credentials documentation.
Azure REST API Settings
Azure REST API settings contain the information about Azure SQL Managed Instance (subscriptionId
, tenantId
, and resourceGroup
) and service principal (password
and appId
, which are Azure Client Secret
and Client ID
).
Azure REST API settings are only required for Packager
processes to support restore and backup operations. You don’t need to configure the Azure REST API settings to execute other commands such as Deploy
, Forecast
, and others.
Client Secret Authentication
A Client Secret Authentication requires two service principal attributes and the Azure SQL Managed Instance information – Azure Client Authentication
and Client ID
. Thus, you need to create a service principal to get a bearer token and initiate a point-in-time backup for Azure SQL Managed Instance.
An Azure service principal is an identity created for use with applications, hosted services, and automated tools to access Azure resources. The roles assigned to the service principal have control over which resources can be accessed and at which level. For more information, see Create an Azure service principal with the Azure CLI or Create a service principal using the Azure portal.
A bearer token is a security token that grants access to a protected resource. For more information, see OAuth 2.0 and OpenID Connect protocols on the Microsoft identity platform.
You can create a service principal through the Azure portal or CLI. You must have an Owner
role and specify it along with the resource group.
Once a service principal is successfully created, ensure the following attributes are available:
appId (Client ID)
password (Client Secret)
This configuration focuses on a single-tenant application run within only one organization. You must have your permissions set to register an application with your Azure AD tenant and assign a role to the application in your Azure subscription. Also, when you register an application through the Azure portal, an application object and service principal is automatically created in your home directory or tenant.
Using Client Secret Authentication
Client Certificate Authentication
Client Certificate Authentication requires the Azure SQL Managed Instance information and the service principal attribute – Client ID
. To use a certificate authentication mechanism, you also need:
X509
certificates.A private key in a
pks8
format. You should decrypt it and use it without a password.Environment variables:
DDB_AZURE_CLIENT_CERT
is an absolute path to the client certificate.DDB_AZURE_CERT_KEY
is an absolute path to the private key for the client certificate.
Creating a Service Principal
An Azure service principal is an identity created for use with applications, hosted services, and automated tools to access Azure resources. The roles assigned to the service principal have control over which resources can be accessed and at which level. For more information, see Create an Azure service principal with the Azure CLI or Create a service principal using the Azure portal.
You can create a service principal through the Azure portal or CLI. You must have an Owner
role and specify it along with the resource group.
Once a service principal is successfully created, ensure the appId
(Client ID
) attribute is available.
Creating a Client Certificate and Private Key Using the OpenSSL Utility
To create an X509
certificate and private key, follow these steps:
In your OpenSSL, run the command by replacing values from the example with the values you use:
The command will create the azure_test_certificate.crt
certificate file and azure_test_pk.key
private key file without a password.
Change the format of a private key file from
PEM
topks8
and decrypt it by running the following command and using your values:
The command will create azure_test_pk_decrypted.key
, which you can use for Azure Active Directory Client Certificate Authentication in Datical DB.
Uploading a Client Certificate to Azure App Registrations
Log in to your Microsoft Azure account.
Go to Azure Active Directory and select App registrations on the left side of the page.
Select All applications and choose an app that you want to use for the Azure SQL Managed Instance deployment.
On the left side of the page, select Certificates & secrets.
Select Upload certificate and upload the generated certificate.
Once you have the certificate and private key, you can use Azure Active Directory Client Certificate Authentication and run Deploy Packager.
Using Client Certificate Authentication
Copyright © Liquibase 2012-2022 - Proprietary and Confidential