Skip to main content

Creating an Azure Service Principal for Nife-Cost Integration

To enable Nife-Cost to collect your Azure resources, you need to set up a Service Principal with the necessary permissions. Follow these steps to create the Service Principal and obtain the necessary credentials.

Prerequisites​

Before you begin, ensure you have the following:

  1. Azure Account:

    • You must have an active Azure account with administrative privileges.
  2. Azure CLI Installed:

    • Make sure you have the Azure CLI installed on your system. You can download and install it from here.
  3. Permissions to Create Service Principals:

    • Ensure that you have the required permissions to create Service Principals and manage roles within your Azure subscription.

Step 1: Create a Service Principal​

  1. Login to Azure CLI:

    az login
  2. Create a Service Principal:

    az ad sp create-for-rbac --name "Nife-CostServicePrincipal" --role "Contributor" --scopes "/subscriptions/<subscription-id>"

    Replace <subscription-id> with your Azure subscription ID.

  3. Save the Output: The output will contain the appId,displayName, password, and tenant.

The output should look something like this:

{
"appId": "clientId",
"displayName": "Nife-CostServicePrincipal",
"password": "clientSecret",
"tenant": "tenantId"
}

Store these credentials in a safe place. You will need them to configure Nife-Cost.

Step 2: Connect Azure Account in Nife Dashboard​

  1. In the Nife console, navigate to Cloud Accounts from the left navigation.
  2. Click + Add Account (indicated by the arrow below).
  3. Select Microsoft Azure, enter an account nickname, and supply your appId (Client ID), password (Client Secret), and tenant (Tenant ID).
Connect Azure Account in Nife Cloud Accounts