AZ-304 Microsoft Azure Architect Design – Design for cost optimization

  • By
  • January 17, 2023
0 Comment

1. Design Monitoring (10-15%)

Alright, we’re getting into the course. The first major section of the exam says design monitoring. And that is where ten to 15% of the exam score. Now, that design monitoring is broken up into two subsections. One has to do with monitoring of costs and the other has to do with general logging and monitoring of your resources. When it comes to monitoring your costs, we have to know how to find the cost cost Optimization section within the Azure Portal. How to extract cost reports, schedule them, set up alerts and budgets.

And also, what can you do to reduce costs in your account? The second topic of that is logging and monitoring. And so, in this course, we’re going to talk about logging, setting up diagnostic tools, azure Monitor and Sentinel, all of the various monitoring tools and logging solutions. Now of course, all of these have to do with Microsoft recommended solutions, not third party recommended solutions. So keep that in mind when it comes to this exam. Let’s get going.

2. *NEW* Cost Optimization Overview

All right. So we’re going to start off by talking about cost optimization in this section. And cost optimization when it comes to this exam has to do with cost management, cost reporting and minimizing costs. So let’s get into that. Now what you’re going to find is when you move from a traditionally hosted environment, whether it’s on premises or vendor hosted environment, to the cloud, then you’re actually taking on additional management tasks when it comes to costs, managing costs. And now the cloud environments, in particularly Microsoft Azure, give you various tools in order for you to view your costs, report on your costs, investigate where your costs are growing, and to be able to take actions on that.

And Now, one of the challenges of the cloud environment is one of its strengths. And so the fact that there are no more physical limitations on servers in your environment or disk space is going to basically be an opportunity for you to spend more than you were planning to when you were in a self hosted or a vendor hosted environment. You did have certain limitations. You have only so many terabytes of disk space, only so many servers that are available to you. And getting more disk space and getting more servers might have been a bit more of an ordeal. You needed to put a business case together. You needed to get the accounting team to sign off. You need to go to the vendor and order the hardware, get it shipped in, install it.

And There was a whole deal around making your data center bigger. Well, when you get into the cloud, then that ordeal becomes a lot simpler. Now again, we can list this as a big strength of the cloud, but it is also, of course, a temptation. So when you are in the no limits on physical space, you’re going to find when you’re discussing applications that need to store files, that you’re not going to be too concerned about how much displace things take. If you have a backup environment and you can like, well, we don’t have to delete these files because there’s no physical limitation that’s forcing us to cut down. So the fact that you are unlimited both a strength and a challenge.

And The other challenge within the cloud environment is that resources become really easy to create. And of course your developers and your QA team, other people within your environment, if you give them authorization, can create resources as well. And so there’s a possibility for a rapid expansion in the control of your environment even if you fence them off and you say, this is the development resource group and any developer can create a server inside this resource group, then they can. And so what you’re going to probably want to do is place certain limitations on that. You want to limit who can create resources, what kinds of resources they can create, and what kind of authorization is required.

And If resources are going to be longer term. So if they create a server that they know are going to last for months or years, that’s a different situation than if they just need to spin up a machine for a couple of days to do some QA testing and then they’ll delete it. And so now it becomes a company policy type and type situation where you want to have some more control over this in order to take advantage of the power but not have it be a burden to you. So I am going to suggest that you have a cost optimization strategy. Now perhaps in the past when you had self hosted environment or your vendor hosted, the costs were known, you signed a contract upfront, you knew how much you were paying and adding to that cost became a deal that required many people to authorize accounting teams to sign off and the budget had to be changed. But that’s no longer true.

And And so you’re going to basically want to add to your routine a cost monitoring task. And so various stakeholders are going to have to be informed of the costs. And if there’s anything that is unexpected, how is that going to get identified and highlighted and we’ve obviously eventually rectified. Speaking of rectifying these, I personally believe that cost savings is a skill. Being able to look at an Azure subscription, see the costs and realize that something can be done cheaper is a skill in your It team. And so you should probably have one or more people who can work on that skill, take the various training courses, keep up to date on all of the latest Microsoft tools in terms of cost management and then they’ll know that they can convert this into a reservation, they’ll convert this into something else. This is unnecessary. Backups can be trimmed down to fewer number of backups, et cetera. So that is a skill and somebody should be able to work on that skill and be the go to person effectively for keeping costs low. So that’s the active part of reducing costs as opposed to monitoring costs.

