question

JesusChao-6831 avatar image
0 Votes"
JesusChao-6831 asked JesusChao-6831 commented

Azure Automation Graphical Powershell Runbook Edit Multiple Code Activities

I am in the process of writing multiple Graphical PowerShell runbooks in Azure Automation. Within each Graphical PS Runbook, I am either using custom cmdlets/functions that I created that I have imported into Azure Automation as a module or written using the Code Activity.

My issue is, once I add one of my custom cmdlets/function into the canvas and set all the parameters, if I upload an update of my custom module, I have to delete the activity in the canvas in order to update the activities parameters if I add or change the parameters within the cmdlet/function. If I have multiple Graphical PS Runbooks that use these functions, I will have to go into each one to make the modification which can be very tedious.

I thought about using the code activity instead and then referencing the cmdlet within the Activity Logic - however - I still have the same issue.

In Microsoft System Center Orchestrator, if I want to update a Run .Net script, I could modify multiple code activities by modifying the SQL database with a query.

My question is, is there a way to modify multiple activities in multiple Graphic Runbooks so that if I make updates to my custom module, I can easily update all the code activities or the parameters within a cmdlet inserted into a canvas directly.

Thanks

azure-automation
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AnuragSingh-MSFT avatar image
0 Votes"
AnuragSingh-MSFT answered JesusChao-6831 commented

Hi @JesusChao-6831,

Welcome to Microsoft Q&A! Thanks for posting the question.

I understand your question about updating the graphical runbooks when custom cmdlets get updated with parameter type or parameter count. There is no other way to update these runbooks when the used cmdlet's param gets changed. Changing param would require corresponding change in the activity connection in the runbook which will have to map according to the update. You can think of it being like updating a method/function in your code/script. When that happens, other functions/methods or part of code calling that updated method will have to adjust accordingly to match the parameters.

In the case of System Center Orchestrator, you have access to the Orchestrator Database where you may modify the activities and linking (which requires a bit of understanding of the Orchestrator DB schema). Since we do not have access to such a store in Azure Automation, it is not going to be possible.

Please let me know if you have any questions.


Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@JesusChao-6831, I wanted to check if you had a chance to review my answer above. Please let me know if you have any queries or concerns.

Please 'Accept as answer' if it helped so that it can help others in the community looking for help on similar topics.

0 Votes 0 ·

Thanks - sorry for the delay, I was on vacation this past week.

How about the ability to modify multiple "code" activities? Is there or can there be a way in the future to modify the text within a Code Activity with a specific Names. So lets say I have several graphical powershell runbooks that use the Code Activity that I have named "Notification" for example. Then I want to search the text in each and run a "replace" within each. This way I can update all of these without having to open each runbook that has the same "activity" in each?

Example - (this is hypotheticall; ive made up the following cmdlet)

(Get-AzAutomationGraphicalPSActivity | Where {$_.name -eq "Notification"}) -replace "myemailaddress@mydomain.com","mynewaddress@mydomain.com"

Thanks

0 Votes 0 ·

@JesusChao-6831, this is an interesting idea. Can you please submit it using - Azure Automation Feedback, for our Automation team to review.

Please 'Accept as answer' if it helped so that it can help others in the community looking for help on similar topics.

0 Votes 0 ·
Show more comments