官术网_书友最值得收藏!

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:

  1. Navigate to the Azure portal by opening https://portal.azure.com.
  2. Open the PacktNetworkWatcher resource group.
  3. Then, under Settings, select Policies:
Policies
  1. Click on the Getting started menu item. You will see a page that is similar to the following:
Getting started with Azure policies
  1. The first step is to view and select the policy definition. Select the View Definitions link on the page.
  1. 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
  1. 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
  1. Click on Assign in the top menu.
  2. 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
  1. Click on Assign. The policy will be assigned to the resource group. 
  1. 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.

主站蜘蛛池模板: 延川县| 都江堰市| 宜春市| 呼图壁县| 牙克石市| 兴和县| 遂平县| 南平市| 杨浦区| 清河县| 秦皇岛市| 城市| 绥江县| 壶关县| 思南县| 昆山市| 家居| 九江县| 阜新| 老河口市| 宣武区| 广东省| 米泉市| 昆山市| 宁国市| 汨罗市| 灵川县| 阿拉善右旗| 崇左市| 梅州市| 信丰县| 和政县| 古田县| 嘉荫县| 台南市| 桐庐县| 亳州市| 宝山区| 澜沧| 兰溪市| 镇平县|