And Now, I do have several videos in this section talking about these strategies. So I just mentioned reservations, I’m going to get into that. We’re going to talk about predict cost with pricing calculator. We’ll be talking about choosing between different types of hosting if you’re going to do an infrastructure as a service in a virtual machine or a web app or service fabric. Although those different options and the implications between performance and costs, there’s always a trade off between availability, security, performance, cost, things like that. And so we’ll talk about those strategies for detecting costs, monitoring costs, reducing costs. As we go through this section of the course.

3. *NEW* Pricing Calculator

So we’re going to start off talking about cost optimization. Cost optimization is just another way to say either reduce costs or get more value out of what you’re paying for. Now I’ve noticed in some of the projects that I’ve worked on that cost can just grow and get away from you if you’re not careful. I worked on a project a couple of years ago where, where the storage costs were starting to approach a million dollars a month for the company. And then it reaches a certain point when somebody has to start to look into what’s using up all this storage and can we archive it, could we delete it? We ended up finding that there’s images that are being stored duplicate places and so a large chunk of our storage is just unnecessarily duplicated. You could almost say that when you do the deployment of an application, it is extremely well organized, obviously the first time that you do it. And then over time, ad code gets added, functionality gets added, storage starts to grow, log files.

Over time things start to get bigger and if you’re not careful, then you basically find yourself in that situation that my old client did where they just woke up one day to a bill that they were not necessarily expecting. It’s also possible in a development sense where you’re just duplicating environments, backing up things, restoring it over here, playing around, but you don’t do a full clean up every time. And so you end up with directories and code and examples and samples and tests and they just start to accumulate if somebody isn’t pruning them or properly managing them. That’s just life in the development world, right? So we’re going to talk about a number of items in this video, in the following videos in terms of how you’re going to get a handle on costs.

So I think the first place we can start is the Azure pricing calculator. So you can go to the pricing calculator online. It has a very shopping cart model where you add services to your basket, you set the configurations and it will give you an estimate based on your best guess of what it’s going to come to. Now you can see when you go from standard storage to premium storage, what the difference in pricing is, or if you end up with four of this server instead of two of that server, what the side by side comparison is. So basically being able to compare actual estimated costs is very helpful. Now, estimating is an imperfect science and it’s very hard to know in advance how much CPU you’re going to use, how many executions, how much bandwidth.

You can only make rough guesses, but as long as those guesses are consistent, then you should be able to go into the pricing calculator and make an educated guess and compare apples to apples. So why don’t we fire up the pricing calculator, have a look at an example. So if you go to the Azure website at Azure Microsoft. com, you’ll find pricing as a top level menu item along the top. It’s also accessible when you’re in the docs website. And if you open up this menu, you will see four areas of interest. The first area is just a list of the pricing, how each of the Azure services is charged, understanding that a service is not just charged based on one metric, that there might be two or three other metrics that are charged. And each of them are charged independently. For example, CPU utilization, number of executions, the amount of storage, the amount of bandwidth, the IP addresses you’ve reserved.

Those are all things that have independent pricing. Azure Cost Optimization exactly what we’re talking about. So this is learn how to manage and optimize your cloud spending. Pricing calculator is what we’re interested in. This is the page that we’re on right now. And we’re also going to talk about the total cost of ownership calculator. Because running Compute Services into the cloud, you’re not only saving the difference between the price of the hosting it yourself, but you’re also saving the time, the effort, having people on staff, the electricity, the Internet, et cetera. So there’s a lot of things that go into the cost of running your own services besides the per hour charge you might get charged. So we’re on the pricing calculator.

