Azure Database Quickstart

Deploy your first database on Azure in minutes.

Deploy a Database to Azure

This guide will walk you through the essential steps to deploy a database service on Microsoft Azure. We'll cover creating the resource, configuring it, and connecting to it.

Prerequisites

Before you begin, ensure you have the following:

  • An Azure account. If you don't have one, sign up for a free account.
  • The Azure CLI installed and configured (optional but recommended for command-line operations).

1. Create a Database Resource

You can create a database resource through the Azure portal or Azure CLI. For this quickstart, we'll use the Azure portal.

Navigate to the Azure portal.

In the search bar, type "Azure Database for PostgreSQL" (or your preferred database service like Azure SQL Database or Azure Cosmos DB) and select it from the results.

Click Create.

Fill in the required details, including your subscription, resource group, server name, administrator username, and password. Choose a region close to you.

Azure Portal Database Creation

Select a pricing tier suitable for your needs. For testing, the basic tier is usually sufficient.

Review your settings and click Create.

2. Configure Network Access

By default, your database server might not be accessible from public networks. You need to configure firewall rules.

Once your database resource is deployed, navigate to its overview page in the Azure portal.

Under Settings, select Connection security.

Under Firewall rules, click Add current client IP address to allow access from your current location. You can also add specific IP ranges.

Note: For production environments, consider more secure connectivity options like Virtual Networks.

3. Connect to Your Database

Now that your database is deployed and accessible, you can connect to it using your favorite database tools.

Using Azure Data Studio

Azure Data Studio is a cross-platform database tool that works well with Azure databases. Download and install it if you haven't already.

In Azure Data Studio, create a new connection using the connection string details from your Azure database resource. You'll need the server name, username, and password you created earlier.

Example Connection Details:

Server Name: <your-server-name>.postgres.database.azure.com
Database: postgres
Username: <your-admin-username>
Password: <your-admin-password>
Using psql (Command Line)

If you have psql installed, you can connect from your terminal.

psql --host=<your-server-name>.postgres.database.azure.com --username=<your-admin-username>@<your-server-name> --dbname=postgres --no-password

You will be prompted for your password.

Next Steps

Congratulations! You have successfully deployed a database to Azure. Here are some resources to help you further:

Learn more about Azure SQL Database

Explore the full capabilities of Azure SQL Database, including performance tuning and high availability.

Go to Docs
Secure your PostgreSQL database

Discover best practices for securing your Azure Database for PostgreSQL instance.

Security Guide
Build an application

Integrate your new database with your applications using various programming languages.

App Integration