Coder Social home page Coder Social logo

Comments (7)

HeyMo0sh avatar HeyMo0sh commented on August 11, 2024

If you are doing it with Azure VM then the public network NSG needs to be set up.
Have you setup the local postgresql instance to be configured to listen for hosts which are not local?

If those work for you then I will write that up - the password not correct when it is says to me that there is something blocking communication from Migrate PostgreSQL to Azure Database for PostgreSQL Flexible Server

from mslearn-postgresql.

HeyMo0sh avatar HeyMo0sh commented on August 11, 2024

You have localhost as the server name. The source server has to be accessible to the flexible server, i.e. it has to be accessible from the internet.

So you have to allow your IP address and port 5432 open. Azure won't be able to resolve localhost.
I will document this.

from mslearn-postgresql.

afelix-95 avatar afelix-95 commented on August 11, 2024

I am testing it outside of VM environment.
I checked the postgresql.conf file and its parameter listen_addresses was already set to '*'.
In the pg_hba.conf file, I added the following line:

host    all    all    0.0.0.0/0    md5

I have also added Firewall rules for port 5432.
After that, I restarted the server and tried connecting to it again using the server's public IP address instead of localhost.
Now the error that I'm getting is:

Failed to connect to server : The operation has timed out.

from mslearn-postgresql.

HeyMo0sh avatar HeyMo0sh commented on August 11, 2024

Are you able to connect to your database from say another Azure VM? you can either telnet to 5432 or using powershell:

Test-NetConnection -ComputerName -Port 5432 -InformationLevel "Detailed"

I found I had to set up a NSG for port 5432 on the VM and also do windows firewall on the VM itself

from mslearn-postgresql.

afelix-95 avatar afelix-95 commented on August 11, 2024

Having the "local" database in an Azure VM works, so there is probably some additional network setting in my work computer that I need to change before establishing any connections to it through the internet. I reproduced all the configuration steps in both environments but it works only in the VM. I guess we can consider it an edge case and close the issue.

from mslearn-postgresql.

afelix-95 avatar afelix-95 commented on August 11, 2024

One more thing, in the instructions for Create Database Migration Project in Azure Database for PostgreSQL Flexible Server, step 5 you reference user as demo and its password as Pa$$w0rd for the target server but in this case it should be pgAdmin and the random password generated at the beginning of the lab instructions.

from mslearn-postgresql.

HeyMo0sh avatar HeyMo0sh commented on August 11, 2024

Thanks for spotting that - I have corrected it and pushed to #13

from mslearn-postgresql.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.