Hello. In this module, we will cover ways to optimize your Azure subscription, including monitoring, price controls, and implementing audits to have consistent policies across multiple subscriptions. In this lesson, we're gonna begin with how to monitor resources, including analyzing log files that could be generated by your Azure services, looking at metrics displayed on graphs and looking at them displayed over time to determine trends. And finally, how to use alerts so that we can be prompted for what would be considered to be abnormal or outlying events. So logs, metrics, and alerts go together. Let's take a look at some of our Azure resources that we've created in this subscription and see what sort of monitoring information would be available. We'll start with virtual machines. We can find virtual machines by clicking on the virtual machine menu item at the top of the screen in our frequently used icons, or we could search for virtual machines in the search bar at the top, or use the hamburger menu on the left hand side of the screen. Now that we've displayed the virtual machine that exists in our subscription, let's select one; see what sort of monitoring we would be able to do. We can see that this virtual machine is actually running; we can see that here in its current status. We can also scroll down on the left-hand side in the menu and towing it down into the monitoring options. To be consistent, Azure always has the following three items available regardless of the service. All services will have alerts, metrics, and logs. Let's take a look at logs first. Logs are typically used when you want to determine the cause of abnormal events. There are different types of logs for databases, virtual machines, and storage accounts. For virtual machines, you need to enable logging which would allow Azure to actually capture statistics about how your virtual machines are performing so that you can analyze those later perhaps to determine if you have the appropriate hardware plan to support the performance that you're looking for. Another way to look at the current performance of a machine is to click on the metrics. The metrics is a great way for you to determine the utilization of your resources. It's very common to purchase a resource that is either too powerful for your particular need or not powerful enough. One of the most common ways to do that is to check one of your metrics such as processor utilization. Let's click on something called CPU Credits Consumed. Because this virtual machine is not getting a lot of use, the chart is actually sitting around zero. But if this was a live machine, you would be able to see if you are perhaps gonna benefit from purchasing more or fewer resources. Usually, a virtual machine utilization around 60 or 70% would be a good target, allowing for you to still have some capacity under high load but make sure that you didn't overbuy. If your virtual machines were consistently running at 20%, you could consider putting them on a cheaper hosting plan. If your virtual machines are constantly running near 90 or a 100%, it would be a good idea to consider increasing your budget and upgrading the hardware plan that the virtual machine is running on. In addition to looking at metrics, you could also then set up the concept of alerts. Once you have used the metrics to determine what would be a normal activity, you could then create alerts to make sure that administrators are notified when something occurs that appears to be out of the ordinary. So let's go ahead and create an alert for this virtual machine. On using the alerts menu option on the left-hand side of the screen, we now see that there is a create button at the top of the alerts menu. We're gonna click that now. What we'll do is we'll create a brand-new alert rule. The first thing that you'll need to do is determine what resource you would prefer to monitor. We are gonna monitor CPU credits consumed. What we're gonna do is we're gonna set this to a threshold of perhaps 70. You can see the chart over on the right-hand side showing us our current utilization over the last six hours and showing the benchmark that we would be sending for our new alert. This is helping us use the monitoring tools to determine what would be considered normal activity so we can be alerted when this activity threshold is exceeded. Notice in the upper right-hand corner, it says that this is actually going to cost 10 cents in US dollars per month. That's because you pay Azure to monitor your services 24 hours a day, 7 days a week to make sure that you have not exceeded this threshold. It'll check every one minute and then come back about every five minutes in order to try it again. This means that this is gonna be ongoing from a monitoring perspective forever. Now, let's go ahead and move on to actions. If our server does exceed 70% utilization, it will activate this alert. When the alert is activated, we can decide what we want to do. In this particular case, we are gonna select a group of people that we would like to be notified. Let's click on create the action group. You can see here we can give it a name, and we'll call it administrators. Then we can click notifications and decide who should be notified when the alert occurs. For example, we could send an email address to one of our administrators. You can see the administrator's email entered there. You could also contact them through a cellular phone call or data call to their standard phone line. Let me give this a name for Admin Email. You can see this interface does allow you to send notifications to multiple people so you can have backup personnel just in case the initial admin misses it. Now, in addition to just notifying people, notice that you can also do actions. If we click on actions, there might be steps that you know you can take to solve the problem. For example, if the virtual machine utilization was over 70%, perhaps you could run a script on the virtual machine to shut down some optional services. If you had that capability, you connect this action to a webhook, a logic app, an Azure function, or PowerShell script in a runbook, or maybe perhaps just create a ticket in your internal IT ticket system so that this can be followed up in another way. These actions are in addition to the notifications. It will both contact administrators through email or phone and then also run these actions if you know that you can take steps in an automated way to solve your problem. Once we create the alert, we'll be able to see that Azure's gonna monitor this, and when the alert has succeeded, we'd be notified through the appropriate action. Stay tuned for the next lesson where I'll show you how to set policies up to audit your subscriptions. Thanks for watching.