AZURE APP, AZURE POSTGRESQL, EMAIL

Charmi 1 Reputation point
2020-11-11T10:52:48.123+00:00

I have .net app deployed on azure web app, connected with azure postgres db.
I push SAP BW data into azure postgres using azure data factory. Data processed in db and final processed/ not processed output is stored in db table.

I want to trigger mail on final outcome of processed/not processed data from azure postgres.
We set up trigger on database table.
Also,found that there is notify and listen command in azure postgres.

Can anyway we can get notification to our .net app?
Kindly give suggestion in a way so we can listen from any .net app and trigger mail using azure environment only. How to keep open azure postgres and listener app connection continously???

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,826 questions
Azure Stack Hub
Azure Stack Hub
An extension of Azure for running apps in an on-premises environment and delivering Azure services in a datacenter.
189 questions
Azure Database for PostgreSQL
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,901 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. KalyanChanumolu-MSFT 8,336 Reputation points
    2020-11-12T11:38:33.98+00:00

    @charmi thekdi Welcome to Microsoft Q&A forums and thank you for your interest in Azure services.

    You have a couple of options here

    1) Trigger an external entity like an Azure Function or LogicApp when there is an entry in your Outcome table (table that holds processed/not processed data) and send the email

    As you rightly pointed out, you can use Azure Database for PostgreSQL’s Notify functionality for sending a notification event as change feed to the listener channel specified in the database.
    We have detailed this in an elaborate blog post along with the source code.

    2) Poll the Outcome table on a periodic basis to check if there are any new entries and take appropriate action.

    If you don't need real-time processing, you can use a Timer Triggered Azure Function to connect to the database and query the table for new entries periodically (you can adjust the interval as per your business need)
    This option is less complex as you will not need the Notify functionality and Event Hub infrastructure.

    The code sample for connection and querying an Azure Database for PostgreSQL is here

    Please let us know if you have any further questions.


    If an answer is helpful, please "Accept answer" or "Up-Vote" for the same which might be beneficial to other community members reading this thread.

    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.