{"id":11498,"date":"2018-08-13T11:53:12","date_gmt":"2018-08-13T09:53:12","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/bringing-up-your-customized-postgresql-instance-on-azure\/"},"modified":"2018-08-13T11:53:12","modified_gmt":"2018-08-13T09:53:12","slug":"bringing-up-your-customized-postgresql-instance-on-azure","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/bringing-up-your-customized-postgresql-instance-on-azure\/","title":{"rendered":"Bringing up your customized PostgreSQL instance on Azure"},"content":{"rendered":"<p>The Azure cloud becomes more and more popular so I gave it try and started simple. The goal was to provision a VM, compiling and installing PostgreSQL and then connecting to the instance. There is also a <a href=\"https:\/\/azure.microsoft.com\/en-us\/services\/postgresql\/\" target=\"_blank\">fully managed PostgreSQL service<\/a> but I wanted to do it on my own just to get a feeling about the <a href=\"https:\/\/github.com\/Azure\/azure-cli\" target=\"_blank\">command line tools<\/a>. Here is how I&#8217;ve done it.<\/p>\n<p><!--more--><\/p>\n<p>Obviously you need to login which is just a matter of this:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\ndwe@dwe:~$ cd \/var\/tmp\ndwe@dwe:\/var\/tmp$ az login\n<\/pre>\n<p>For doing anything in Azure you&#8217;ll need to create a <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/azure-resource-manager\/resource-group-overview\" target=\"_blank\">resource group<\/a> which is like container holding your resources. As a resource group needs to be created in a specific location the next step is to get a list of those:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\ndwe@dwe:\/var\/tmp$ az account list-locations\n[\n  {\n    \"displayName\": \"East Asia\",\n    \"id\": \"\/subscriptions\/030698d5-42d6-41a1-8740-355649c409e7\/locations\/eastasia\",\n    \"latitude\": \"22.267\",\n    \"longitude\": \"114.188\",\n    \"name\": \"eastasia\",\n    \"subscriptionId\": null\n  },\n  {\n    \"displayName\": \"Southeast Asia\",\n    \"id\": \"\/subscriptions\/030698d5-42d6-41a1-8740-355649c409e7\/locations\/southeastasia\",\n    \"latitude\": \"1.283\",\n    \"longitude\": \"103.833\",\n    \"name\": \"southeastasia\",\n    \"subscriptionId\": null\n  },\n...\n<\/pre>\n<p>Once you have selected a location the resource group can be created:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\ndwe@dwe:\/var\/tmp$ az group create --name PGTEST --location \"westeurope\"\n{\n  \"id\": \"\/subscriptions\/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\/resourceGroups\/PGTEST\",\n  \"location\": \"westeurope\",\n  \"managedBy\": null,\n  \"name\": \"PGTEST\",\n  \"properties\": {\n    \"provisioningState\": \"Succeeded\"\n  },\n  \"tags\": null\n}\n<\/pre>\n<p>All you need to do for creating a CentOS VM is this simple command:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\ndwe@dwe:\/var\/tmp$ az vm create -n MyPg -g PGTEST --image centos --data-disk-sizes-gb 10 --size Standard_DS2_v2 --generate-ssh-keys\n{\n  \"fqdns\": \"\",\n  \"id\": \"\/subscriptions\/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\/resourceGroups\/PGTEST\/providers\/Microsoft.Compute\/virtualMachines\/MyPg\",\n  \"location\": \"westeurope\",\n  \"macAddress\": \"xx-xx-xx-xx-xx-xx\",\n  \"powerState\": \"VM running\",\n  \"privateIpAddress\": \"x.x.x.x\",\n  \"publicIpAddress\": \"x.x.x.x\",\n  \"resourceGroup\": \"PGTEST\",\n  \"zones\": \"\"\n}\n<\/pre>\n<p>While the VM is getting created you can watch the resources appearing in the portal:<br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/Selection_026-5.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/Selection_026-5.png\" alt=\"Selection_026\" width=\"1919\" height=\"671\" class=\"aligncenter size-full wp-image-25781\" \/><\/a><br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/Selection_027-3.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/Selection_027-3.png\" alt=\"Selection_027\" width=\"1918\" height=\"621\" class=\"aligncenter size-full wp-image-25782\" \/><\/a><br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/Selection_028-3.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/Selection_028-3.png\" alt=\"Selection_028\" width=\"1800\" height=\"906\" class=\"aligncenter size-full wp-image-25783\" \/><\/a><\/p>\n<p>As soon as the VM is ready connecting via ssh is possible (the keys have automatically been added, no password required):<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\ndwe@dwe:\/var\/tmp$ ssh x.x.x.x\nThe authenticity of host 'xx.xx.x.x (xx.xx.x.x)' can't be established.\nECDSA key fingerprint is SHA256:YzNOzg30JH0A3U1R+6WzuJEd3+7N4GmwpSVkznhuTuE.\nAre you sure you want to continue connecting (yes\/no)? yes\nWarning: Permanently added 'xx.xx.x.x' (ECDSA) to the list of known hosts.\n[dwe@MyPg ~]$ ls -la \/etc\/yum.repos.d\/\ntotal 44\ndrwxr-xr-x.  2 root root  209 Sep 25  2017 .\ndrwxr-xr-x. 86 root root 8192 Aug  2 08:05 ..\n-rw-r--r--.  1 root root 1706 Sep 25  2017 CentOS-Base.repo\n-rw-r--r--.  1 root root 1309 Nov 29  2016 CentOS-CR.repo\n-rw-r--r--.  1 root root  649 Nov 29  2016 CentOS-Debuginfo.repo\n-rw-r--r--.  1 root root  314 Nov 29  2016 CentOS-fasttrack.repo\n-rw-r--r--.  1 root root  630 Nov 29  2016 CentOS-Media.repo\n-rw-r--r--.  1 root root 1331 Nov 29  2016 CentOS-Sources.repo\n-rw-r--r--.  1 root root 2893 Nov 29  2016 CentOS-Vault.repo\n-rw-r--r--.  1 root root  282 Sep 25  2017 OpenLogic.repo\n[dwe@MyPg ~]$ sudo su -\n[root@MyPg ~]# cat \/etc\/centos-release\nCentOS Linux release 7.3.1611 (Core) \n[root@MyPg ~]# \n<\/pre>\n<p>Of course we want to update all the operating system packages to the latest release before moving on. Be careful here to really exclude the <a href=\"https:\/\/github.com\/Azure\/WALinuxAgent\" target=\"_blank\">WALinuxAgent<\/a> because otherwise the agent will be upgraded as well (and restarted) and the script execution will fail as you lose connectivity:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\ndwe@dwe:\/var\/tmp$ az vm extension set --publisher Microsoft.Azure.Extensions --version 2.0 --name CustomScript --vm-name MyPg --resource-group PGTEST --settings '{\"commandToExecute\":\"yum update -y --exclude=WALinuxAgent\"}'\n{\n  \"autoUpgradeMinorVersion\": true,\n  \"forceUpdateTag\": null,\n  \"id\": \"\/subscriptions\/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\/resourceGroups\/PGTEST\/providers\/Microsoft.Compute\/virtualMachines\/MyPg\/extensions\/CustomScript\",\n  \"instanceView\": null,\n  \"location\": \"westeurope\",\n  \"name\": \"CustomScript\",\n  \"protectedSettings\": null,\n  \"provisioningState\": \"Succeeded\",\n  \"publisher\": \"Microsoft.Azure.Extensions\",\n  \"resourceGroup\": \"PGTEST\",\n  \"settings\": {\n    \"commandToExecute\": \"yum update -y --exclude=WALinuxAgent\"\n  },\n  \"tags\": null,\n  \"type\": \"Microsoft.Compute\/virtualMachines\/extensions\",\n  \"typeHandlerVersion\": \"2.0\",\n  \"virtualMachineExtensionType\": \"CustomScript\"\n}\n<\/pre>\n<p>When we want to compile PostgreSQL we need some packages for that, so (not all of them required for compiling PostgreSQL but this is what we usually install):<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\ndwe@dwe:\/var\/tmp$ az vm extension set --publisher Microsoft.Azure.Extensions --version 2.0 --name CustomScript --vm-name MyPg --resource-group PGTEST --settings '{\"commandToExecute\":\"yum install -y gcc openldap-devel python-devel readline-devel redhat-lsb bison flex perl-ExtUtils-Embed zlib-devel crypto-utils openssl-devel pam-devel libxml2-devel libxslt-devel openssh-clients bzip2 net-tools wget screen unzip sysstat xorg-x11-xauth systemd-devel bash-completion\"}'\n\n{\n  \"autoUpgradeMinorVersion\": true,\n  \"forceUpdateTag\": null,\n  \"id\": \"\/subscriptions\/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\/resourceGroups\/PGTEST\/providers\/Microsoft.Compute\/virtualMachines\/MyPg\/extensions\/CustomScript\",\n  \"instanceView\": null,\n  \"location\": \"westeurope\",\n  \"name\": \"CustomScript\",\n  \"protectedSettings\": null,\n  \"provisioningState\": \"Succeeded\",\n  \"publisher\": \"Microsoft.Azure.Extensions\",\n  \"resourceGroup\": \"PGTEST\",\n  \"settings\": {\n    \"commandToExecute\": \"yum install -y gcc openldap-devel python-devel readline-devel redhat-lsb bison flex perl-ExtUtils-Embed zlib-devel crypto-utils openssl-devel pam-devel libxml2-devel libxslt-devel openssh-clients bzip2 net-tools wget screen unzip sysstat xorg-x11-xauth systemd-devel bash-completion\"\n  },\n  \"tags\": null,\n  \"type\": \"Microsoft.Compute\/virtualMachines\/extensions\",\n  \"typeHandlerVersion\": \"2.0\",\n  \"virtualMachineExtensionType\": \"CustomScript\"\n}\n<\/pre>\n<p>Preparation work for the user, group and directories:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\ndwe@dwe:~$ az vm extension set --publisher Microsoft.Azure.Extensions --version 2.0 --name CustomScript --vm-name MyPg --resource-group PGTEST --settings '{\"commandToExecute\":\"groupadd postgres; useradd -m -g postgres postgres; mkdir -p \/u01\/app; chown postgres:postgres \/u01\/app; mkdir -p \/u02\/pgdata; chown postgres:postgres \/u02\/pgdata\"}'\n{\n  \"autoUpgradeMinorVersion\": true,\n  \"forceUpdateTag\": null,\n  \"id\": \"\/subscriptions\/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\/resourceGroups\/PGTEST\/providers\/Microsoft.Compute\/virtualMachines\/MyPg\/extensions\/CustomScript\",\n  \"instanceView\": null,\n  \"location\": \"westeurope\",\n  \"name\": \"CustomScript\",\n  \"protectedSettings\": null,\n  \"provisioningState\": \"Succeeded\",\n  \"publisher\": \"Microsoft.Azure.Extensions\",\n  \"resourceGroup\": \"PGTEST\",\n  \"settings\": {\n    \"commandToExecute\": \"groupadd postgres; useradd -m -g postgres postgres; mkdir -p \/u01\/app; chown postgres:postgres \/u01\/app; mkdir -p \/u02\/pgdata; chown postgres:postgres \/u02\/pgdata\"\n  },\n  \"tags\": null,\n  \"type\": \"Microsoft.Compute\/virtualMachines\/extensions\",\n  \"typeHandlerVersion\": \"2.0\",\n  \"virtualMachineExtensionType\": \"CustomScript\"\n}\n<\/pre>\n<p>For the next steps we will just copy over this script and then execute it:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\ndwe@dwe:~$ cat installPG.sh \n#!\/bin\/bash\ncd \/u01\/app; wget https:\/\/ftp.postgresql.org\/pub\/source\/v10.5\/postgresql-10.5.tar.bz2\ntar -axf postgresql-10.5.tar.bz2\nrm -f postgresql-10.5.tar.bz2\ncd postgresql-10.5\nPGHOME=\/u01\/app\/postgres\/product\/10\/db_5\/\nSEGSIZE=2\nBLOCKSIZE=8\nWALSEGSIZE=16\n.\/configure --prefix=${PGHOME} \\\n            --exec-prefix=${PGHOME} \\\n            --bindir=${PGHOME}\/bin \\\n            --libdir=${PGHOME}\/lib \\\n            --sysconfdir=${PGHOME}\/etc \\\n            --includedir=${PGHOME}\/include \\\n            --datarootdir=${PGHOME}\/share \\\n            --datadir=${PGHOME}\/share \\\n            --with-pgport=5432 \\\n            --with-perl \\\n            --with-python \\\n            --with-openssl \\\n            --with-pam \\\n            --with-ldap \\\n            --with-libxml \\\n            --with-libxslt \\\n            --with-segsize=${SEGSIZE} \\\n            --with-blocksize=${BLOCKSIZE} \\\n            --with-wal-segsize=${WALSEGSIZE}  \\\n\t    --with-systemd \nmake -j 4 all\nmake install\ncd contrib\nmake -j 4 install\n\ndwe@dwe:~$ scp installPG.sh x.x.x.x:\/var\/tmp\/\ninstallPG.sh                                                                                                100% 1111     1.1KB\/s   00:00    \n<\/pre>\n<p>Of course you could also add the yum commands to the same script but I wanted to show both ways. Using the CustomScript feature and copying over a script for execution. Lets execute that:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\ndwe@dwe:~$ az vm extension set --publisher Microsoft.Azure.Extensions --version 2.0 --name CustomScript --vm-name MyPg --resource-group PGTEST --settings '{\"commandToExecute\":\"chmod +x \/var\/tmp\/installPG.sh; sudo su - postgres -c \/var\/tmp\/installPG.sh\"}'\n\n  \"autoUpgradeMinorVersion\": true,\n  \"forceUpdateTag\": null,\n  \"id\": \"\/subscriptions\/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\/resourceGroups\/PGTEST\/providers\/Microsoft.Compute\/virtualMachines\/MyPg\/extensions\/CustomScript\",\n  \"instanceView\": null,\n  \"location\": \"westeurope\",\n  \"name\": \"CustomScript\",\n  \"protectedSettings\": null,\n  \"provisioningState\": \"Succeeded\",\n  \"publisher\": \"Microsoft.Azure.Extensions\",\n  \"resourceGroup\": \"PGTEST\",\n  \"settings\": {\n    \"commandToExecute\": \"chmod +x \/var\/tmp\/installPG.sh; sudo su - postgres -c \/var\/tmp\/installPG.sh\"\n  },\n  \"tags\": null,\n  \"type\": \"Microsoft.Compute\/virtualMachines\/extensions\",\n  \"typeHandlerVersion\": \"2.0\",\n  \"virtualMachineExtensionType\": \"CustomScript\"\n}\n<\/pre>\n<p>Binaries ready. Initialize the cluster:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\ndwe@dwe:~$ az vm extension set --publisher Microsoft.Azure.Extensions --version 2.0 --name CustomScript --vm-name MyPg --resource-group PGTEST --settings '{\"commandToExecute\":\"sudo su - postgres -c \\\"\/u01\/app\/postgres\/product\/10\/db_5\/bin\/initdb -D \/u02\/pgdata\/PG1\\\"\"}'\n{\n  \"autoUpgradeMinorVersion\": true,\n  \"forceUpdateTag\": null,\n  \"id\": \"\/subscriptions\/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\/resourceGroups\/PGTEST\/providers\/Microsoft.Compute\/virtualMachines\/MyPg\/extensions\/CustomScript\",\n  \"instanceView\": null,\n  \"location\": \"westeurope\",\n  \"name\": \"CustomScript\",\n  \"protectedSettings\": null,\n  \"provisioningState\": \"Succeeded\",\n  \"publisher\": \"Microsoft.Azure.Extensions\",\n  \"resourceGroup\": \"PGTEST\",\n  \"settings\": {\n    \"commandToExecute\": \"sudo su - postgres -c \\\"\/u01\/app\/postgres\/product\/10\/db_5\/bin\/initdb -D \/u02\/pgdata\/PG1\\\"\"\n  },\n  \"tags\": null,\n  \"type\": \"Microsoft.Compute\/virtualMachines\/extensions\",\n  \"typeHandlerVersion\": \"2.0\",\n  \"virtualMachineExtensionType\": \"CustomScript\"\n}\n<\/pre>\n<p>Startup:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\ndwe@dwe:~$ az vm extension set --publisher Microsoft.Azure.Extensions --version 2.0 --name CustomScript --vm-name MyPg --resource-group PGTEST --settings '{\"commandToExecute\":\"sudo su - postgres -c \\\"\/u01\/app\/postgres\/product\/10\/db_5\/bin\/pg_ctl -D \/u02\/pgdata\/PG1 start\\\"\"}'\n{\n  \"autoUpgradeMinorVersion\": true,\n  \"forceUpdateTag\": null,xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx030698d5-42d6-41a1-8740-355649c409e7\/resourceGroups\/PGTEST\/providers\/Microsoft.Compute\/virtualMachines\/MyPg\/extensions\/CustomScript\",\n  \"instanceView\": null,\n  \"location\": \"westeurope\",\n  \"name\": \"CustomScript\",\n  \"protectedSettings\": null,\n  \"provisioningState\": \"Succeeded\",\n  \"publisher\": \"Microsoft.Azure.Extensions\",\n  \"resourceGroup\": \"PGTEST\",\n  \"settings\": {\n    \"commandToExecute\": \"sudo su - postgres -c \\\"\/u01\/app\/postgres\/product\/10\/db_5\/bin\/pg_ctl -D \/u02\/pgdata\/PG1 start\\\"\"\n  },\n  \"tags\": null,\n  \"type\": \"Microsoft.Compute\/virtualMachines\/extensions\",\n  \"typeHandlerVersion\": \"2.0\",\n  \"virtualMachineExtensionType\": \"CustomScript\"\n}\n<\/pre>\n<p>&#8230; and the instance is up and running:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\ndwe@dwe:~$ ssh x.x.x.x\nLast login: Mon Aug 13 10:43:53 2018 from ip-37-201-6-36.hsi13.unitymediagroup.de\n[dwe@MyPg ~]$ sudo su - postgres\nLast login: Mon Aug 13 11:33:52 UTC 2018 on pts\/0\n[postgres@MyPg ~]$ \/u01\/app\/postgres\/product\/10\/db_5\/bin\/psql -c 'select version()'\n                                                 version                                                 \n---------------------------------------------------------------------------------------------------------\n PostgreSQL 10.5 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28), 64-bit\n(1 row)\n[postgres@MyPg ~]$ \n<\/pre>\n<p>When you want to access this instance from outside Azure you will need to open the port:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\ndwe@dwe:~$ az vm open-port --resource-group PGTEST --name MyPg --port 5432\n<\/pre>\n<p>Once you have configured PostgreSQL for accepting connections:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\n[postgres@MyPg ~]$ \/u01\/app\/postgres\/product\/10\/db_5\/bin\/psql\npsql (10.5)\nType \"help\" for help.\n\npostgres=# alter system set listen_addresses = '*';\nALTER SYSTEM\npostgres=# alter user postgres password 'secret';\nALTER ROLE\npostgres=# show port ;\n port \n------\n 5432\n(1 row)\n\npostgres=# \\q\n[postgres@MyPg ~]$ echo \"host    all             all             37.201.6.36\/32   md5\" &gt;&gt; \/u02\/pgdata\/PG1\/pg_hba.conf \n[postgres@MyPg ~]$ \/u01\/app\/postgres\/product\/10\/db_5\/bin\/pg_ctl -D \/u02\/pgdata\/PG1\/ restart\n<\/pre>\n<p>&#8230; you can access the instance from your outside Azure:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\ndwe@dwe:~$ psql -h 137.117.157.183 -U postgres\nPassword for user postgres: \npsql (9.5.13, server 10.5)\nWARNING: psql major version 9.5, server major version 10.\n         Some psql features might not work.\nType \"help\" for help.\n\npostgres=# \n<\/pre>\n<p>Put all that into a well written script and you can have your customized PostgreSQL instance ready in Azure in a couple of minutes. Now that I have a feeling on how that works in general I&#8217;ll look into the managed PostgreSQL service in another post.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Azure cloud becomes more and more popular so I gave it try and started simple. The goal was to provision a VM, compiling and installing PostgreSQL and then connecting to the instance. There is also a fully managed PostgreSQL service but I wanted to do it on my own just to get a feeling [&hellip;]<\/p>\n","protected":false},"author":29,"featured_media":11499,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[229],"tags":[1338,77],"type_dbi":[],"class_list":["post-11498","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-database-administration-monitoring","tag-azure","tag-postgresql"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Bringing up your customized PostgreSQL instance on Azure - dbi Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/bringing-up-your-customized-postgresql-instance-on-azure\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Bringing up your customized PostgreSQL instance on Azure\" \/>\n<meta property=\"og:description\" content=\"The Azure cloud becomes more and more popular so I gave it try and started simple. The goal was to provision a VM, compiling and installing PostgreSQL and then connecting to the instance. There is also a fully managed PostgreSQL service but I wanted to do it on my own just to get a feeling [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/bringing-up-your-customized-postgresql-instance-on-azure\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2018-08-13T09:53:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/Selection_026-5.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1919\" \/>\n\t<meta property=\"og:image:height\" content=\"671\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Daniel Westermann\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@westermanndanie\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Daniel Westermann\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/bringing-up-your-customized-postgresql-instance-on-azure\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/bringing-up-your-customized-postgresql-instance-on-azure\\\/\"},\"author\":{\"name\":\"Daniel Westermann\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/8d08e9bd996a89bd75c0286cbabf3c66\"},\"headline\":\"Bringing up your customized PostgreSQL instance on Azure\",\"datePublished\":\"2018-08-13T09:53:12+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/bringing-up-your-customized-postgresql-instance-on-azure\\\/\"},\"wordCount\":417,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/bringing-up-your-customized-postgresql-instance-on-azure\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2022\\\/04\\\/Selection_026-5.png\",\"keywords\":[\"Azure\",\"PostgreSQL\"],\"articleSection\":[\"Database Administration &amp; Monitoring\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/bringing-up-your-customized-postgresql-instance-on-azure\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/bringing-up-your-customized-postgresql-instance-on-azure\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/bringing-up-your-customized-postgresql-instance-on-azure\\\/\",\"name\":\"Bringing up your customized PostgreSQL instance on Azure - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/bringing-up-your-customized-postgresql-instance-on-azure\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/bringing-up-your-customized-postgresql-instance-on-azure\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2022\\\/04\\\/Selection_026-5.png\",\"datePublished\":\"2018-08-13T09:53:12+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/8d08e9bd996a89bd75c0286cbabf3c66\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/bringing-up-your-customized-postgresql-instance-on-azure\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/bringing-up-your-customized-postgresql-instance-on-azure\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/bringing-up-your-customized-postgresql-instance-on-azure\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2022\\\/04\\\/Selection_026-5.png\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2022\\\/04\\\/Selection_026-5.png\",\"width\":1919,\"height\":671},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/bringing-up-your-customized-postgresql-instance-on-azure\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Bringing up your customized PostgreSQL instance on Azure\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/8d08e9bd996a89bd75c0286cbabf3c66\",\"name\":\"Daniel Westermann\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g\",\"caption\":\"Daniel Westermann\"},\"description\":\"Daniel Westermann is Principal Consultant and Technology Leader Open Infrastructure at dbi services. He has more than 15 years of experience in management, engineering and optimization of databases and infrastructures, especially on Oracle and PostgreSQL. Since the beginning of his career, he has specialized in Oracle Technologies and is Oracle Certified Professional 12c and Oracle Certified Expert RAC\\\/GridInfra. Over time, Daniel has become increasingly interested in open source technologies, becoming \u201cTechnology Leader Open Infrastructure\u201d and PostgreSQL expert. \u00a0Based on community or EnterpriseDB tools, he develops and installs complex high available solutions with PostgreSQL. He is also a certified PostgreSQL Plus 9.0 Professional and a Postgres Advanced Server 9.4 Professional. He is a regular speaker at PostgreSQL conferences in Switzerland and Europe. Today Daniel is also supporting our customers on AWS services such as AWS RDS, database migrations into the cloud, EC2 and automated infrastructure management with AWS SSM (System Manager). He is a certified AWS Solutions Architect Professional. Prior to dbi services, Daniel was Management System Engineer at LC SYSTEMS-Engineering AG in Basel. Before that, he worked as Oracle Developper &amp;\u00a0Project Manager at Delta Energy Solutions AG in Basel (today Powel AG). Daniel holds a diploma in Business Informatics (DHBW, Germany). His branch-related experience mainly covers the pharma industry, the financial sector, energy, lottery and telecommunications.\",\"sameAs\":[\"https:\\\/\\\/x.com\\\/westermanndanie\"],\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/author\\\/daniel-westermann\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Bringing up your customized PostgreSQL instance on Azure - dbi Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/bringing-up-your-customized-postgresql-instance-on-azure\/","og_locale":"en_US","og_type":"article","og_title":"Bringing up your customized PostgreSQL instance on Azure","og_description":"The Azure cloud becomes more and more popular so I gave it try and started simple. The goal was to provision a VM, compiling and installing PostgreSQL and then connecting to the instance. There is also a fully managed PostgreSQL service but I wanted to do it on my own just to get a feeling [&hellip;]","og_url":"https:\/\/www.dbi-services.com\/blog\/bringing-up-your-customized-postgresql-instance-on-azure\/","og_site_name":"dbi Blog","article_published_time":"2018-08-13T09:53:12+00:00","og_image":[{"width":1919,"height":671,"url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/Selection_026-5.png","type":"image\/png"}],"author":"Daniel Westermann","twitter_card":"summary_large_image","twitter_creator":"@westermanndanie","twitter_misc":{"Written by":"Daniel Westermann","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/bringing-up-your-customized-postgresql-instance-on-azure\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/bringing-up-your-customized-postgresql-instance-on-azure\/"},"author":{"name":"Daniel Westermann","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66"},"headline":"Bringing up your customized PostgreSQL instance on Azure","datePublished":"2018-08-13T09:53:12+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/bringing-up-your-customized-postgresql-instance-on-azure\/"},"wordCount":417,"commentCount":0,"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/bringing-up-your-customized-postgresql-instance-on-azure\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/Selection_026-5.png","keywords":["Azure","PostgreSQL"],"articleSection":["Database Administration &amp; Monitoring"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/bringing-up-your-customized-postgresql-instance-on-azure\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/bringing-up-your-customized-postgresql-instance-on-azure\/","url":"https:\/\/www.dbi-services.com\/blog\/bringing-up-your-customized-postgresql-instance-on-azure\/","name":"Bringing up your customized PostgreSQL instance on Azure - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/bringing-up-your-customized-postgresql-instance-on-azure\/#primaryimage"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/bringing-up-your-customized-postgresql-instance-on-azure\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/Selection_026-5.png","datePublished":"2018-08-13T09:53:12+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/bringing-up-your-customized-postgresql-instance-on-azure\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/bringing-up-your-customized-postgresql-instance-on-azure\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/bringing-up-your-customized-postgresql-instance-on-azure\/#primaryimage","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/Selection_026-5.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/Selection_026-5.png","width":1919,"height":671},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/bringing-up-your-customized-postgresql-instance-on-azure\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Bringing up your customized PostgreSQL instance on Azure"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66","name":"Daniel Westermann","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g","caption":"Daniel Westermann"},"description":"Daniel Westermann is Principal Consultant and Technology Leader Open Infrastructure at dbi services. He has more than 15 years of experience in management, engineering and optimization of databases and infrastructures, especially on Oracle and PostgreSQL. Since the beginning of his career, he has specialized in Oracle Technologies and is Oracle Certified Professional 12c and Oracle Certified Expert RAC\/GridInfra. Over time, Daniel has become increasingly interested in open source technologies, becoming \u201cTechnology Leader Open Infrastructure\u201d and PostgreSQL expert. \u00a0Based on community or EnterpriseDB tools, he develops and installs complex high available solutions with PostgreSQL. He is also a certified PostgreSQL Plus 9.0 Professional and a Postgres Advanced Server 9.4 Professional. He is a regular speaker at PostgreSQL conferences in Switzerland and Europe. Today Daniel is also supporting our customers on AWS services such as AWS RDS, database migrations into the cloud, EC2 and automated infrastructure management with AWS SSM (System Manager). He is a certified AWS Solutions Architect Professional. Prior to dbi services, Daniel was Management System Engineer at LC SYSTEMS-Engineering AG in Basel. Before that, he worked as Oracle Developper &amp;\u00a0Project Manager at Delta Energy Solutions AG in Basel (today Powel AG). Daniel holds a diploma in Business Informatics (DHBW, Germany). His branch-related experience mainly covers the pharma industry, the financial sector, energy, lottery and telecommunications.","sameAs":["https:\/\/x.com\/westermanndanie"],"url":"https:\/\/www.dbi-services.com\/blog\/author\/daniel-westermann\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/11498","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/29"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=11498"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/11498\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media\/11499"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=11498"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=11498"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=11498"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=11498"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}