Now, there are some example scenarios if we just want to see. But what I wanted to show you was this shopping cart metaphor. Let’s say we want to compare the price of two different virtual machines. You might want two of one type of server and three of another type of server. I can click on virtual machine and you can see it says Virtual machines added. So if I scroll down, we’ll see that it’s added one virtual machine into my estimate. Now in this particular case, let’s say I wanted to compare this. Let’s say it’s a D eight server, and I’m going to need two of them. Okay? It’s a windows machine in the West US. Region. I’m not having additional services on top. So this is all pretty standard pay as you go licensing license are going to pay for it. And so we can see here for two virtual machines, it’s coming up with $1191 per month. Okay, now I can then compare so there’s a way of duplicating the service. And so if you click this clone button, we’ve now added another virtual machines to the bottom. But in case I want to do three virtual machines that are less powerful. So let’s say D four S, so half the CPUs, but three of them instead of two of them, I leave everything else the same.

And I can see the difference right away that I’m saving a couple of $100. So sort of a side by side comparison, that is $300 in savings by using three D Four servers as opposed to servers. This is the kind of thing you can do to optimize your cost by seeing one thing versus another. And this doesn’t take, of course, everything into account, but you can sort of see where your savings are at right within the support calculator, right within the pricing calculator. Now, of course, with any application, you do have to know that you’re going to be using storage alongside of this. You’re going to be using brand width, things like that. So maybe there’s some additional costs that come in here, but comparing the two servers shouldn’t change the amount of storage or the amount of bandwidth, right. So that’s still an apples to apples comparison. So this is the Azure pricing calculator. Definitely worth checking out. And you can start to play with maybe compare a virtual machine to a web app, et cetera, and see what the virtual differences are between prices of even the style of development.

4. Refactor / Rearchitect

Something that is sometimes overlooked when we’re talking about reducing costs is that sometimes it’s your design decisions and your coding that lead to excessive costs. And so you’ve chosen perhaps to create a monolithic application that runs on a massive server that needs to be running twenty four seven. And if you, you had chosen a different design, let’s say you chosen a micro services framework, then perhaps you would require less powerful servers and less of them as an example. And so sometimes you just have to say, you know what, this application is too big, too cumbersome. Scaling it is too tough and we do have to break it apart and do some redesign.

Sometimes it is just cheaper to scrap something and recode it than to try to patch it for the 20th time. All applications have a value, right? So this application brings this much value and has this much cost. Well, if your cost is starting to reach your value, then the organization can genuinely start to debate whether it’s worth supporting when the cost and the value are pretty much the same. If we look at the types of applications that run in a cloud environment, when we talk about microservices, we’re talking about server less apps, platform as a service, those can be cheaper, I say can, than traditional monolithic applications. And it all is basically how you design the application, right?

So let’s look at what’s called the Cloud Application Framework and the Well Architected Design Framework from Microsoft to get some ideas. So let’s have a look at a couple of the resources that Microsoft provides for you to actually design applications that are designed to work well in the cloud, which can deliver enormous value and save you money. The first one I want to point out is the one called Microsoft Cloud Adoption Framework. And so the Cloud Adoption Framework is really a collection of best practices and tools that will allow you to achieve your objectives. Now one of these objectives could be for the money saving aspects. And so again there’s design plan, there’s the coding, migration and managing.

And managing is where you’re going to find things around cost savings and platform efficiency, things like that. You can see even it comes down to how your organization thinks about how it uses cloud resources. The second resource I’ll point out is called the Microsoft Azure well, Architected framework. And so the Well Architected Framework has five pillars of architecture excellence and one of those pillars is cost optimization. And so if you’re looking at tools and checklists for saving money in the cloud, you might want to check out the Well Architected Framework. In fact, if we drill down into cost optimization, we can see that there’s a whole section talking about it. And here are some of the principles. So aim for your cost to be scalable.

The more people and services that you deliver, the more costs. But the less services, the fewer the costs pay for consumption, right? Sizing we’re going to talk about some of these things in this section. And there’s even have this checklist that you can go through if you’re looking to optimize costs. You can basically just go through, read the checklist, click on the documentation, and run the check against your own environment. And you can sort of see all of the things with the clickable links, the instructions, et cetera. And in fact, more than a checklist is a tool. And this tool is called the Azure well, architected review.

Now, you can create this review at a point in time, give it a name, sign in with your Azure credentials, and it’ll actually pull in any of the Azure Advisor recommendations into the review if you choose. Cost optimization is one of your priorities, which I did at this moment. It’ll give you a list of items to go through to see how well you’re doing on optimizing costs. And so there are a number of tools within the Microsoft world, the Well Architected Framework and the Cost Adoption Cloud Adoption Framework particularly, that will help guide you through this review of costs. And you should take advantage of these tools if you’re finding yourself in that situation.

