Using the instructions underneath you will be able to import an Azure Automation runbook that will alert you using Sendgrid before certificates will expire.
The urge of creating this script was to find a way to inform us whenever the private certificate for Sitecore X-connect would expire. The script will, however, help you to monitor all your certificates within your Azure subscription. Next to that it will assure you will renew the certificates for your RunAsAccounts, causing it not to expire, so that your runbooks will be operational.
– Azure Automation account
– Azure Automation modules – (Az.Accounts, Az.resources, Az.websites and Az.automation)
– SMTP Client ( in this case Sendgrid )
In the steps underneath I expect you already have an Azure Automation account configured.
Install the runbook using the Azure Automation Runbooks gallery.
Search for “Check SSL expiration and RunAsAccounts – notify per mail [Az]”.
Import the runbook. Edit the runbook and publish it.
Once the runbook has been imported, you need to define a schedule.
I advise you to create a recurring schedule and report/scan expiry on monthly base.
The parameters can be filled in according details in screenshot below, assuming you will use Sendgrid:
* Please note that the Sendgrid username can be found within the Azure Portal – Sendgrid Accounts
The source of this runbook can be downloaded here: