- Microsoft Azure Administrator:Exam Guide AZ-103
- Sjoukje Zaal
- 322字
- 2021-06-24 14:02:01
Implementing and assigning Azure policies
To implement Azure policies, you have to assign them. In this demonstration, we are going to assign an Allowed location policy to an Azure resource group. Therefore, you have to perform the following steps:
- Navigate to the Azure portal by opening https://portal.azure.com.
- Open the PacktNetworkWatcher resource group.
- Then, under Settings, select Policies:

Policies
- Click on the Getting started menu item. You will see a page that is similar to the following:

Getting started with Azure policies
- The first step is to view and select the policy definition. Select the View Definitions link on the page.
- You will go to the available built-in and custom policies inside your subscription. On the right-hand side, type Locations in the search bar:

Searching for a locations policy
- Then, select the Allowed locations policy; you will be redirected to the blade where you can see the policy definition in JSON and assign the policy:

Policy definition
- Click on Assign in the top menu.
- To assign the policy, you have to fill in the following values:
- Scope: Select a subscription, and, optionally, a resource group. I've selected the PacktNetworkWatcher resource group for this demonstration.
- Allowed locations: Only select West Europe, as demonstrated in the following screenshot:

Assigning the policy definition
- Click on Assign. The policy will be assigned to the resource group.
- Now, when we add a new resource to the resource group (such as a new VM, for instance) and set the location to East US, we will notice a validation error on the top-left of the screen. When you click on it, you will see the following details on the right-hand side of the screen:

Validation error
In this section, we covered how to assign a policy in Azure.
推薦閱讀
- 操作系統實用教程(Linux版)
- 每天5分鐘玩轉Kubernetes
- Linux系統文件安全實戰全攻略
- Arch Linux Environment Setup How-to
- WindowsServer2012Hyper-V虛擬化部署與管理指南
- 深入理解eBPF與可觀測性
- Windows Server 2012網絡操作系統企業應用案例詳解
- Learning Bootstrap
- Windows 7案例教程
- 深入淺出Node.js
- Windows Server 2012網絡操作系統項目教程(第4版)
- 計算機系統的自主設計
- Linux操作系統
- μC/OS-III內核實現與應用開發實戰指南:基于STM32
- 大學計算機應用基礎實踐教程(Windows 7+MS Office 2010)