In this challenge, you create a new Logic App for your data export workflow. This Logic App will execute periodically and call your ExportLicensePlates function, then conditionally send an email if there were no records to export.
- Create a logic app
- Name : Similar to TollboothLogic
- Make sure Log Analytics is Off
- Trigger should be Recurrence, 15 minutes
- Add an action to call your "App" function app function name ExportLicensePlates
- Add a condition control
- Value : Status Code parameter
- Operator : is equal to
- Second value : 200
- Ignore the True condition
- In the False condition, send an O365 email
- To : your email
- Subject : enter something meaningful
- Message Body : enter something here and include the status code value
- Save and Run
- Once your email message is received, return to your solution and replace the To-Do's accordingly:
// TODO 5: Retrieve a List of LicensePlateDataDocument objects from the collectionLink where the exported value is false.
licensePlates = _client.CreateDocumentQuery<LicensePlateDataDocument>(collectionLink,
new FeedOptions() { EnableCrossPartitionQuery=true,MaxItemCount = 100 })
.Where(l => l.exported == false)
.ToList();
// TODO 6: Remove the line below.
// TODO 7: Asyncronously upload the blob from the memory stream.
await blob.UploadFromStreamAsync(stream);
- Publish to Azure
- In your App Azure Function, add
FUNCTIONS_V2_COMPATIBILITY_MODE
with a value oftrue
in the application settings. - Run the Logic App. This time, the condition should be true.
- The first execution of the logic app has executed successfully and you have received an email from your Logic App
- The first execution of the logic app has executed successfully and you have data in your export container