5. *NEW* Azure Advisor

So the next thing that you should be looking at in terms of cost optimization is Azure Advisor. Now Azure Advisor is a tool that will analyze your actual usage in your account and make recommendations to you for you to save money. So instead of it being just a general checklist that you yourself have to go down, it’s actually looking at the way that you’re using Azure and it’s looking for patterns. Now, there are dozens of different types of recommendations that Azure Advisor can make. So Azure Advisor makes recommendations across five different categories reliability, which was formerly the High Availability category, security, Performance, Cost, and a relatively new one called Operational Excellence.

Now, if we look at some of these, let’s look at cost optimization, we can see that there are effectively about a dozen cost optimization suggestions that it can make. So it’s going to look at your virtual machines that are what are called underutilized, where the CPU utilization is less than 3% 95% of the time, and network utilization is also less than 2%. If you have a VM which is effectively doing nothing, azure Advisor is going to recognize that and it’s going to make a recommendation for you to resize that or shut it down. It’s also going to be looking at database servers, express route circuits that aren’t being used, virtual network gateways that are idle, et cetera.

If you’re using virtual machines over the past 30 days and you could save money with a reservation, it would also make those recommendations. So we can see that the cost optimization of Azure Advisor is actually going to try to it’s best to try to recommend to you to do things you can do to save money. Now, the Azure Advisor on my own account is going to be really boring. I tend to shut off resources that I’m not using, and I’m only using this for teaching. But if we go into the search and we find Advisor, we’re going to be able to see those five categories cost, Security, Reliability, Operational Excellence, and Performance.

For instance, in the security category, you can see I have 35 recommendations that I should follow up on, and at least half of those are high impact. But unfortunately, under cost recommendations, since I don’t keep resources running for too long, I am green checkmark there. So, as I said, kind of boring. But if I did have recommendations, they would be in here, and then I can choose to nor them. I could choose to follow up on them. It would be like a checklist style. So following Azure Advisor at least going into the cost section and seeing what the recommendations are and trying to make a decision in terms of whether you should follow that or ignore it is definitely one way to save money within Microsoft Azure.

6. *NEW* Cost Management and Billing

Of course, we’ve overlooked one of the greatest sources for finding out where you can save money, and that is your bills and invoices. So the Azure Cost Management section of the portal will tell you how you’ve been spending money in Azure. It’s quite a dynamic tool that allows you to filter based on days, based on services tags. If you use them, you can identify trends. It can actually forecast into the future you’re spending. You can set budgets. Although budgets are more of an alerting mechanism, it won’t actually shut down your services. And you can see how effective you are tracking to a budget. And it alerts you when you’re starting to come up against that. And you can have reports and things like that. So let’s go into the portal and have a look at the Azure Cost Management section. Now hopefully my cost Management section is a bit more interesting than the Azure Advisor. You can see that I have the cost management pinned to my menu.

If you go under all services and you start typing coast, it will come to the top as cost management and billing. Now cost management, billing, you can have multiple subscriptions and you can see that I do in fact have a couple of subscriptions that are coming up with different amounts of costs. I’m going to minimize this menu. Now I can go back and see historical invoices under the invoice section, or I can click into the subscription and I can start to see some more of a dynamic view. So let’s look at the invoices section and we can see that it can show me what my last set of invoices are and I can change to the other subscription over the last twelve months.

You can see that I’m paying somewhere between $20 and 100 and $195 a month for Azure services. Now let’s go into individual subscription here. So if I click on it, this is where we get into the description view. And if I wanted to start to play with the cost, I go under cost analysis. Now the cost analysis tool is going to look at the cost that you’ve accumulated in your account. It does take a second to load it’s. Doing a forecast here. You can see that I’m coming up on. I got about three days left till the end of the month. So my forecast is not too far off of my actual cost. You can see, as the month went on, when I accumulated costs and when I was able to cause the cost to slow down, I could probably tie when I’m doing a particular video lectures and teaching to these periods, I turn something on, maybe I forget about it, turn it off, and go through a period where I’m not doing those things.

