Connect to PostgreSQL Flexibe Server from Azure Machine Learning Pipeline

Amanda Costa Spolti 0 Reputation points
2025-01-19T22:18:10.56+00:00

Hi,

I have a Machine Learning Pipeline, a WebApp and a Postgre Flexibe server with private access that was generated when creating the web app.

My pipeline should be able to connect and insert data into the database created. I have read some tutorials but nothing successful. The AML pipeline and Postgre are in different regions.

How can I connect to the database?

Thanks!

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
3,086 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 28,066 Reputation points
    2025-01-20T10:50:01.4166667+00:00

    Since the PostgreSQL Flexible Server is private, you need:

    • A private endpoint configured for the PostgreSQL Flexible Server.
    • The AML workspace has access to the same VNet where the PostgreSQL Flexible Server is located

    Second thing, in your case the AML and PostgreSQL Flexible Server are in different regions, so you need a VNet Peering to connect the VNet of the AML workspace with the VNet of the PostgreSQL Flexible Server. the peering needs to allow traffic flow between VNets and the NSG rules should allow traffic from the AML workspace subnet to the PostgreSQL subnet on port 5432.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.