Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 10

SAM Template Creation - Powershell and Multiple Components

Outside of SAM, I have a powershell script that runs against Azure and pulls in the Service Bus message queue counts across all subscriptions in a namespace. In Azure, message bus subscriptions are constantly being added and removed, so the script is written to pull in message queue counts for whatever resource group subscriptions exists at the time the script is executed. My script is sort of a catch-all as the environment grows without having to manually adjust the script to grab values from any new or changed subscriptions.

So my challenge is keeping the functionality of the script to grab everything, but getting the script into SAM. I can create a template, but how do I handle all of the values the script will return? I can create a separate component monitor for each subscription, but then I lose the catch-all features of getting the values across any subscription that exists at the time the script is executed. It would be a manual process of adding the component everytime something is added or changed in Azure Service Bus. I'm trying to avoid that.

Is there any way to handle a Powershell script that returns multiple values that need to be monitored?

Tags (3)
0 Kudos
0 Replies