1

I did some research and found that Azure DevOps does have any outofthebox implementations to support CI CD for Azure PostgreSQL.

Does anyone , have any idea , How can we configure Azure DevOps for PaaS offering of Azure PostgreSQL Database

Please help.

MSTechnie
  • 175
  • 10

2 Answers2

1

As of today , there is no out-of-the-box Azure DevOps template to deploy for the PaaS version of Azure Postgres.

MSTechnie
  • 175
  • 10
0

I'm not sure if I understand OP's question correctly, and it's been 9 months since OP posted the question. But this appears to be the right answer.

At least one Microsoft-hosted agent on Azure Devops has PostgreSQL built in, just not enabled by default. Enabling and using it is simple.

The "Microsoft-hosted agents" page, https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml, has a table listing the available agents. You can click on the link in the rightmost column to see a list of included software. The link for the agent vs2017-win2016 points to a list of all the software pre-installed on the Microsoft Windows Server 2016 Datacenter. Scrolling down the page, or searching for "postgres", reveals the pertinent information for PostgreSQL.

This example Azure Pipelines job can be used to start PostgreSQL.

- job: foo-postgresql-bar
  pool:
    vmImage: 'vs2017-win2016'
  steps:
    - powershell: |
        echo 'PGBIN is ' $env:PGBIN
        echo 'PGDATA is ' $env:PGDATA
        echo 'PGROOT is ' $env:PGROOT
        echo 'Contents of PGBIN'
        ls $env:PGBIN
        Set-Service postgresql-x64-13 -StartupType manual
        Start-Service postgresql-x64-13
        Get-CimInstance win32_service | Where-Object Name -eq "postgresql-x64-13"
      displayName: 'Setup PostgreSQL'   

Only the Set-Service and Start-Service commands are required; the rest of the PowerShell script is optional.

The echo and ls commands simply verify the information from the table. The Set-Service command enables the service, the Start-Service command starts the service, and the Get-CimInstance command verifies that it's running.

In a production environment, you may read the return code after Start-Service, instead of using the Get-CimInstance command, in order to verify that the service is running.

Ray Depew
  • 573
  • 1
  • 9
  • 22