There’s these types of pie charts that will break out something by service name, by location, my resource group name, if that is what’s important. If you name your resources groups well and you use that to keep projects together. You could probably see which projects in your account are incurring the most costs or which service. Now, I often find that I need to add some filters to this chart in order to get any value out of it. So let’s say I want to see, well, this is an entire month and a lot of those costs are transitory. I turn them on, I do something, I turn them off. I can filter down to a one week billing period. And now I can see where the money was being spent. I didn’t spend actually too much in the one week I spent $4 only.

And I can see I basically have a Cosmos DB database here that is my main source of cost right now. Then you can also check cost by resource, daily cost by service for different views on the same data. So the tool does have some flexibility for you to do filtering based on date, based on other things such as your the location, the region of the world, what type of this meter is basically what the charge is. So it could be bandwidth or CPU or storage. Those are the meter types. Now, if none of this is good enough, you can always download the data and pull that into an Excel spreadsheet, et cetera. This tool also has an API. So if you are sophisticated and you can write some code, you can actually pull down your costs using the Azure API into your own systems or into your own tools to do more in depth analysis on it.

So the Cost Management Tool is going to be the main way you’re going to find out what resources in your account are costing you and then you can start to investigate. Let’s say you see that it’s the app service plan that has the highest amount of cost. Then you can try to figure out what can I do to reduce the cost? Is there opportunity? You can start to look at the reports for this particular service and see if there is an over provisioning of these services. So Cost Management Tool is really the tool you use to monitor and let your costs mean ten different ways.

7. *NEW* Reservations and Hybrid Benefit

Now, let’s talk about a few of the specifics you should look into when it comes to reducing your ongoing costs. So you know that the cloud computing environment is a very flexible way of creating and destroying resources on demand and scaling. But something that is relatively surprising to some people is that you you can actually reserve your instances in Azure and pay for them one year or three years in advance and save significant money. This is called reserved instances.

So you might have a server farm that contains at least 20 web servers at any one time, and you’re not going to reduce that to ten or to five anytime soon. You know with 100% certainty that for at least the next one year you’re going to need those 20 web servers. Well, you can save significant money by reserving those servers. So this is for predictable workloads, not for workloads that are scaling, bursting, anything that’s only certain hours of the day or certain days of the month. If you have 24/7 workloads, you can get reserved instances that will save you money.

Now, the other thing about reserved reservations in general is not just for instances. You can have other types of reservations cosmos, DB, SQL Database reservations, storage reservations, et cetera. So you should investigate whether any of those services that you’re using that you know, that you can’t get rid of can save money based on reservations. Now, reservation is a one or three year commitment to Azure. And if you do that, you can save 50% or 70% off compared to paying by the hour or by the gigabyte. So reservation is definitely something to look into if you’ve got a baseline of resources that you’re never going to be able to go below.

Now, somewhat related to that is something called hybrid benefit. So if you have an enterprise relationship with Microsoft and it includes some Windows operating system licenses or some SQL Server licenses, you can basically use those licenses that you’ve been granted in the cloud. So instead of using them in your on premises servers, you indicate that these are hybrid licenses. And that is an additional set of savings. And so we saw from if we were to go into pricing calculator, we could do that math and see the types of savings. We’re talking about switching over quickly. We can look at two virtual machines that are D eight s that we saw before is $1,190 per month. If I move it to a reservation, that 1190 goes down to 920, which is 40% discount. And if I’m willing to commit for three years, it goes into the 780 range, which is another type of of discount. And then if I say I’m going to reuse my operating system license, I go all the way. So from originally 1190 per month down to $248 because I’m committing to a reservation and I’m reusing my Windows licenses from my on premises.

8. *NEW* Licensing and Server Size

Now I should probably reinforce this point specifically about hybrid benefit, but there’s other licensing choices that you can make. Many pieces of software have developer licenses that are different than production licenses. And so making a complete sure that you have developer edition licenses for your development servers is going going to save you money. So don’t pay for production server licenses when you don’t need to, and also don’t pay for licenses such as in the case of Windows Operating System or Linux, when you are already covered by your existing business agreement with the vendor.

