Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

sending a notification from an Azure function app #8378


User avatar
0
BobIngham created

dotnet core, angular, 6.8.0 An architectural question. My app has to create a set of default documents for each tenant as the tenant is created and it is very heavy on processing. I have implemented a separate project for Azure Storage Queues within the Zero solution, inject it and simply place a request on the queue. I have an Azure function app which polls the queue and creates the documents for the new tenant, all abstracted away from the main processor. So far so good. How do I send a notification through Zero to the user when I'm done? There is no "SendNotification" call in the API, do I need to write one? It's no problem to do so but I only ask in the interest of best practise and you guys always point me in the right direction.


4 Answer(s)
  • User Avatar
    0
    ryancyq created
    Support Team

    Hi, do you mean notify user when the Azure Function succussfully created the document?

    i assume that when documents are created via Azure Function, you would need to post the document url back to ANZ application?

    If that is the case, you can notify user in ANZ when ANZ application receive such post event from Azure Function.

  • User Avatar
    0
    BobIngham created

    Hi @ryancq,

    My Zero database contains control data for a documentation management system, the documents are held in Azure Blob Storage. When a new tenant is added they select the document collection they want. Zero places a message in Azure Queue Storage with the tenant name and the relevant collection Id. The function app is triggered from the queue,

    • reads the Zero database,
    • gets the document collection from Azure Blob Storage,
    • carries out mail merge tasks to produce a personalised new document collection,
    • creates a new container in Blob Storage for the tenant and
    • places the merged documents into the new container.

    Immediately after each document is placed into Blob Storage the uri is saved in Zero and the control data updated in Zero. At the end of the process, which is extremely CPU heavy, I want to tell the user that the documents are now ready to use. All the hard work is done, my question is one of best practise, how best to send a call to Zero from the function app to notify the user the job is done?

  • User Avatar
    0
    ryancyq created
    Support Team

    Does you Azure function reads from ANZ database directly? or reading it via ANZ API?

    You can create an endpoint for the Azure function to call when documents are generated. for this endpoint , you can secure using token authorization (if Azure function is calling ANZ API) , otherwise, you can try pub/sec keys to verify the identity of azure function.

  • User Avatar
    0
    BobIngham created

    Hi @ryancq - the function app reads the db directly. I will create a new call in the API and use pulic/secret keys. Thanks for the advice, I'll close this issue.