Welcome to Microsoft Mechanics.
Coming up on the show,
we give you a first look at how you can use operations management and security,
the unified management of your Linux and Windows server environments,
at scale with Microsoft Azure.
Including, configuration management in your hybrid environment,
and applications using resource manager templates and PowerShell DSC,
applying your IT policy with OMS,
and orchestrating operational tasks using PowerShell and graphical Runbooks.
Microsoft Mechanics
I'm joined by Eamon O'Reilly, an automation expert on the Azure management team.
Welcome.
Thanks Matt, good to be here.
So what's the significance of what we're doing here.
We're giving a common management approach for your infrastructure and your applications.
Spanning Azure and your On-Premises data center.
And this allows customers to now deliver resources on demand using automation
across their incomplete environment.
And this all runs in the cloud?
This all runs from the cloud.
So how have you gone about achieving this?
So we already have an automation service that's a key component of OMS.
And, now with PowerShell open-sourced on Linux,
we now have a consistent management framework
to actually perform actions on Linux and Windows.
So, can you show an example of how this works?
Yeah, I'm going to show you how you can do a complete automated deployment from the cloud
where we have VMs and their applications deployed.
Also On-Premises, were going to deploy some VMs and services to support your data On-Premises.
So I'm inside my automation account and I'm going to go into my Runbooks.
You can see here, the set of Runbooks that I've actually authored for this scenario today.
Now if people aren't familiar with Runbooks, what are they?
Runbooks are basically a set of operational tasks that are automated
either graphically or using PowerShell.
So I'm going to go into my main parent Runbook.
You can see this orchestrates a hybrid cloud deployment of a LAMP stack.
It consists of three Runbooks.
So, I have a Runbook here that deploys MySQL on my local data center.
I also have one that deploys Apache in a VM in Azure.
If it's all successful, I can email
the users that their deployment is complete and they can start using on that service.
So these VMs that are getting deployed, they could be Windows or Linux?
That's right, they could be any number of Linux distros that we support.
In this case, I'm using Ubuntu.
If I go into MySQL environment, you can actually see that this one,
if I scroll down is running on a worker group we have.
so this is the one I'm going to run in the data center.
And then, if I go back into my Apache one that's going to go into Azure,
you can see that this one is not specified a hybrid worker.
So this is going to run in our automation service, and do the deployment from our service.
So it's all going to be deployed centrally from this Runbook?
Yes, it's all going to be orchestrated from this Runbook into a full deployment of the LAMP stack.
Now, one of the reasons this is important is it's a big challenge today for organizations
to spin up an environment for development and production,
that consistent across those environments on demand.
Yeah, that's definitely right.
So, if I go back into my Runbooks, let me show you how this was built.
So you can see here I have a Runbook called WindowsLinuxARMTemplate.
If I go in and look at that,
this is basically an Azure resource manager template
that I'm using to deploy the VM in Azure.
So if you're new to ARM, this is basically a JSON template
and we had a show a little while back with Corey Sanders, that you can check out.
Exactly.
This is a standard JSON template
but one of things I want to call out was, if I scroll down towards the bottom here,
you can see that I'm registering this virtual machine with our automation service.
So now I'm able to actually push or pull the configuration from our service
to actually install the services.
So if I go back out of here to my list of Runbooks
you can see the Runbook that actually calls this ARM template
and deploys everything onto Azure.
So this takes the parameters, the name of the virtual machine, and the type whether it's Windows or Linux.
If I scroll down a little bit here you can see I specify
if it's the Ubuntu server, which is now.
I specify the type of a Ubuntu server I want, as well as that it's a DSC for Linux.
And similarly, I could do it for Windows.
Here's where I call that other Runbook I just showed you that actually generates the arm template file for me.
So this shows you how we can call other Runbooks inside of here.
The last thing I do is I pull in some information I need for the parameters of the ARM template.
So here you can see I'm pulling the password from our asset store
as well as the URI in key so it registers itself with the DSC service.
Then I just deploy that ARM template automatically with those required parameters.
If I go back into Runbooks, I have a similar one here
that actually deploys it locally On-Premises.
And this one is using native PowerShell
to actually deploy the VM and set up MySQL On-Premises.
The last thing I could do is I really want to start this.
I could actually go in and I could click on start.
And this is that parent Runbook I showed you initially where I just give it that name
of my Apache VM, and this will get created in Azure.
I can give it the name of my the MySQL one.
That's the one that they created in your On-Premises data center.
And then, the email of who the users are
so they can get notified when it completes.
And that kind of shows you how you can build out a LAMP stack directly using our automation service.
So, once it's finished how do you know what configuration each VM will get
and whether it's compliant with policy?
So if I go back to my automation account, you can see I have a DSC nodes laid here.
If I open this up, this actually shows all of the computers that are being managed
through our partial desired configuration service.
This allows them to pull the configuration they need.
So if I look at one of my Windows Servers,
I can drill in and I can see it's compliant and the last time we checked in.
If I drill in here, you can see the actual resources that are enabling inside that virtual machine.
So I'm installing some Windows features for IIS
and asp.Net4.5.
I'm creating a website.
I'm downloading the content for the website from Azure storage.
Then I actually go and download the OMS monitoring agent
Then I install that monitoring agent into the VM as well.
So now we get monitoring capabilities on top of that as well as desire to configurations.
All that is automated?
Completely automated, that's the nice thing about desire to configuration.
If you can see, this one just failed as well.
If I went in, this is that Apache one that I just deployed.
You can see that it's failed.
And if I go in I can actually see the resource that's failed.
So it has an example file resource and it's saying that it's not compliant.
So then you can go back into the automation account
and you can actually look at these configurations and see what they're doing.
So that first one I showed you with this website configuration,
where I was setting everything up.
And if I drilled in here and look at the actual configuration
this is where I'm telling it what exactly it's supposed to configure inside of the OS.
Here you can see I was enabling IIS.
This is the ASP.NET4.5.
I'm creating a website and copying content over.
The last thing is, I'm downloading the Microsoft OMS agent.
You can see i'm installing the monitoring agent into the machine.
Now it's under management and talking back into OMS.
If I go back into the failed one, remember it was samplelinux.
I can actually look at this configuration source.
This is actually installing Apache.
So that was successful, but you saw that it was giving you a failure that this example file was failing.
And if I look at what was trying to do
I was checking to see was this file present and did it have this content inside the file.
Since it doesn't since I just created deployment,
it actually tells me that it's failed and then I can actually go and resolve this.
Now to write these configurations and Runbooks, could I use something like PowerShell ISE?
Yeah definitely.
So, there's an add-on available that allows you to author your PowerShell Runbooks
and your configurations and you can install that from the partial gallery.
And just to emphasize all of this management is happening from the cloud.
Yes it's all happening from the cloud.
It allows you to do a complete management of Azure
and On-Premises from the cloud.
It's great to see how you can automatically deploy resources consistently
across clouds and across Windows and Linux.
Yes, so that's one of the key things we have, is we can do management across both Windows and Linux.
So now that we've deployed the infrastructure,
what if I want to be able to do things like operational tasks within the work load or within the virtual machine?
Often times, you get the configuration right, but then you need to do these operational tasks.
If I go back to my Runbooks, we actually want the ability to run commands directly on these machines.
One of the benefits of PowerShell now available on Linux
is that we can actually run commands directly onto those machine to do the operational tasks
like orchestrating, cleaning up temp files, or restarting services.
Maybe you want to enable tracing for a period of time so you can get more diagnostic information.
I have Runbook here, which is this new PowerShell command.
And if I go ahead and start this, it actually runs partial commands.
It's going to run get-process.
That's a familiar command.
Exactly, and I'll say includeusername, so we can see what it's running under.
Then I'm going to specify one of my Windows computers that we just saw.
Under management, I'm going to say it's Windows.
And, because this machine is actually in my local data center,
I'm going to tell the Runbook to run on a hybrid worker and kick that off.
I'm actually going to run the exact same command.
So, get-process again and I'm going to include username.
This time I'm going to specify that Linux computer that we have under management.
That one was called financelinuxmysql.
This time I'm going to say it's Linux that I want to run it on.
Again this is inside my local data center.
I can run these on Azure as well, but since this one's my data center,
I have to run it through the hybrid worker.
So those are both submitted.
So, let me edit the Runbook and kind of show you how this is working.
So if you remember there are three param's we asked for.
The command I want to run, the computer I want to run it on, and the type, is it Windows or Linux?
I check, if it's linux then all I do is I get the credentials that I need for that Linux computer.
Then I open up a session there.
You can see here I'm actually running the new PowerShell shell that just became available on Linux.
And, I'm running the command there.
And in the Windows scenario because it's not Linux, I come down here
and I get the credentials now for my Windows environment.
I create a command.
I just run it using the standard Invoke command you would see in PowerShell.
A really unified approach?
Exactly.
If I comeback in here and I look at that Runbook again I can go to the jobs.
You can see both of these are running.
I can actually look at what I just ran this morning, while they're running.
You can see the input I specified for the same machine.
I put the same get-process in.
And I specified Windows and If I look at the output,
here you can see all the processes that are available on here.
They look like familiar processes.
yeah, I think this would look familiar to most people.
Another thing, if I look for the health service, this is the OMS Monitoring I talked about.
You can see it's available and it's running on the service.
So we can get insights, analytics, and logs from that machine?
Exactly.
And similarly if I go back and look at another one that I ran.
You can see this is the one that specifies against Linux.
The exact same command.
And if i go to the output here, you can now see all of the processes
that are running on that Linux machine that I just deployed.
so cron, Python, and lost of familiar.
Exactly, so one of the ones that we specified was we wanted MySQL
on that machine because that's the one we deployed.
You can see MySQL was configured and it's running inside that service.
Also, you can see PowerShell.
We're using that PowerShell shell that just came out now with open source
of PowerShell and Linux.
It's actually running those commands.
And it's the same language across Windows and Linux?
Exactly.
And if people want to get involved with PowerShell on Windows and Linux
There is a great community out there that supports us.
So, where is all this going?
Yes, our goal is to build the best heterogeneous and hybrid cloud
automation solution for Azure and On-Premises.
With PowerShell now available on Windows and Linux
we have a consistent management solution that you can actually use across both of those.
So across your environment, it's On-Premises, in the cloud,
and Windows and Linux?
How would you recommend someone get started?
So if someone wants to get started,
I would go to the operations management security site and sign up from there.
Or, if they're already using the Azure portal they can get the automation service from there.
Great.
There are some great resources around PowerShell
And, if they really want to get involved they can go to the github site
and actually look at PowerShell on GitHub.
Great, thanks for the awesome overview, Eamon.
Lots to explore there.
Keep watching Microsoft Mechanics for the latest in tech updates.
Goodbye for now.
Microsoft Mechanics
www.microsoft.com/mechanics