To use the cloud-based Azure Database for PostgreSQL, create an an account for yourself and then do the following.

  1. Configure a database management instance as specified in the Quickstart tutorial but choosing cheaper, low-performance options — try to get the estimated cost in the right column down to around $15–20/month, which your Azure for Students account can handle for the rest of the semester (and beyond). We suggest setting the following non-default alternatives:

    1. Basics
      • Subscription/Resource Group: Use your free student account and, if haven’t already done so, create a new resource group.
      • Region: Choose something other than EastUS.
      • Workload type: Development
      • Compute + Storage — Configure a server with:
        • Compute tier: Burstable
        • Compute size: Standard B1ms
      • High availability: Disabled
      • Authentication method: PostgreSQL authentication only
      • Administrator login and password: Remember these!

    2. Networking
      • Allow public access using a public IP address.
      • Allow access from any Azure service.
      • To run monopolyDirect, add a firewall rule name for your local machine. This is not required for the web service.
    3. Review and create the service.

    You can monitor your expenses on your Azure for Students “Subscription” page. To save student credits for future courses, you can tear down this database instance when your labs 7–9 and homework 3 have been graded, or, at the latest, by the end of the semester.

  2. Create the monopoly database as follows.

    1. There are several ways to “connect” to your database instance, but we suggest the following, simple approach:
      1. Start an Azure Cloud Shell session by clicking on the Cloud Shell icon on the top bar of the Azure portal.
      2. Go to the database instances’s SettingsConnect→Connection details, and cut/paste the export commands (with your password edited in) into your cloud shell session.
      3. Then run psql in the cloud shell session.
      This gives you BASH/PSQL command-line access to your database. You can find details under the “Get the connection information” CLI tab.
    2. Cut/paste the contents of this SQL command file into the cloud shell session. This builds the monopoly database from scratch.

    3. You can test the database by running this simple query:
      SELECT * FROM Player;
      which should return three monopoly player records.

    You should now be set to continue with the lab exercises.

You could consider using the VS Code PostgreSQL extension to connect to your database, which allows you to work with your database locally, within VScode.