4.3. Creating an Azure AD application
Complete the following procedure to create an Azure Active Directory (AD) application. The Azure AD application authorizes and automates access for high availability (HA) operations for all nodes in the cluster.
Prerequisites
- The Azure Command Line Interface (CLI) is installed on your system.
- You are an administrator or owner for the Microsoft Azure subscription to create an Azure AD application.
Procedure
From any node in the HA cluster, log in to your Azure account:
$ az loginCreate a
jsonconfiguration file for a custom role for the Azure fence agent. Use the following configuration, but replace <subscription_id> with your subscription IDs:{ "Name": "Linux Fence Agent Role", "description": "Allows to power-off and start virtual machines", "assignableScopes": [ "/subscriptions/<subscription_id>" ], "actions": [ "Microsoft.Compute/*/read", "Microsoft.Compute/virtualMachines/powerOff/action", "Microsoft.Compute/virtualMachines/start/action" ], "notActions": [], "dataActions": [], "notDataActions": [] }Define the custom role for the Azure fence agent. Use the
jsonfile created in the earlier step:$ az role definition create --role-definition <azure_fence_role.json> { "assignableScopes": [ "/subscriptions/<my_subscription_id>" ], "description": "Allows to power-off and start virtual machines", "id": "/subscriptions/<my_subscription_id>/providers/Microsoft.Authorization/roleDefinitions/<role_id>", "name": "<role_id>", "permissions": [ { "actions": [ "Microsoft.Compute/*/read", "Microsoft.Compute/virtualMachines/powerOff/action", "Microsoft.Compute/virtualMachines/start/action" ], "dataActions": [], "notActions": [], "notDataActions": [] } ], "roleName": "Linux Fence Agent Role", "roleType": "CustomRole", "type": "Microsoft.Authorization/roleDefinitions" }-
In the Azure web console interface, select Virtual Machine
click Identity in the left-side menu. -
Select On
click Save click Yes to confirm. -
Click Azure role assignments
Add role assignment. -
Select the Scope required for the role, for example
Resource Group. - Select the required Resource Group.
- Optional: Change the Subscription if necessary.
- Select the Linux Fence Agent Role role.
- Click Save.
Verification
Display nodes visible in Azure AD:
# fence_azure_arm --msi -o list node1, node2, [...]If this command outputs all nodes on your cluster, you have successfully configured the AD application.