[Autogenerated] we're going to start this demo by my teaching you how to
deploy the log analytics agent so that you can unlock Azure automation and
these management solutions and also use cakey well and log analytics workspace
to monitor your hybrid bio infrastructure.
So the easiest way to onboard your Azure virtual machines is at
deployment in your bicep or arm deployment template.
However you also can do so in the context of the workspace if that's your thing,
let me show you if we go into our log analytics workspace and we come
down under workspace data sources virtual machines.
This is going to give you a list of all your machines,
both Windows and Linux that are available across regions.
Note that there's not a region hard limitation like there is with a
virtual network where your Azure VMS have to be in the same region as
the virtual network on which they're placed.
These VMS can cross resource groups locations or even subscriptions.
The requirement is that your log analytics workspace and the VMS need to
be tied to the same Azure AD tenant and in order to deploy the log
analytics agent here we can simply select the machine click connect and
that process will proceed Now with Windows server machines it's possible
to multi home them to where they're sending their logs to multiple log
analytics workspaces.
Check the exercise files because I give you a link on that.
You can't do it from the portal unfortunately.
But that would be useful for instance to have one of your Windows
server machines reporting to your infrastructure log analytics
workspace and then a separate say,
Azure sentinel workspace for security monitoring.
All right now, what about Azure arc?
Let's go to Azure Arc and go over to our Azure arc for servers.
And if we take a look at one of these,
remember from the previous lesson we can deploy or inject
extensions into these machines and if we go to add,
we see that the log analytics agent is one of the options.
That's a convenient way to go for sure if you're interested and desired.
State configuration.
I've given you a configuration file in the exercise files,
I've called it mm agent and basically this is going to automate
the installation of the log analytics agent.
Now this particular dSC configuration is assuming that we're
going to run this in Azure automation.
DsC as opposed to local on prem Dsc but it's pretty
straightforward in its behavior.
We're using the standard issue desired state configuration.
DsC resources and we're making sure that we install the package and we
need to provide any command line parameters to the setup executable down
here and we're also going to need a reference to the log analytics
workspace and one of the api keys and again,
this code here on lines four and five allows us to securely gather
those keys as credentials in your automation account.
You definitely don't want to expose your log analytics api key in plain text.
Let me actually explain that a little bit better if I go
back to the log analytics workspace again.
And if we come down under agents management,
this is where you can manually download the agent for Windows and Linux
and it gives you the raw data here for the workspace idea and you can use
either the primary or the secondary api key.
But again,
those are sensitive and Microsoft recommends that you
periodically regenerate them just to be safe,
ideally you're never going to expose those in plaintext anyway.
And one of the things we can do in the automation account as I
alluded to a moment ago is store credentials.
We can come under shared resources credentials and we can create
the credentials that store the log analytics workspace ID and
either the primary or secondary key.
And again,
the convenience there is that we can tap those credentials easily from within the automation account.