Will Anderson

Explore articles and content from this author

Will Anderson

18 articles published

6 min read

Using PowerShell, Azure Automation, and OMS – Part III

It’s been a long road, but we’re almost there!  A couple of weeks ago we looked at how we can create an Azure Automation Account and add our own custom modules to the solution to be used in Azure Automation.  Last week, we took a deeper dive into configuring a runbook to take in webhook data from an alert using Microsoft’s Operations Management Suite.  Then we looked into the data itself to see how we can leverage it against our runbook to fix problems for us on the fly.
This week, we’re going to modify an existing function to use that webhook data directly.
Building on Webhook Data
We could actually build our logic directly into the runbook to parse the webhook data and then pass the formatted information to our function that we’ve made available in Azure.  But I prefer to keep my runbooks as simple as possible and do the heavy lifting in my function.  This makes the runbook look a little bit cleaner, and allows me to minimize my code management a little more.  Also, Azure Automation Runbooks, as of this writing, don’t play nicely with parameter sets in them, so I might as well pass my data along to a command that does.
Originally, I had built a one-liner that allowed me to create an NSG rule on the fly to block and incoming traffic from a specific IPAddress.  It was a fairly simple command.  But today, we’re going to make it a little more robust, and give it the ability to use webhook data.  Here’s my original code:

6 min read

Using PowerShell, Azure Automation, and OMS – Part II

So last time we learned how to upload our custom modules into Azure Automation so we can start using them in Azure Automation Runbooks.  This week we’re going to take a look at configuring a runbook to see what kind of data we can ingest from OMS Webhook data, and how we can leverage that data to pass into our functions.
Creating the Runbook Script
So first off, let’s talk about basic runbooks and running them against objects in Azure.  As previously discussed, when your automation account is created, it creates with it an AzureRunAsAccount.  This account is configured to act on behalf of the user that has access to the automation account and the runbooks in order to perform the runbook task.  In order to leverage this account, you need to invoke it in the runbook itself.  You can actually find an example of this snippet in the AzureAutomationTutorialScript runbook in your automation account.

4 min read

Using PowerShell, Azure Automation, and OMS – Part I

Microsoft’s Operations Management Suite provides some exceptional tools for monitoring and maintaining your environments in both the cloud and in your datacenter.  One of it’s best features, however, is its ability to leverage the tools that you’ve already developed to perform tasks and remediate issues using PowerShell, Azure Automation Runbooks, and OMS Alert triggers.  In this series, we’ll be discussing how you can configure these tools to take care of problems in your own environment.  Today, we’ll be talking about how you can take your own PowerShell Modules and upload them to Azure Automation.
Creating The Azure Automation Account
In order to create the Azure Automation Account, you’ll need to have create the automation account object in the target resource group, and the ability to create an AzureRunAs account in AzureAD.  It’s also important to be mindful that not every Azure region has the Microsoft.Automation resource provider registered to it, so you’ll want the resource group to exist in the appropriate locale.  You can check this with the Get-AzureRmResourceProvider cmdlet:

4 min read

Help Get the Word Out on the 'GetGoing' Program & Scholarship

PowerShellPodcastA couple of weeks ago, DevOps Collective (PowerShell.org’s parent non-profit organization) announced the availability of the ‘GetGoing’ IT Ops Education Program and Scholarship.
For those of you who may not have yet heard, DevOps Collective and Pluralsight have partnered together to create a modern ’turnkey’ curriculum that brings together mapped courses, recommended hands-on experiences, and live mentoring to prepare people for the real-world of IT Operations.  With this initiative, they’ve offered up to full-ride scholarships for 2016.  Applications for the scholarship have opened, and applications will be taken in until May 15th.
Now that the way has been paved, it’s our turn as members of the community to get the word out; and doing so might be easier than you think!
Contact Your Local School Districts
I recently reached out to my hometown public school district, and was immediately met with enthusiasm from the local superintendent and their Science, Guidance, and Counseling departments.  It only takes a quick email with some bullet points on the program to get the conversation initiated.  I’ve included the text of my initial correspondence for you to use as a guide to help you on your way.
Contacting your school district is easy .  A quick search online for your district can get your to their website with contact info, often including the email addresses for the district superintendent and other office officials that can help!  Send them a copy of the brochure to help them get informed of the initiative.
Use Your Social Media Skills
Get the conversation going on social media!  Talk to your followers; speak out to local educational organizations; and make them aware of this awesome new program!
Inform Your User Groups
Get your user groups in on the action.  Enlist the greater community to get the word out faster!  Together we can canvas an even larger area and get more people interested!
Get Involved
Offer to become a mentor.  We all know that the best way to learn is from real world experiences.  We, as a community, have this vast repository of practical knowledge that no book can effectively provide.  We, as a collective resource, can help to bring a new generation of administrators, engineers, and architects into this world already prepared to take on DevOps, Agile IT, and more!
If you need a hand getting started, feel free to contact me at webmaster at powershell.org.  Now let’s #GetGoing ourselves, and make this happen!
Here’s my initial contact email that you can use to fit your own story:
Greetings [Contact Name],

3 min read

Desired State Configuration – Beware Of Circular Configurations

Lately, I’ve been working at converting a lot of my server configuration scripts into DSC configurations.  After all, what better way to learn than by updating your existing methods?  I recently ran into an issue, however, while converting my SCCM Distribution Point deployment script into a config, where the test systems inexplicably began rebooting every thirty minutes or so.  The Local Configuration Manager was configured to reboot if necessary, and these were fresh installs, so I knew that my culprit was most likely in my configuration.

1 min read

PowerShellTO's Next Meeting – May 6th, 2015

Join us on Wednesday, May 6th for our second Toronto PowerShell User’s Group meeting.  This time you get to take the wheel!  Send us some of your PowerShell related challenges and we’ll pick the top ones to work out in a group together!  We’ll also be talking about some of the things learned at PowerShell Summit – North America, and more!

2 min read

PowerShell Summit – North America Launches!

The PowerShell community descended on Charlotte, North Carolina for the third annual PowerShell Summit - North America this week!  Enthusiasts, MVPs, community leaders, and the PowerShell product team came to discuss the latest and greatest ongoings in the PowerShell world.
The festivities kicked off in downtown Charlotte at the Ri Ra Irish Pub this last Sunday.  New network connections were made and old friends reunited over fine brews in the Victorian-style public house before getting a good nights’ rest before the three day summit.