Hello @Zhai, Jim
Thanks for reaching out to us, there is an alternative way to set an alert with Azure Function with Timer Trigger + Email Notification.
As you can get the retirement date from an API call - https://video2.skills-academy.com/en-us/rest/api/aiservices/accountmanagement/models/list?view=rest-aiservices-accountmanagement-2024-10-01&tabs=HTTP#listlocationmodels
Then you can use an Azure Function with a Timer Trigger to periodically check model metadata and send email reminders. The Timer Trigger can be scheduled to run at specified intervals (e.g., daily or weekly) to check the remaining time until each model's retirement date.
- Implementation:
- Set up the Azure Function:
- Configure the Timer Trigger in the Azure Function to run at your desired interval.
- Call the internal API you set up to store retirement dates
- Logic for Retirement Notification:
- Calculate the difference between the current date and the model’s retirement date.
- If the difference is within your desired threshold (e.g., 90 days), trigger an email.
- Send Email:
- Use Azure SendGrid (a preferred email service for Azure) or SMTP email directly in the Azure Function to send the reminder email to the designated recipients.
- Set up the Azure Function:
The document you may want to refer to - https://video2.skills-academy.com/en-us/azure/azure-functions/functions-create-scheduled-function
Also, you may also considerate to use an Azure Automation Account to run a PowerShell script or Python3 on a regular schedule. The script would check each model’s retirement date and send reminder emails as needed.
Document for your reference - https://video2.skills-academy.com/en-us/azure/automation/learn/automation-tutorial-runbook-textual-python-3
Please take a look and let us know how it works, if you meet any new issues during your testing, feel free to create a new thread.
I hope this helps!
Regards,
Yutong
-Please kindly accept the answer if you feel helpful to support the community, thanks a lot.