How to list all running webjobs within an azure subscription using powershell

Question:

I have an azure subscription that has upwards of 200 appServices where around about half of them have Continuous, always on webJobs attached, some also have slots which also have webJobs.

Is there a way to list all webJobs that are inside a subscription? I was originally tring to use powershell to do this but it was getting rather complex and was wondering if anyone knew of an easy way to achieve the above.

It seems like Get-AzureRmWebApp should be able to help but i cant find a way to list the jobs that reside inside the webapps.

Answer:

I found the command Get-AzureWebsiteJob which is not in the AzureRM family of commandlets. The following script can get the data that I’m looking for:

The above does not filter out the running ones from the stopped, but that can be easily added if need be.

Of course you firstly need to be logged into AzureRM and Azure classic

Its a very slow script iterating over this number or AppServices though. Any ideas for speeding it up would be appreciated.

Source:

How to list all running webjobs within an azure subscription using powershell by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply