Azure
Microsoft Azure
autobase will automatically set up the following in Azure:
- Azure Virtual Machines (with a dedicated data disk), with all cluster components installed and configured.
- Azure Load Balancer to serve as the entry point for database connections.
- Azure Blob Storage, and configured backups using pgBackRest.
All components are installed within your cloud account.
Prerequisites
You will need the necessary details (AZURE_SUBSCRIPTION_ID, AZURE_CLIENT_ID, AZURE_SECRET, AZURE_TENANT) to deploy the cluster to your Azure account. See the official documentation for instructions on creating an service principal.
You can either add these credentials in advance on the Settings page under the Secrets tab, or you will be prompted to enter them during the cluster creation process.
- Console (UI)
- Command line
Select 'Azure' as the destination and choose the deployment region.
Select the type of server with the required amount of CPU and RAM.
Select the number of servers to be created for the PostgreSQL cluster.
Please note that at least 3 servers are required to ensure high availability.
Specify the desired disk size for the database.
Specify your SSH public key to be able to access the database servers via SSH after deployment.
Choose which environment your database cluster belongs to.
Specify a name for your cluster.
Optionally, specify a description.
Select the PostgreSQL version to install.
Review the summary and click the "CREATE CLUSTER" button.
Wait until deployment is complete. This process takes about 10 to 15 minutes.
You can see the deployment log in the "Operations" section. To do this, select the relevant event with the "deploy" type and click "Show details" under the Actions tab.
After a successful deployment, you can obtain the connection info on the cluster page. To do this, click on the name of your cluster on the "Clusters" page.
Example of a cluster page:
📩 Contact us at [email protected], and our team will provide you with deployment instructions tailored specifically to your infrastructure, including the most suitable parameters for optimal performance and reliability.
1. Set Azure credentials
Export your Azure service principal credentials to an environment variable:
export AZURE_SUBSCRIPTION_ID=<value>
export AZURE_CLIENT_ID=<value>
export AZURE_SECRET=<value>
export AZURE_TENANT=<value>
2. Run the Deployment Command
Execute the following command to deploy a PostgreSQL cluster (example):
docker run --rm -it \
--env AZURE_SUBSCRIPTION_ID=${AZURE_SUBSCRIPTION_ID} \
--env AZURE_CLIENT_ID=${AZURE_CLIENT_ID} \
--env AZURE_SECRET=${AZURE_SECRET} \
--env AZURE_TENANT=${AZURE_TENANT} \
autobase/automation:2.1.0 \
ansible-playbook deploy_pgcluster.yml --extra-vars \
"ansible_user=azureadmin \
cloud_provider='azure' \
cloud_load_balancer=true \
server_count=3 \
server_type='Standard_D4s_v5' \
server_location='eastus' \
volume_size=100 \
postgresql_version=17 \
patroni_cluster_name='postgres-cluster-01' \
ssh_public_keys='ssh-rsa AAAAB3NzaC1yc2EAAAA******whzcMINzKKCc7AVGbk='"
Key Parameters:
cloud_provider
: Specifies Azure as the provider.cloud_load_balancer
: Adds a Azure Load Balancer to the cluster.server_count
: Number of servers in the cluster (at least 3 servers are needed for high availability).server_type
: Type of servers (e.g., 'Standard_D4s_v5' for 4 vCPU 16 GB RAM).server_location
: Server location (e.g., 'eastus' for East US Virginia).volume_size
: Disk size (in GB) for the database.postgresql_version
: PostgreSQL version.patroni_cluster_name
: PostgreSQL cluster name.ssh_public_keys
: Your SSH public key to access the database servers after deployment.
See the vars/main.yml, system.yml and (Debian.yml or RedHat.yml) files for more details. As well as a list of available variables for cloud resources.
3. Wait until deployment is complete
This process takes about 10 to 15 minutes.
After a successful deployment, the connection information can be found in the Ansible log.