Azure Cost & Governance Guide
Azure Cost & Governance Guide
Outline
• Azure Cost Management
• Azure Governance and Compliance
• Managing and Deploying Azure Resources
• Azure Monitoring Tools
3
Outline
• Azure Cost Management
• Azure Governance and Compliance
• Managing and Deploying Azure Resources
• Azure Monitoring Tools
4
Resource Type
A number of factors influence the cost of Azure resources. The type of
resources, the settings for the resource, and the Azure region will all have an
impact on how much a resource costs.
When an user provisions an Azure resource, Azure creates metered instances
for that resource.
The meters track the resources' usage and generate a usage record that is
used to calculate the bill.
Examples
• With a storage account, users specify a type such as blob, a performance tier, an
access tier, redundancy settings, and a region.
− Creating the same storage account in different regions may show different costs and
changing any of the settings may also impact the price.
• With a virtual machine (VM), users may have to consider licensing for the operating
system or other software, the processor and number of cores for the VM, the
attached storage, and the network interface.
− Just like with storage, provisioning the same virtual machine in different regions may result in
different costs.
•
6
Consumption
Pay-as-you-go where users pay for the resources that they use during a billing
cycle us utilized
• It’s a straight forward pricing mechanism that allows for maximum flexibility.
However, Azure also offers the ability to commit to using a set amount of cloud
resources in advance and receiving discounts on those “reserved” resources.
− Many services, including databases, compute, and storage all provide the option to
commit to a level of use and receive a discount, in some cases up to 72 percent.
− When users reserve capacity, they are committing to using and paying for a certain
amount of Azure resources during a given period (typically one or three years).
− With the back-up of pay-as-you-go, if users see a sudden surge in demand that eclipses
what they have pre-reserved, they just pay for the additional resources in excess of their
reservation.
− This model allows users to recognize significant savings on reliable, consistent workloads
while also having the flexibility to rapidly increase their cloud footprint as the need arises.
7
Maintenance
The flexibility of the cloud makes it possible to rapidly adjust resources based
on demand.
Using resource groups can help keep all of the resources organized.
In order to control costs, it’s important to maintain the cloud environment.
• For example, every time a VM is provisioned, additional resources such as
storage and networking are also provisioned.
• If the VM is deprovisioned, those additional resources may not deprovision
at the same time, either intentionally or unintentionally.
• By keeping an eye on your resources and making sure you’re not keeping
around resources that are no longer needed, you can help control cloud
costs.
8
Geography
When most resources are provisioned in Azure, a region needs to be defined
where the resource deploys.
Azure infrastructure is distributed globally, which enables users to deploy their
services centrally or closest to their customers, or something in between.
With this global deployment comes global pricing differences.
• The cost of power, labor, taxes, and fees vary depending on the location.
• Due to these variations, Azure resources can differ in costs to deploy depending on
the region.
Network traffic is also impacted based on geography.
• For example, it’s less expensive to move information within Europe than to move
information from Europe to Asia or South America.
9
Network Traffic
Billing zones are a factor in determining the cost of some Azure services.
Bandwidth refers to data moving in and out of Azure datacenters.
Some inbound data transfers (data going into Azure datacenters) are free.
For outbound data transfers (data leaving Azure datacenters), data transfer
pricing is based on zones.
A zone is a geographical grouping of Azure regions for billing purposes.
Bandwidth Pricing Page:
• https://azure.microsoft.com/en-us/pricing/details/bandwidth/
10
Subscription Type
Some Azure subscription types also include usage allowances, which affect
costs.
For example, an Azure free trial subscription provides access to a number of
Azure products that are free for 12 months.
• It also includes credit to spend within first 30 days of sign-up.
• Also granted access to more than 25 products that are always free (based on
resource and region availability).
11
Azure Marketplace
Azure Marketplace lets purchase of Azure-based solutions and services from
third-party vendors.
• This could be a server with software preinstalled and configured, or managed
network firewall appliances, or connectors to third-party backup services.
When products are purchased through Azure Marketplace, users may pay for
not only the Azure services that they are using, but also the services or
expertise of the third-party vendor.
• Billing structures are set by the vendor.
All solutions available in Azure Marketplace are certified and compliant with
Azure policies and standards.
• The certification policies may vary based on the service or solution type and Azure
service involved.
12
Pricing Calculator
The pricing calculator is designed to give an user an estimated cost for
provisioning resources in Azure.
The user can get an estimate for individual resources, build out a solution, or
use an example scenario to see an estimate of the Azure spend.
The pricing calculator’s focus is on the cost of provisioned resources in Azure.
The Pricing calculator is for information purposes only.
• The prices are only an estimate.
• Nothing is provisioned when an user add resources to the pricing calculator, and the
won't be charged for any services you select.
With the pricing calculator, the user can estimate the cost of any provisioned
resources, including compute, storage, and associated network costs.
• The user can even account for different storage options like storage type, access tier,
and redundancy.
13
Pricing Calculator
https://azure.microsoft.com/en-us/pricing/calculator/
14
https://azure.microsoft.com/en-us/pricing/tco/calculator/
16
Budgets
• A budget is where an user set a spending limit for Azure.
• Budgets can be set based on a subscription, resource group, service type,
or other criteria.
• When a budget is set, a budget alert is also set.
• In the Azure portal, budgets are defined by cost.
• Budgets are defined by cost or by consumption usage when using the
Azure Consumption API.
• A more advanced use of budgets enables budget conditions to trigger
automation that suspends or otherwise modifies resources once the
trigger condition has occurred.
• Cost Management budgets are created using the Azure portal or the
Azure Consumption API.
19
Cost Alerts
Cost alerts provide a single location to quickly check on all of the different
alert types that may show up in the Cost Management service.
The three types of alerts that may show up are:
• Budget alerts
• Credit alerts
• Department spending quota alerts
20
Budget Alerts
• Budget alerts notify an user when spending, based on usage or cost,
reaches or exceeds the amount defined in the alert condition of the
budget.
• Budget alerts support both cost-based and usage-based budgets.
• Budget alerts are generated automatically whenever the budget alert
conditions are met.
• All cost alerts can be viewed in the Azure portal.
• Whenever an alert is generated, it appears in cost alerts.
• An alert email is also sent to the people in the alert recipients list of the
budget.
21
Credit Alerts
• Credit alerts notify users when their Azure credit monetary commitments
are consumed.
• Monetary commitments are for organizations with Enterprise Agreements
(EAs).
• Credit alerts are generated automatically at 90% and at 100% of an
organization’s Azure credit balance.
• Whenever an alert is generated, it's reflected in cost alerts, and in the
email sent to the account owners.
22
Managing Costs
• As cloud usage grows, it's increasingly important to stay organized.
• A good organization strategy helps understand cloud usage and can help
manage costs.
• One way to organize related resources is to place them in their own
subscriptions.
• Users can also use resource groups to manage related resources.
• Resource tags are another way to organize resources.
24
Resource Tags
A resource tag consists of a name and a value.
One or more tags can be applied to each Azure resource.
Resource tags provide extra information, or metadata, about resources.
This metadata is useful for:
• Resource management:
− Tags enable an user to locate and act on resources that are associated with specific workloads, environments,
business units, and owners.
• Cost management and optimization:
− Tags enable users to group resources so that they can report on costs, allocate internal cost centers, track budgets,
and forecast estimated cost.
• Operations management:
− Tags enable users to group resources according to how critical their availability is to their business.
− This grouping helps users formulate service-level agreements (SLAs) - an uptime or performance guarantee
between you and your users.
• Security
− Tags enable users to classify data by its security level, such as public or confidential.
• Governance and regulatory compliance:
− Tags enable users to identify resources that align with governance or regulatory compliance requirements, such as
ISO 27001.
− Tags can also be part of an organization’s standards enforcement efforts.
− For example, it might be required that all resources be tagged with an owner or department name.
• Workload optimization and automation
− Tags can help users visualize all of the resources that participate in complex deployments.
− For example, they might tag a resource with its associated workload or application name and use software such as
Azure DevOps to perform automated tasks on those resources.
25
Outline
• Azure Cost Management
• Azure Governance and Compliance
• Managing and Deploying Azure Resources
• Azure Monitoring Tools
28
Microsoft Purview
Microsoft Purview is a family of data governance, risk, and compliance
solutions that helps users get a single, unified view into their data.
Microsoft Purview brings insights about users’ on-premises,
multicloud, and software-as-a-service data together.
With Microsoft Purview, users can stay up-to-date on their data
landscape thanks to:
• Automated data discovery
• Sensitive data classification
• End-to-end data lineage
29
Microsoft Purview
Azure Policy
Azure Policy is a service in Azure that enables users to create, assign, and manage policies that
control or audit their resources.
These policies enforce different rules across user’s resource configurations so that those
configurations stay compliant with corporate standards.
Azure Policy enables users to define both individual policies and groups of related policies,
known as initiatives.
Azure Policy evaluates user’s resources and highlights resources that aren't compliant with the
policies that have been created.
Azure Policy can also prevent noncompliant resources from being created.
Azure Policies can be set at each level, enabling users to set policies on a specific resource,
resource group, subscription, and so on.
Additionally, Azure Policies are inherited, so if a policy is set at a high level, it will automatically
be applied to all of the groupings that fall within the parent.
• For example, if you set an Azure Policy on a resource group, all resources created within that resource
group will automatically receive the same policy.
33
Azure Policy
Azure Policy comes with built-in policy and initiative definitions for Storage, Networking,
Compute, Security Center, and Monitoring.
• For example, if a policy is defined that allows only a certain size for the virtual machines (VMs) to be
used in the user’s environment, that policy is invoked when a new VM is created and whenever existing
VMs are resized.
• Azure Policy also evaluates and monitors all current VMs in the environment, including VMs that were
created before the policy was created.
In some cases, Azure Policy can automatically remediate noncompliant resources and
configurations to ensure the integrity of the state of the resources.
• For example, if all resources in a certain resource group should be tagged with AppName tag and a
value of "SpecialOrders," Azure Policy will automatically apply that tag if it is missing.
• However, users still retain full control of their environment.
• If users have a specific resource that they don’t want Azure Policy to automatically fix, they can flag that
resource as an exception – and the policy won’t automatically fix that resource.
Azure Policy also integrates with Azure DevOps by applying any continuous integration and
delivery pipeline policies that pertain to the pre-deployment and post-deployment phases of
users’ applications.
34
Resource Locks
• A resource lock prevents resources from being accidentally deleted or changed.
• Even with Azure role-based access control (Azure RBAC) policies in place, there's
still a risk that people with the right level of access could delete critical cloud
resources.
• Resource locks prevent resources from being deleted or updated, depending on
the type of lock.
• Resource locks can be applied to individual resources, resource groups, or even
an entire subscription.
• Resource locks are inherited, meaning that if a resource lock is placed on a
resource group, all of the resources within the resource group will also have the
resource lock applied.
36
The Service Trust Portal features and content are accessible from the main menu.
The categories on the main menu are:
•Service Trust Portal provides a quick access hyperlink to return to the Service Trust Portal home
page.
•My Library lets users save (or pin) documents to quickly access them on their My Library page.
Users can also set up to receive notifications when documents in your My Library are updated.
•All Documents is a single landing place for documents on the service trust portal. From All
Documents, users can pin documents to have them show up in My Library.
40
Outline
• Azure Cost Management
• Azure Governance and Compliance
• Managing and Deploying Azure Resources
• Azure Monitoring Tools
41
Azure Portal
The Azure portal is a web-based, unified console that provides an
alternative to command-line tools.
With the Azure portal, users can manage their Azure subscription by
using a graphical user interface.
Users can:
• Build, manage, and monitor everything from simple web apps to complex
cloud deployments
• Create custom dashboards for an organized view of resources
• Configure accessibility options for an optimal experience
The Azure portal is designed for resiliency and continuous availability.
• It maintains a presence in every Azure datacenter.
• This configuration makes the Azure portal resilient to individual datacenter
failures and avoids network slowdowns by being close to users.
• The Azure portal updates continuously and requires no downtime for
maintenance activities.
43
Azure PowerShell
Azure PowerShell is a shell with which developers, DevOps, and IT
professionals can run commands called command-lets (cmdlets).
These commands call the Azure REST API to perform management
tasks in Azure.
Cmdlets can be run independently to handle one-off changes, or they
may be combined to help orchestrate complex actions such as:
• The routine setup, teardown, and maintenance of a single resource or
multiple connected resources.
• The deployment of an entire infrastructure, which might contain dozens or
hundreds of resources, from imperative code.
Capturing the commands in a script makes the process repeatable
and automatable.
In addition to be available via Azure Cloud Shell, users can install and
configure Azure PowerShell on Windows, Linux, and Mac platforms.
44
Azure CLI
• The Azure CLI is functionally equivalent to Azure PowerShell, with the
primary difference being the syntax of commands.
• While Azure PowerShell uses PowerShell commands, the Azure CLI
uses Bash commands.
• The Azure CLI provides the same benefits of handling discrete tasks or
orchestrating complex operations through code.
• It’s also installable on Windows, Linux, and Mac platforms, as well as
through Azure Cloud Shell.
• Due to the similarities in capabilities and access between Azure
PowerShell and the Bash based Azure CLI, it mainly comes down to
which language an user is most familiar with.
•
45
Azure Arc
Managing hybrid and multi-cloud environments can rapidly get complicated.
Azure provides a host of tools to provision, configure, and monitor Azure resources.
In utilizing Azure Resource Manager (ARM), Arc lets users extend their Azure compliance and
monitoring to their hybrid and multi-cloud configurations.
Azure Arc simplifies governance and management by delivering a consistent multi-cloud and
on-premises management platform.
Azure Arc provides a centralized, unified way to:
• Manage users’ entire environment together by projecting their existing non-Azure resources into ARM.
• Manage multi-cloud and hybrid virtual machines, Kubernetes clusters, and databases as if they are
running in Azure.
• Use familiar Azure services and management capabilities, regardless of where they live.
• Continue using traditional ITOps while introducing DevOps practices to support new cloud and native
patterns in your environment.
• Configure custom locations as an abstraction layer on top of Azure Arc-enabled Kubernetes clusters
and cluster extensions.
Currently, Azure Arc allows the management of the following resource types hosted outside
of Azure:
• Servers
• Kubernetes clusters
• Azure data services
• SQL Server
• Virtual machines
47
Infrastructure as Code
• Infrastructure as code is a concept where users manage their infrastructure as
lines of code.
• At an introductory level, it's things like using Azure Cloud Shell, Azure
PowerShell, or the Azure CLI to manage and configure their resources.
• Advanced users can use the infrastructure as code concept to manage entire
deployments using repeatable templates and configurations.
• ARM templates and Bicep are two examples of using infrastructure as code
with the Azure Resource Manager to maintain an environment.
48
ARM Templates
• By using ARM templates, users can describe the resources they want to use in
a declarative JSON format.
• With an ARM template, the deployment code is verified before any code is
run.
• This ensures that the resources will be created and connected correctly.
• The template then orchestrates the creation of those resources in parallel.
• That is, if 50 instances of the same resource are needed, all 50 instances are
created at the same time.
• Ultimately, the developer, DevOps professional, or IT professional needs only
to define the desired state and configuration of each resource in the ARM
template, and the template does the rest.
• Templates can even execute PowerShell and Bash scripts before or after the
resource has been set up.
49
Bicep
• Bicep is a language that uses declarative syntax to deploy Azure resources.
• A Bicep file defines the infrastructure and configuration.
• Then, ARM deploys that environment based on the Bicep file.
• While similar to an ARM template, which is written in JSON, Bicep files tend to
use a simpler, more concise style.
52
Bicep - Benefits
Support for all resource types and API versions:
• Bicep immediately supports all preview and GA versions for Azure services.
• As soon as a resource provider introduces new resource types and API versions, users can use
them in their Bicep file.
• They don't have to wait for tools to be updated before using the new services.
Simple syntax:
• When compared to the equivalent JSON template, Bicep files are more concise and easier to
read. Bicep requires no previous knowledge of programming languages.
• Bicep syntax is declarative and specifies which resources and resource properties you want to
deploy.
Repeatable results:
• Repeatedly deploy your infrastructure throughout the development lifecycle and have
confidence your resources are deployed in a consistent manner.
• Bicep files are idempotent, which means you can deploy the same file many times and get the
same resource types in the same state.
• You can develop one file that represents the desired state, rather than developing lots of
separate files to represent updates.
53
Bicep - Benefits
Orchestration:
• Users don't have to worry about the complexities of ordering operations.
• Resource Manager orchestrates the deployment of interdependent resources so they're created
in the correct order.
• When possible, Resource Manager deploys resources in parallel so deployments finish faster
than serial deployments.
• The file can be deployed through one command, rather than through multiple imperative
commands.
Modularity:
• Bicep code can be broken into manageable parts by using modules.
• The module deploys a set of related resources.
• Modules enable users to reuse code and simplify development.
• The module can be added to a Bicep file anytime those resources are to be deployed
54
Outline
• Azure Cost Management
• Azure Governance and Compliance
• Managing and Deploying Azure Resources
• Azure Monitoring Tools
55
Azure Advisor
Azure Advisor evaluates user’s Azure resources and makes recommendations to help
improve reliability, security, and performance, achieve operational excellence, and reduce
costs.
Azure Advisor is designed to help users save time on cloud optimization.
The recommendation service includes suggested actions users can take right away,
postpone, or dismiss.
The recommendations are available via the Azure portal and the API, and users can set up
notifications to alert them to new recommendations.
When users are in the Azure portal, the Advisor dashboard displays personalized
recommendations for all their subscriptions.
Users can use filters to select recommendations for specific subscriptions, resource groups,
or services.
The recommendations are divided into five categories:
• Reliability is used to ensure and improve the continuity of user’s business-critical applications.
• Security is used to detect threats and vulnerabilities that might lead to security breaches.
• Performance is used to improve the speed of user’s applications.
• Operational Excellence is used to help users achieve process and workflow efficiency, resource
manageability, and deployment best practices.
• Cost is used to optimize and reduce user’s overall Azure spending.
56
Azure Monitor
• Azure Monitor is a platform for collecting data on your resources,
analyzing that data, visualizing the information, and even acting on
the results.
• Azure Monitor can monitor Azure resources, an user’s on-premises
resources, and even multi-cloud resources like virtual machines
hosted with a different cloud provider.
61
•
64
Application Insights
Application Insights, an Azure Monitor feature, monitors web applications.
Application Insights is capable of monitoring applications that are running in Azure, on-
premises, or in a different cloud environment.
There are two ways to configure Application Insights to help monitor application.
• Users can either install an SDK in their application
• Users can use the Application Insights agent which is supported in C#.NET, VB.NET, Java, JavaScript,
Node.js, and Python.
Once Application Insights is up and running, users can use it to monitor a broad array of
information, such as:
• Request rates, response times, and failure rates
• Dependency rates, response times, and failure rates, to show whether external services are slowing
down performance
• Page views and load performance reported by users' browsers
• AJAX calls from web pages, including rates, response times, and failure rates
• User and session counts
• Performance counters from Windows or Linux server machines, such as CPU, memory, and network
usage
• Not only does Application Insights help users monitor the performance of their application,
but users can also configure it to periodically send synthetic requests to their application,
allowing them to check the status and monitor the application even during periods of low
activity.