Azure HttpTrigger, QueueTrigger, BlobTrigger, TableStorage, SendGrid
Visual Studio 2017+, .net core 2.1, Azure access
- Add Azure Storage connection string in "AzureWebJobsStorage" section.
- Add Send Grid Api Key in "SendGridApiKey" section.
- Add From Email Id in "EmailSender" section.
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
"EmailSender": "FromEmailId",
"SendGridApiKey": "YourSendGridApiKey"
}
}
Step A - Receives Order Details like order id, email id, order amount etc., through HTTP trigger.
- Need to make HTTP request once the order is placed or once the payment is done or whenever we need to generate receipt.
- eads the request body & send a Queue Message to generate Receipt File.
- Save the order data in Table Storage.
Step B - Receives Queue message and generates the Receipt File.
- Queue triggers once it receives the message.
- Generates Receipt File with the name orderid and store it in Blob Storage.
Step C - Sends Receipt File to the user.
- Blob triggers when any new file is saved in it.
- It reads the data from Table Storage by file name (orderid) & then sends Receipt file to the user through mail using Send Grid.