>> Hey, friends.
Did you know that Azure Automation runs over
1.3 million jobs a day?
Now, whether that's "Configuration
Management" or "Update Management",
"Operations management", you can use
Azure Automation to simplify your life.
I'm here today with Jenny Hunter
to learn all about it on Azure Friday.
Hey, friends. I'm Scott Hanselman,
and it's another episode of Azure Friday.
I'm here with Jenny Hunter and we're going to
talk about Azure Automation.
It's been out for a couple of years
and has a lot of new features,
always updating things in Azure Automation.
>> Yes, definitely. We have a lot of
cool new things to show today.
So, I'm excited to be here. Thanks for having me, Scott.
>> Cool, and you brought me some demos,
and I love demos.
>> Yes. I brought all demos. So, I want
to start off showing the Azure Automation dashboard.
This is your hub for just kind of automating,
orchestrating, and managing your hybrid environment.
So, to start off, you can see some of
the jobs that you've run in your environment.
So, you see this little donut that
shows you that some jobs have failed,
been suspended or completed,
and kind of gives you that rough percentage.
>> It is the word Job and Runbook,
are they same thing are the different things?
>> So, there's different things. A Runbook is
your script that you're running and
a Job is an instance of it.
So, you trigger a Job which is one set of
that Runbook that was set off
at a particular time with particular parameters.
>> Okay. So, then 97 Jobs have run in
the last seven days of varying levels of success.
But that doesn't tell me how many Runbooks
that those pulled from?
>> Correct.
>> Okay. That makes sense.
>> You can always delve more into
the Job section of
the resource menu in order to see more.
>> Okay.
>> So, overall today,
going to give a brief overview of Azure Automation.
So, looking here we're split into three core areas,
which are "Configuration Management".
This is how do you
control the desired state of your environment.
How do you get to where you need to be?
And how do you know what you have currently?
So, for that we have things like "Inventory",
"Change Tracking", and "Desired State Configuration".
>> Now saying "Desire State Configuration",
which is, kind of, declarative.
I want it to be like this,
figure it out and then scripting which is
more procedural and Azure Automation
doesn't care, you can do both?
>> Yes. We're just had the goal of
becoming that Central Hub
for automation and orchestration.
Again, how do you get your environment
into state it needs to be in?
>> Before we get too far ahead,
I own this already, right?
It comes with Azure.
I don't have to pay anything else to turn
anything on or say opt in to automation?
>> So, you do have to create an Azure Automation Account.
>> Okay.
>> With an Azure Automation Account
you get 500 free minutes
each month to just run different scripts.
Then for a "Change Tracking",
"Inventory DSC", and "Update",
which is another section that we own.
You actually get it included in
your VM as part of being in Azure.
So, you can use all these capabilities
in Azure for no additional cost.
>> So, that you're learning about stuff like this.
I just think that there's so many things
that we are doing and as devs,
as people like myself that are doing it as a really
basic and we don't realize that this is a thing,
you have this now,
you could be using Azure Automation.
I hope the people who are watching
right now are like, "What?
I had? This I can turn this on today."
>> Yeah, and what's cool, we get a lot
of publicity around the "Update
Management" because there's really
nothing like this quite in Azure yet.
So, we're really filling this new niche where you
can both assess and
deploy patches across your hybrid environment
from a single pane of glass.
>> Nice, very cool.
>> Then what I'm going to be focusing on
mostly today is this process automation side,
so how do you orchestrate across
your environment and kind
of bring everything under manage?
>> Okay.
>> So, to start off
since we mentioned it a moment ago I'll just
show you fast the Jobs that is so this is
where you can go to kind of see which Jobs are running?
Where were they run? And what Runbook was run?
You can filter it down if you want
to see specific Runbooks.
Today, I'm going to go though into Runbooks,
and show you one of our cool new capabilities
and it is Python.
So, this is currently in public preview.
So, anyone watching this can try it out today.
This is Python two and
allows you to run against Windows or Linux.
So, if I just go ahead and start this, I can say, Oh,
I want to run it in Azure so that's where we spin up
a Sandbox on our backend and
you don't have to worry about any setup.
I would run against a Windows Container
or I can click "Hybrid Worker".
This kind of highlights one of
our other capabilities which is
the ability to assign an agent to a machine,
and we had this previously available for Windows where
you could run scripts against
your local Windows machines.
But we've expanded this Linux now.
So, here you can see I have
a Linux Hybrid Worker that I had
named HR-RHEL so that's
a Red Hat Enterprise Linux Machine,
and I could input parameters,
this is different from PowerShell,
and that PowerShell strongly type
so you know exactly what parameters you're putting where.
>> Right.
>> Whereas Python you get a list of arguments.
So, I could type like hello
Scott and then I
could put like one, two, three you think here.
>> I see. Positionally, right?
>> Yes. And it gives the positional parameters
and I can go ahead and click that off.
>> To be clear, that's running in
the context of my VM or outside the context?
>> It is running in my VM.
So, my VM sees this as just being a local script.
>> And that's the "Hybrid Worker"?
>> Yes.
>> Do I have to have Python install.
What if I don't have my machine set up in
a great place where it
can do the things that I want to do?
>> So, for Linux, Python is generally comes with the Box.
>> Okay.
>> But for instance if I wanted to run
this against a Windows machine I'd first have to
make sure that the Windows machine had Python installed.
>> Okay.
>> So, I could go ahead.
I see the Job Status is completed already,
but I'm going to go ahead and just kind
of show you what we were running.
So, this is a Python script,
and I could see that it gets me the number of arguments,
prints out my argument,
shows me my Python version some data about
my machine and then it's going to
do a really simple HTTPS,
GET request just kind of show me the response then.
So, I'm going to go back and look at my output,
and here you can see I had three arguments,
which this is the first one is the location of the file.
So, that's where it ran on my machine,
and then here's the whole got I
typed in the one, two, three.
I could see that this is in
fact Red Hat machine that I run
against in Linux run and that
my HTTPS GET request was good.
>> So, you really don't really automate any at
all because the people out there who are
doing any kind of DevOps work or
live in Python pretty much all the time.
So, now they can go and
automate those things and run them within
the context of either Windows or
the Linux machines without any hassle at all.
>> Yes, no hassle.
>> Nice.
>> So, we have this and we also have
just kind of blurr ball, it's out there.
PowerShell is now for both Windows and Linux.
>> Yeah, actually if you delete Python from
your search box there when you were showing me this list,
the first thing I noticed was I was like Where is it?
That's the Python icon.
Hang on, that's a PowerShell icon,
and then what's this one?
>> So, this is a graphical PowerShell.
So this allows you to kind of
visualize PowerShell and what's going on there.
So, I could just click onto this
or probably look the other one but basically,
what it allows me to do is kind of
see the connections between the script.
>> Oh, nice like is it pipeline?
>> Yes. So, each of these boxes
represents a command and you
still have to know PowerShell.
It's still technical but sometimes PowerShell just is
easier to work through if you can
visualize how everything's connecting.
This kind of helps a lot of people who
aren't standard programmers but are
trying to get in and they just think
differently than standard developers.
>> Unless you have a gallery two of
Runbooks can get started from there as well?
>> So, that's a great way to get started,
you could either access it from this "Runbook gallery"
down here in the menu or click "Browse gallery".
So, we have integration with
both Scripts Center in the "PowerShell gallery",
so you could just go ahead and click on
any script you want and it will all just right be there.
For instance, if I wanted to search
the "Powershell gallery",
I can change the source and
then for instance type like Hello world.
>> Well, that's cool. I just saw a Jeffrey Snover go
by there the second it go, yes, Hello world.
You're screens look, save a screen as JPEG,
all kinds of things, really you have full control.
>> Yeah.
All you need to do is press this "Import button",
and goes straight into Automation account.
>> Do I have to worry about security at all, any old,
any random user or
any contributor to my account can do this,
do I have to have
a special permissions to be able to do this?
>> So, you can give people only read access so
that they wouldn't be able to add a new Runbooks,
but if they have contributor access
or higher than they can I add new Runbooks,
they can run the Runbooks.
>> All right. Cool, and I
can schedule these Runbooks as well?
>> Yes you can. So, one of
the cool things about Azure Automation
that really kind of brought us out
from standard PowerShell running locally,
is that you can have all of your assets
in one safe secure place.
So, he have the "Shared Resources" here
which you can see we have "Schedules", we have "Modules",
"Credentials", "Connections",
"Variables" that you can use
across our different services and across your Runbooks.
So, for instance if you have a single variable to
use across a series of automation scripts,
then you can just change it in
one place and it would change
across all your scripts and that
for also the ones running locally.
>> I think, I remember you saying something before we
started the video here that I can even
use Automation to fix
things that I've messed up like people
write "Automation Runbooks" in order to
basically get themselves out of bad situations?
>> Yes. Definitely. So, that's
one thing that's great about
Automation overall but we actually have
a new capability that makes it even easier,
which is "Run Command".
So, this is Azure VM that I'm sitting in right now.
>> Okay.
You're not inside of
Azure Automation you're now on Azure VM?
>> So, I'm still in Azure Automation
>> Okay.
>> And if you go down to the operations section of
the resource menu you'll see "Run Commands"
and so this actually connects at
a deeper level into the VM agent.
So, if you mess up your network rules,
if your firewall is messed up,
you can go ahead and fix it through "Run
Command" and this requires no additional setup.
So, if you go there today,
don't even have an Automation account you could
go "Run Commands" and run a PowerShell script.
>> Interesting. So, maybe I've even turned
off remote desktop or made it so I can't say let
you in and I can still get access to things because
Azure Automation can go around my mistake.
>> Yeah. So, for
Windows Machines you have state access to PowerShell.
So, you could go ahead and
just type in simple PowerShell Commands.
Not only is this great for trying to get through
troubleshooting or some things mess up,
but even just getting like
a quick snapshot of what state is your environment in,
what does it look like?
You don't have to go and remote
desktop into the machine just to run a simple command.
So, here I'm running Get Service,
and so this allows me to see
the services that are running in my environment.
So, I can see some things running,
some things are stopped,
and I can get that list without ever having
to log into the machine.
>> And that's interesting,
some of those I look at and say,
"Oh, shoot this is not supposed to be stopped."
Here you are checking to see if
something is wrong but what if I got
an alert that something
was wrong and I really just didn't
want to have to be the one that gets
the pager call and then I got a log in,
I just want to get the alert and then
have Azure fix the thing for me?
>> Yeah, definitely. And so for that we could
actually integrate straight with Azure Alerts.
So, like "Run Command",
we've done a lot of work recently to really
become core and needed to Azure,
and to be integrated in places that you wouldn't just
assume from the standard Azure Automation Account.
>> Okay.
>> So, here I have open Azure "Monitor" where you
set up your alerts and to make things a little simpler,
I've already started developing an alert.
So, here we have multiple integration points.
One of them is to being able to trigger
base off of either Runbook or account status,
so let's say that someone created a new Runbook in
my account or that one of
my critical Runbooks has failed,
so I can alert on different criteria for that.
But another cool thing is to be able to do action groups.
And so this allows me to actually
trigger a Runbook in response to an event.
So, from here you can see
that I've added my Resource Group and I
created I'm creating my Action Group
and so I've selected a Runbook.
So, a generic Python Runbook in this case,
but if I want to I could use any of
my custom user Runbooks
or I can select a Built-in in Runbook.
So, these are available to anyone,
just straight out of the box.
So, you can choose any number of actions for your VM,
just in response to a trigger from an alert.
>> All of this can be part of a group of actions so I
could say this thing happened restart to the end,
text everybody, send an email and turn on the lights.
>> Exactly.
>> It's very cool.
>> This is available like you said
now and the Python support is in preview?
>> Yes. Python support is public preview.
>> All right. I didn't even notice
I have Azure Automation in my life.
I'm going to go and try to automate all of
the things I'm learning all about Azure Automation,
today on Azure Friday.