Getting the Job ID of an Executing Azure Runbook

If you’re calling an Azure runbook, it is sometimes useful to be able to get the Job ID, say, to report back and update the source that initiated the call to a runbook. This is a quick post on how to access that ID in PowerShell.

You can access it via the following:

$PSPrivateMetadata.JobId.Guid

image

And the output:

image

About Geoff Varosky
Geoff Varosky is a Senior Architect for Insight, based out of Watertown, MA. He has been architecting and developing web based applications his entire career, and has been working with SharePoint for the past 15 years. Geoff is an active member of the SharePoint community, Co-Founder and Co-Organizer of the Boston Area SharePoint Users Group, co-founder for the Boston Office 365 Users Group, co-organizer for SharePoint Saturday Boston and speaks regularly at SharePoint events and user groups.

2 Responses to Getting the Job ID of an Executing Azure Runbook

  1. rohitbundele says:

    How to get the JOB ID when the script is of type ‘Phtyon’ ?

Leave a comment