Advertisements

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

Advertisements

About Geoff Varosky
Geoff Varosky is a Senior Architect for BlueMetal Architects, 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 13 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’ ?

    • I have not tested with Python, only PowerShell.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: