Skip to content

Instantly share code, notes, and snippets.

@davidsantiago-bib
Last active June 13, 2019 09:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save davidsantiago-bib/6e13e99c2d13a715b1e23689dcc28698 to your computer and use it in GitHub Desktop.
Save davidsantiago-bib/6e13e99c2d13a715b1e23689dcc28698 to your computer and use it in GitHub Desktop.
# Create resource group named DjangoAppRG
$ az group create --name DjangoAppRG --location "West Europe"
# Create Azure Database for PostgreSQL server named pgdemoserver
$ az postgres server create --resource-group DjangoAppRG --name pgdemoserver --location westeurope --admin-user myadmin --admin-password ThisIs4P4ssw0rd!=1 --sku-name B_Gen5_1
# Allow access to Azure services
$ az postgres server firewall-rule create -g DjangoAppRG -s pgdemoserver -n allowall --start-ip-address 0.0.0.0 --end-ip-address 0.0.0.0
# Connect to the DB
$ psql --host=pgdemoserver.postgres.database.azure.com --port=5432 --username=myadmin@pgdemoserver --dbname=postgres
# Create Django database named djangodb
postgres=> CREATE DATABASE myproject;
postgres=> \q
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment