Skip to content

Instantly share code, notes, and snippets.

@janjaali
Last active April 16, 2020 12:45
Show Gist options
  • Save janjaali/e911e5f1b64b107a3a4fb3e61f35116d to your computer and use it in GitHub Desktop.
Save janjaali/e911e5f1b64b107a3a4fb3e61f35116d to your computer and use it in GitHub Desktop.
Little cheatsheet for Azure Database for PostgreSQL

Create an "Azure Database for PostgreSQL"

az postgres server create --resource-group {resource_group} `
                          --name {server_name} `
                          --admin-user master `
                          --admin-password {password} `
                          --location westeurope `
                          --version 11 `
                          --sku-name B_Gen5_1 `
                          --storage-size 5120

In order to setup a database, user and password just execute the following commands:

CREATE DATABASE "databaseName";
CREATE USER "userName" WITH PASSWORD 'passwordValue';
GRANT ALL PRIVILEGES ON DATABASE "userName" TO "databaseName";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment