Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learn Azure Administration

You're reading from   Learn Azure Administration Solve your cloud administration issues relating to networking, storage, and identity management speedily and efficiently

Arrow left icon
Product type Paperback
Published in Sep 2020
Publisher Packt
ISBN-13 9781838551452
Length 452 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Kamil Mrzygłód Kamil Mrzygłód
Author Profile Icon Kamil Mrzygłód
Kamil Mrzygłód
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Preface 1. Section 1: Understanding the Basics
2. Getting Started with Azure Subscriptions FREE CHAPTER 3. Managing Azure Resources 4. Configuring and Managing Virtual Networks 5. Section 2: Identity and Access Management
6. Identity Management 7. Access Management 8. Managing Virtual Machines 9. Section 3: Advanced Topics
10. Advanced Networking 11. Implementing Storage and Backup 12. High Availability and Disaster Recovery Scenarios 13. Automating Administration in Azure 14. Other Books You May Enjoy

Getting started with Azure Policy

To get started, we will have to actually create a policy. The process of assigning a policy is quite simple and can be covered by the following steps:

  1. Search for the Subscriptions blade—the easiest way to do so is to use the search field at the top of the Azure portal, as shown in the following screenshot:
Figure 1.7 - Searching for the Subscriptions blade
  1. Select the subscription you are interested in. The last thing you need to do is to click on the Policies blade:
FIgure 1.8 - The Policies blade 
  1. Click on the Assign policy button, which will display a form where you can define how the policy should work:

Figure 1.9 - The Assign policy button
  1. Assign a policy and configure the appropriate fields as follow: set the Scope of your subscription (in my case, it is Pay-As-You-Go) and leave the exclusions empty and the policy definition as Not allowed resource types. Remember that you can select either a built-in or a custom policy (if you have one).
  2. Initially, the compliance state may be displayed as Not registered as in the following screenshot. Wait a few minutes before proceeding:

Figure 1.10 - Created policies view
  1. If this status is diplayed longer than a few minutes, make sure a proper resource provider for the policies is registered. To do so, go to the Resource providers blade and check the status of the provider:

Figure 1.11 - Subscription resource providers
  1. Once the status is displayed as Registered, you can test the results. Try to perform a forbidden action (such as creating a forbidden resource type). If you do so, you will see a result similar to the following:

Figure 1.12 - Validation error

When a policy is enabled and working, it constantly monitors your resources against configured parameters. Depending on its configuration, it may either block deploying particular services or enforce a specific naming convention. An audit policy can report on non-compliant resources and, with enforcement mode enabled, can deny the creation of resources that don't comply with the policy.

Let's now check what a policy validation result may look like.

You have been reading a chapter from
Learn Azure Administration
Published in: Sep 2020
Publisher: Packt
ISBN-13: 9781838551452
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime