Press "Enter" to skip to content

Monitor Sitecore certificates and RunAsAccount(s) using Azure Automation

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.

Step 1
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.

Step 2
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.

Step 3:
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:


  1. Netherlands Antillian Guilder

  2. Pankaj Goyal Pankaj Goyal

    this is giving an error : The term ‘Connect-AzAccount’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if the path was included verify that the path is correct and try again.” I am new in azure, please suggest how to fix it.

  3. Rand Namibia Dollar

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.