DEV Community

Cover image for Microsoft Certified Azure Administrator Associate Exam (AZ-104) Lab Preparation #2: Azure Policy
David Au Yeung
David Au Yeung

Posted on

Microsoft Certified Azure Administrator Associate Exam (AZ-104) Lab Preparation #2: Azure Policy

Introduction

To pass the AZ-104 exam, you have to finish several live online lab tests. This article focuses on an exercise about password governance using Azure Policy. We will create and assign a custom initiative to ensure compliance with your organization's password policies.

Azure Policy Overview

Common use cases for Azure Policy include implementing governance for resource consistency, regulatory compliance, security, cost management, and overall resource management. For more information, refer to the Azure Policy Overview.

Prerequisite

The Windows Guest Configuration extension is a prerequisite for all Windows Guest Configuration assignments and must be deployed to machines before using any Windows Guest Configuration policy definition.

Image description

Steps

Step 1: Search for Policy
Use the search bar at the top of the Azure portal to search for "Policy".

Image description

Step 2: Click on Definitions
Select "Definitions" from the Policy section.

Image description

Step 3: Click on Initiative Definition
Navigate to "Initiative definition."

Image description

Step 4: Create Initiative Definition
In the Basics tab:

Name Policy: PasswordGoverning
Select: Use existing -> Guest Configuration

Image description

In the Policies tab:

Click "Add policy definition(s)"

Image description
Select the policies relevant to password governance

Image description

Click "Add"

Image description

Click "Review + create"
Click "Create"

Image description

Image description

Note: The difference between AuditIfNotExists and DeployIfNotExists is significant. The former serves as a warning, while the latter actively triggers remediation tasks.

Step 5: Go to Assignments
Navigate to the "Assignments" section.

Image description

Step 6: Assign Initiative
Click "Assign initiative."

Image description

In the Basics tab:

Assign the custom policy "PasswordGoverning" to resource group "RGroup1".

For the scope, you can include:

  1. Management groups
  2. Subscriptions
  3. Resource groups
  4. Individual resources (using Exclusions)

Image description

In the Remediation tab:

You can apply a remediation task once the assignment is complete.

Click "Create a remediation task."

Image description

Click "Review + create."

Step 7: Assignment Completed
The assignment process is now complete.

Image description

Final Step
Check the status of your remediation task.

Navigate to the "Policy".
Click "Remediation".

Image description

Conclusion

In this exercise, we successfully created and assigned an Azure Policy initiative focused on password governance. By leveraging Azure Policy, we can ensure compliance with our organizational standards, enhance security, and maintain resource consistency across our Azure environment. Regular monitoring and remediation tasks will help keep our resources compliant and secure. Good luck with your AZ-104 exam preparation!

Top comments (1)

Collapse
 
auyeungdavid_2847435260 profile image
David Au Yeung • Edited

I am preparing for the exam, let's do the lab together :)