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

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.

主站蜘蛛池模板: 大安市| 儋州市| 平度市| 吴江市| 甘肃省| 门源| 咸宁市| 苏州市| 钟山县| 卓尼县| 衡山县| 威远县| 九龙县| 运城市| 茶陵县| 枝江市| 临高县| 桃园市| 安阳市| 乐清市| 五大连池市| 长沙市| 那曲县| 德江县| 大英县| 东至县| 宿松县| 康保县| 襄垣县| 元朗区| 石阡县| 舟山市| 朝阳区| 五莲县| 友谊县| 枣强县| 思南县| 武邑县| 郸城县| 伊川县| 兴安盟|