To implement Azure policies, you have to assign them. In this section, we are going to assign an Allowed location policy to an Azure resource group. To do so, follow these steps:
- Navigate to the Azure portal by opening https://portal.azure.com.
- Open the PacktVMResourceGroup resource group.
- Then, under Settings, select Policies.
- Click on the Getting started menu item. You will see a page that looks similar to the following:
Getting started with Azure policies
- The first step is to view and select the policy definition. To do so, select the View definitions button, as shown in the preceding screenshot.
- You will be taken to the available built-in and custom policies inside your subscription. On the right-hand side, type Locations into the search bar:
Searching for a locations policy
- Then, select the Allowed locations policy; you will be redirected to a blade where you can view the policy definition in JSON and assign the policy:
Policy definition...