So if your business agreement with Microsoft includes Windows Server licenses to a certain quantity, you better make sure that you’re using those licenses instead of just having them sit there unallocated and then just blindly paying for a new license in the cloud. So that hybrid benefit is a really good thing to make sure that you can take advantage of if you are having these licenses provided elsewhere, you also don’t want to find yourself unlicensed.

So don’t claim that you are using hybrid benefit when you don’t have such an agreement and always be accurate when it comes to reporting these things. Now if you look at their so I said the hybrid benefit is the Windows and SQL Server that have the Bring Your Own license offers. The things like SQL Server have a development addition. So again, don’t waste a standard Edition license or worse on a development SQL Server, so keep an eye out for that. Now, while we’re talking about this, I’m also going to talk about making sure that your servers are running on the right sizing. This is called right sizing.

So you’re going to besides the Azure Advisor, which will basically tell you when things are idle, even if something is not idle, but it’s only running at 10% or 20% capacity, then there’s an opportunity for you to go down a size as long as the service level agreement and the other factors can fit within your use. So for instance, if you’re running a four CPU Server, but again that CPU utilization doesn’t get anywhere close to ten or 20%, then maybe you can get away with only a two CPU Server and that’s generally half the price. Same is true for Azure SQL Database or any kind of other database product within Azure. You are also looking at pricing for premium users within Azure Active Directory. And if your users don’t require those premium services, then you’re paying six or $9 a month per user for services that you’re not using. Same is true for the provisions around networking load balancers versus premium load balancers. You’re basically paying for extra things that you’re not using, or web application firewalls that aren’t configured even et cetera.

So anything you can reduce the size of not only reduces the cost, but it also effectively reduces waste within your environment, electricity usage, and other environmental concerns. For instance, I showed you there were over 300 different virtual machine sizes within Microsoft Azure and you might not even be familiar with all of the options available. So if you’re using a larger server simply because it has more memory and more Ram, but you don’t really need the CPU on that, then there are memory optimized instances as opposed there are compute optimized instances. So make sure you’re running on the right side server.

Comments
* The most recent comment are at the top

Interesting posts

Everything ENNA: Cisco’s New Network Assurance Specialist Certification

The landscape of networking is constantly evolving, driven by rapid technological advancements and growing business demands. For IT professionals, staying ahead in this dynamic environment requires an ongoing commitment to developing and refining their skills. Recognizing the critical need for specialized expertise in network assurance, Cisco has introduced the Cisco Enterprise Network Assurance (ENNA) v1.0… Read More »

Best Networking Certifications to Earn in 2024

The internet is a wondrous invention that connects us to information and entertainment at lightning speed, except when it doesn’t. Honestly, grappling with network slowdowns and untangling those troubleshooting puzzles can drive just about anyone to the brink of frustration. But what if you could become the master of your own digital destiny? Enter the… Read More »

Navigating Vendor-Neutral vs Vendor-Specific Certifications: In-depth Analysis Of The Pros And Cons, With Guidance On Choosing The Right Type For Your Career Goals

Hey, tech folks! Today, we’re slicing through the fog around a classic dilemma in the IT certification world: vendor-neutral vs vendor-specific certifications. Whether you’re a fresh-faced newbie or a seasoned geek, picking the right cert can feel like trying to choose your favorite ice cream flavor at a new parlor – exciting but kinda overwhelming.… Read More »

Achieving Your ISO Certification Made Simple

So, you’ve decided to step up your game and snag that ISO certification, huh? Good on you! Whether it’s to polish your company’s reputation, meet supplier requirements, or enhance operational efficiency, getting ISO certified is like telling the world, “Hey, we really know what we’re doing!” But, like with any worthwhile endeavor, the road to… Read More »

What is Replacing Microsoft MCSA Certification?

Hey there! If you’ve been around the IT block for a while, you might fondly remember when bagging a Microsoft Certified Solutions Associate (MCSA) certification was almost a rite of passage for IT pros. This badge of honor was crucial for those who wanted to master Microsoft platforms and prove their mettle in a competitive… Read More »

5 Easiest Ways to Get CRISC Certification

CRISC Certification – Steps to Triumph Are you ready to stand out in the ever-evolving fields of risk management and information security? Achieving a Certified in Risk and Information Systems Control (CRISC) certification is more than just adding a prestigious title next to your name — it’s a powerful statement about your expertise in safeguarding… Read More »

img