Ideally to get "when something happens in Postgres" you would need a azure function trigger with a Postgres binding. Unfortunately that is not available.
You can try an azure function time trigger to query postgress every x seconds.
https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-timer?tabs=in-process&pivots=programming-language-csharp#ncrontab-expressions
Problem is getting hold of the connection string. you said it is on a docker image. the next will depend of where the docker is hosted. Is that on Azure VM? On-prem?