Windows Server 2016 is now available on Azure

So the day has come when Windows Server have arrived at Microsoft Azure and you can start deploying your new workloads.

You either find the different flavours from the portal or from PowerShell


And the command for finding them with PowerShell AzureRM module is

and running it looks like this:


Good luck in deploying!


updated AzureRM PowerShell Module with Export of Resource Group

Today the version 1.3.0 of AzureRM module was released and in that there was a new cmdlet Export-AzureRMResourceGroup that can be used on an resource group and get a json file from that!

updating your AzureRM is quite easy with the powershell gallery repository

Screen Shot 2016-03-30 at 12.13.19

And then you can run the Export cmdlet and get the json file from that deployment and start playing in Visual Studio or VS Code 🙂

Screen Shot 2016-03-30 at 11.43.21

Have fun automating and deploying with Azure Resource Manager!

install-service during bootstrap a windows node with chef knife

I was exploring last week how I could add a managed windows node in my internal test environment where I have a chef server.

Bootstrap a windows node has been possible quite a while but not so long ago the knife windows added the parameter for also setting up the client as a service. This was part of the Knife Windows 1.0 release as you can read on the Chef site.

Screen Shot 2016-03-17 at 08.43.37

Another great parameter now available is the –msi_url that gives the possibility to set the chef client msi path to something local if the servers cannot speak to the mighty Internet

happy chef-ing!

Azure Automation – Hybrid job with custom runas account

Microsoft and the Azure Automation team has made it possible to use a custom account when running a job on a hybrid worker and that is awesome! Originally the jobs runs under the Microsoft Management Agent´s service account context and that is not always wanted.

Screen Shot 2016-01-09 at 13.56.43

As I described in a post that I did some time ago I used a parameter -PScredential with the inlinescript but now I can with the new functionality get the whole job in the right user context, the user should be saved as a credential asset in your automation account! Last year also the possibility to use PowerShell scripts runbooks besides Workflow runbooks!

Screen Shot 2016-01-09 at 13.57.15

Happy automating!

Managing Azure workloads with Chef and PowerShell DSC at TechDays


Last week at TechDays me self and Fredrik Nilsson had a session about managing your workloads in Azure with Chef and PowerShell DSC. Despite the fact that we had the same timeslot as Arwidmark, Nystrom and Ben Armstrong our room was quite full of kung fu interested geeks 😉

Here is the presentation so you can find the links and info:

Screen Shot 2015-10-26 at 10.34.23


For you guys that did not have the opportunity to be there, a recording will be available although it is in Swedish…

Using Azure Automation and Hybrid Worker to automate SCVMM tasks


Azure Automation and Hybrid Runbook workers are fun to play with and today I wanted to try something like automating System Center VMM tasks,

I read Markus Lassfolk´s post about changing VM´s network adapters MAC from dynamic to static which is the prefered setting that you should use for your Hyper-V VM´s. So How could I utilize this with Azure Automation runbooks instead of an script that is run on the VMM server?

In my runbook I have a VMM Automation account declared as a credential and I connect to the VMM server with that to be able to reconfigure the VM´s. If I do not use a -PSCredential for the inlinescript the Runbook worker will try to use the system account of the Worker server and that does not work so well on the connection to the VMM server,

Screen Shot 2015-09-09 at 15.24.12

Either start it from powershell console if you have Azure PowerShell module installed or within the GUI and I used only one input parameter and that can be used for an explicit VM or “All” VM´s.

Screen Shot 2015-09-09 at 15.04.50

And as you can see in the VMM log I have changed the VM´s NICS, and also if a VM have two or more NICS all of them get a static MAC configured :

Screen Shot 2015-09-09 at 15.03.07

Hope that you see the potential in Azure Automation and Happy automating!


Updating Slack channels with Azure Automation


I have been playing a bit with Azure Automation again, and my company and also several customers run Slack, ever heard of it? It is gaining grounds in IT as a collaboration tool and email-killer.

With slack you can connect with a web browser or an app that is available for almost all platforms today! this making it really easy to get everyone onboard using it in your projects or teams to keep up to date.

Once you have got a token for your slack account you can update with a new message, in this case PowerShell:

So how can this be utilized with automation?! Assume that you have some deployment or automated build process that either runs in azure or on premise and your devs want to get information if it was successful or if it failed.. So in that deployment runbook in Azure Automation you can call the Update-Slack runbook with parameters to give the user information on what have happened if it failed or if it was successful.

Screen Shot 2015-09-08 at 15.17.45

In the Slack window it shows the user sending and that it is by they Slackbot

Screen Shot 2015-09-08 at 16.00.14

Another way is if you have a system that can send a web request, then you can use the new Azure Automation webhooks to kick of the runbook to update Slack. My runbook example contains parameters for both ways so I do not have to create two different runbooks depending on what way the req comes to start the Update-Slack runbook.

So how do I handle this in the runbook? In the following runbook I have the user and the token saved as variables and three input variables depending on where the request comes from.

As you can see there are numerous ways of updating and of course it can be done for facebook or twitter or some other social platform if that’s prefered 🙂



Azure Automation and Using Hybrid workers runbook on vSphere

During the day I have been digging into the Microsoft Operations Management Suite which is a collection of cloud services that you can get for a quite reasonable price.

The different services included is Log Analytics, Security, Automation, Availability.

I have registered my on premise Windows Servers in the log analyzer and started uploading logs getting a nice overview with several out of the box solutions that will give you a heads up on areas in your environment that needs attention…

Screen Shot 2015-08-25 at 15.19.37


So how about the automation? I have already been using the automaton for different services within Azure but in this case I wanted to see how I could utilize the Hybrid worker and the VMware environment residing there.

With the release of VMware PowerCLI 6 some of the stack are remade as PowerShell Modules.

So if I configure a hybrid worker on premise with the PowerCLI installed I can then utilize that in a runbook that as an example takes an input variable VMName and restarts the VM (in this case I do it without being nice and asking for a shutdown but just pulling the plug)

Screen Shot 2015-08-25 at 16.05.59

And here is the runbook:

Screen Shot 2015-08-25 at 16.02.38

And here I start the runbook with the variable,

Screen Shot 2015-08-25 at 15.51.25

And as you can see in the vSphere Client my VM winrecover restarts

Screen Shot 2015-08-25 at 15.55.19

This can of course be made a bit more complex and also as you can see in the Azure automation view, scheduled. So if you have something that needs to be automated at 11 PM every night within your VMware vSphere environment it can be done by Azure Automation and Hybrid workers..


TechDays Session: Managing your Azure workloads with Chef and PS DSC

Are you possibly going to the TechDays Sweden this autumn ? Me self and my friend and former colleague Fredrik Nilsson will have a session on this conference about automation and how to use Chef and PowerShell DSC for your deployment.

Screen Shot 2015-06-24 at 10.20.32
This session will focus on how Chef, a systems and cloud infrastructure automation framework, can manage both Windows and Linux workloads on Azure or any physical, virtual location no matter the size of the infrastructure easily.

We will also look at how Chef can interact with PowerShell Desired State Configuration to deliver a consistent and compliant infrastructure. In this session you will learn the basic paradigms of Chef, launching VM instances and deploying applications to these instances. It is DevOps times now with a faster and agile world where the IT-Dinosaurs will have to watch out!