Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Task 01 - Create Azure Database for PostgreSQL

Description

In this task, you will create a new PostgreSQL database that will be the target for the database migration.

Success Criteria

  • Create a new database hosted in Azure Database for PostgreSQL - Flexible Server that will be the target for the database migration.

Solution

Expand this section to view the solution
  1. Sign in to the Azure Portal. Ensure that you’re using a subscription associated with the same resources you created during the Lab setup.

  2. On the Home page within the Azure Portal, towards the top, select Create a resource.

    Create a resource on Azure Portal Home page.

  3. Within the Search services and marketplace field, type PostgreSQL flexible, press Enter, then select Azure Database for PostgreSQL Flexible Server in the search results.

    The Azure Database for PostgreSQL result shown in the marketplace.

  4. Select Create.

    The Flexible Server option is selected with the create button highlighted.

  5. On the Flexible Server pane, select the following values:

    1. Resource group: Select the resource group that you created for this lab. Such as terrafirm-rg.
    2. Server name: Enter a unique name, such as terrafirm-postgresql-db.
    3. Region: Select the Azure Region that was used to create the resource group.
    4. PostgreSQL version: 16.0
    5. Workload Type:Development

    The Flexible Server pane is shown with values entered.

  6. Under Compute + storage click Configure server and on the resultant pane choose
    1. General Purpose (2-96 vCores) - Balanced configuration for most common workloads**
    2. In Compute Processor Choose Intel

    Configuring the Flexible Server for migration

    1. In Compute size choose the lowest compute size to save costs for the lab exercises. Currently this is Standard_D2ds_v5 (2 vCores, 8GiB memory, 3750 max iops)

    Configuring the compute size of the Flexible Server

    1. In High availability Choose Disabled (99.9% SLA)
    2. Click Save

    Setting the High Availability settings

  7. On the resultant page, under Authentication, set the Authentication method to PostgreSQL authentication only, set the Admin username and Password for the PostgreSQL admin account.

    Administrator account credentials are set.

    Note: Be sure to save the Admin username and Password, so it can be used later. A recommendation for an easy to remember Username is pgadmin and it is recommended you use a secure password. Important For your password use at least 12 characters, combine uppercase and lowercase letters, numbers, and special characters. Avoid common words and personal information.

  8. Select Next: Networking »

Next Networking button highlighted.

  1. Go to Firewall rules to configure access to allow the web application on the terrafirm-onprem-app-vm virtual machine to connect to the database.

  2. Remove the Public access to the Flexible Server

    Networking pane with no public access.

  3. Add a new Private endpoint to the Flexible Server for internal and secure access from the VMs by cliking on Add private endpoint:

    Networking pane with creation of a private endpoint.

    1. Location: Same Region as your other resources
    2. Name: Enter a name like the example given
    3. Virtual network: Choose the SPOKE network
    4. Subnet: Choose the subnet called default which is 10.2.0.0/24
    5. Do not integrate with Private DNS - setting up Private DNS is beyond the scope of this training, you will use an IP address rather than a DNS entry when connecting.

    Setup of a private endpoint and save hihglighted.

Click OK.

  1. Select Review + create.

    Review + create button

  2. Select Create to provision the service.

    The Review + create screen with Create button highlighted.

  3. Click Create server without firewall rules - as we will use the private endpoint for access

    Ignore the "Configure IP address in firewall rules" popup

  4. Once provisioning has completed navigate to the Azure Database for PostgreSQL resource that was just created, copy and save the Server name for use later.

    The Azure Database for PostgreSQL server name is highlighted.

  5. On the left menu pane, under Settings select Databases.

    Databases link is hihghlighted.

  6. Select + Add to create a new database.

    Add database button is highlighted.

  7. On the Create Database pane, enter northwind in the Name field, then select Save. This will create a new PostgreSQL database that will be the target for the database migration.

    The Create database pane is shown with values entered.

You are now ready to begin the migration task of this lab.