> ## Documentation Index
> Fetch the complete documentation index at: https://docs.incredibuild.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Obtaining Azure Login Details

To enable Incredibuild Cloud to work with Azure, you need to provide the following login details during the activation of Incredibuild Cloud:

* **Tenant ID**

* **New Azure AD Application ID**

* **Client Secret**

To generate these details, follow the procedures in this article with a user who has **Global Administrator** and **Owner** roles.

<Note>
  **Note:** These procedures were verified in 2020, but the Azure application may have changed since then.
</Note>

## Creating an Azure AD Application

To enable Incredibuild Cloud to manage for you resources on Azure platform, you need to create a new Azure AD application, which will grant Incredibuild Cloud the permission to access and modify Azure resources. For more information on creating an Azure Active Directory application, see the [Azure documentation](https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal).

1. On Azure portal, enter in the Search box: **App registrations**.

2. On the **App registrations** page, click the **+** **New registration** option:

<img src="https://mintcdn.com/incredibuild-docs-migrated/JsKy7pU-AiW7l7AP/images/images/windows/912031752/919765033.png?fit=max&auto=format&n=JsKy7pU-AiW7l7AP&q=85&s=6d90662561302d273212d64d6a103a9f" alt="" width="1030" height="528" data-path="images/images/windows/912031752/919765033.png" />

3. On the **Register an Application** page, enter a **Name** and leave the default setting for **Supported Account Types**.

<img src="https://mintcdn.com/incredibuild-docs-migrated/JsKy7pU-AiW7l7AP/images/images/windows/912031752/920125448.png?fit=max&auto=format&n=JsKy7pU-AiW7l7AP&q=85&s=f97fa3010cf9176ceaf71e3baaffddfb" alt="" width="1025" height="694" data-path="images/images/windows/912031752/920125448.png" />

4. On the new application page, copy the following data and save it on an available location:

   * **Application (client) ID** – this is the **New Azure AD Application ID**.

   * **Directory (tenant) ID** – this is the **Tenant ID**.

<img src="https://mintcdn.com/incredibuild-docs-migrated/JsKy7pU-AiW7l7AP/images/images/windows/912031752/1288568833.png?fit=max&auto=format&n=JsKy7pU-AiW7l7AP&q=85&s=d59f620fffb1c2c38ed049419ef29d19" alt="" width="1716" height="820" data-path="images/images/windows/912031752/1288568833.png" />

These details are required for the activation of Incredibuild Cloud solution. However, as long as you do not delete the new app, you can return to Azure portal at a later date and retrieve them.

5. On the same page, click the **Add an Application ID URI** option:

<img src="https://mintcdn.com/incredibuild-docs-migrated/JsKy7pU-AiW7l7AP/images/images/windows/912031752/1288273925.png?fit=max&auto=format&n=JsKy7pU-AiW7l7AP&q=85&s=a75603f6cd9f36f3fbafbda782b2cb0f" alt="" width="1716" height="820" data-path="images/images/windows/912031752/1288273925.png" />

6. On the new application – **Expose an API** page, click the **Add a scope** option:

<img src="https://mintcdn.com/incredibuild-docs-migrated/JsKy7pU-AiW7l7AP/images/images/windows/912031752/920125458.png?fit=max&auto=format&n=JsKy7pU-AiW7l7AP&q=85&s=361ab649774b541f5f3e137aeb9fb782" alt="" width="1143" height="631" data-path="images/images/windows/912031752/920125458.png" />

7. On the **Add a scope** dialog box, perform the following:

<img src="https://mintcdn.com/incredibuild-docs-migrated/JsKy7pU-AiW7l7AP/images/images/windows/912031752/2071298389.png?fit=max&auto=format&n=JsKy7pU-AiW7l7AP&q=85&s=6d9a3f9280e31d463cb845d911855691" alt="" width="529" height="259" data-path="images/images/windows/912031752/2071298389.png" />

1. Accept the Default and Click on **Save and Continue**

2. **Note**: The text starting with "api://...." is just a default generated GUID which can be used.you can put whatever URL format you want in there, "api://" as valid as "http\://".

3. On the second **Add a scope** dialog box, enter the following:

<img src="https://mintcdn.com/incredibuild-docs-migrated/JsKy7pU-AiW7l7AP/images/images/windows/912031752/919863315.png?fit=max&auto=format&n=JsKy7pU-AiW7l7AP&q=85&s=bcda3e46f057aaccd8b4692a7256d829" alt="" width="726" height="888" data-path="images/images/windows/912031752/919863315.png" />

* **Scope name** – enter **user\_impersonation**.

* **Who can consent?** – select **Admins and users**.

* **Admin consent display name** – enter **Access Incredibuild Cloud App**.

* **Admin consent description** – enter **Allow the application to access Incredibuild Cloud App on behalf of the signed-in user**.

* **User consent display name** – enter **Access Incredibuild Cloud App**.

* **User consent description** – enter **Allow the application to access Incredibuild Cloud App on behalf of the signed-in user**.

* **State** – select **Enabled**.

9. After you entered all required details, click the **Add scope** button. Your new app is saved.

10. Open the **Authentication** screen. Then, click the **Add a platform** button:

<img src="https://mintcdn.com/incredibuild-docs-migrated/JsKy7pU-AiW7l7AP/images/images/windows/912031752/1288536067.png?fit=max&auto=format&n=JsKy7pU-AiW7l7AP&q=85&s=22b27a6f926cce9ec8b649d32f7c7bb7" alt="" width="1434" height="809" data-path="images/images/windows/912031752/1288536067.png" />

11. On the **Configure platforms** dialog box, select the **Web** option:

<img src="https://mintcdn.com/incredibuild-docs-migrated/JsKy7pU-AiW7l7AP/images/images/windows/912031752/1288339462.png?fit=max&auto=format&n=JsKy7pU-AiW7l7AP&q=85&s=2fddda3d9f574969ec1ec5ba3a6dc0aa" alt="" width="720" height="742" data-path="images/images/windows/912031752/1288339462.png" />

12. On the **Configure Web** dialog box, perform the following:

<img src="https://mintcdn.com/incredibuild-docs-migrated/JsKy7pU-AiW7l7AP/images/images/windows/912031752/1288536075.png?fit=max&auto=format&n=JsKy7pU-AiW7l7AP&q=85&s=b315ea656d1965632c909e156944d9fc" alt="" width="725" height="891" data-path="images/images/windows/912031752/1288536075.png" />

\- **Redirect URLs** – enter a dummy URL.- **Implicit grant** – select the **ID tokens** check box. Then, click the **Configure** button.

## Creating a New Client Secret

A Client Secret, also referred to as an Application Password, is needed in order to authenticate the new Azure app with Azure AD. After you create a client secret, you should copy and save it on an available location, because you will not be able to retrieve it later. However, if you cannot locate the original client secret, you can create a new one and use it to login to Incredibuild Cloud. 

1. Open the **Certificates & secrets** page. Then, click the **+ New client secret** option:

<img src="https://mintcdn.com/incredibuild-docs-migrated/JsKy7pU-AiW7l7AP/images/images/windows/912031752/919928879.png?fit=max&auto=format&n=JsKy7pU-AiW7l7AP&q=85&s=6777334657b0be6d4beb475d1995738c" alt="" width="1113" height="690" data-path="images/images/windows/912031752/919928879.png" />

2. On the **Add a client secret** dialog box, perform the following:

<img src="https://mintcdn.com/incredibuild-docs-migrated/JsKy7pU-AiW7l7AP/images/images/windows/912031752/920125470.png?fit=max&auto=format&n=JsKy7pU-AiW7l7AP&q=85&s=9547bada958cb430c231dad94124dcf2" alt="" width="833" height="311" data-path="images/images/windows/912031752/920125470.png" />

* **Description -** enter a free description.

* **Expires -** select the **Never** radio button.

Then, click the **Add** button.

3. On the **Certificates & secrets** page – **Client secrets** section, copy the content of the **Value** column of your new app:

<img src="https://mintcdn.com/incredibuild-docs-migrated/JsKy7pU-AiW7l7AP/images/images/windows/912031752/919830579.png?fit=max&auto=format&n=JsKy7pU-AiW7l7AP&q=85&s=0ffcf3eec601ef59f3de2a271ed6efbc" alt="" width="1300" height="709" data-path="images/images/windows/912031752/919830579.png" />

**Important!** During the activation procedure, you will need to enter this **Client Secret** **Value** into **Incredibuild Cloud – Azure Login** dialog box.

## Create one or more Custom Azure Roles

The roles define the permissions Incredibuild has in your account. Different permissions are required depending on your cloud configuration.

* Decide which of the following options you want to use: 

  1. Use a single role with full permissions for the entire subscription.

     The **fullPermissions.json** file contains all required permissions for all Incredibuild use cases.

  2. Use three different sets of custom roles on different resource groups:

     1. **vnetPermissions.json**: Required on the resource group containing your virtual network

     2. **nsgPermissions.json**: Required on the resource group containing your network security group

     3. **resourceManagementPermissions.json**: Required on the resource group that will contain Incredibuild helpers
        2\.  [Download the sets of permissions](https://www.incredibuild.com/downloads/ibc-docs/azure_permissions.zip) in JSON format.

3. On Azure portal, enter **Subscriptions** in the Search box.

4. On the **Subscriptions** page, select the subscription to which you want to assign the new app:

<img src="https://mintcdn.com/incredibuild-docs-migrated/JsKy7pU-AiW7l7AP/images/images/windows/912031752/919863335.png?fit=max&auto=format&n=JsKy7pU-AiW7l7AP&q=85&s=e429a58aa5e438f06e12db3e6d4e3a0e" alt="" width="1144" height="589" data-path="images/images/windows/912031752/919863335.png" />

5. On the selected Subscription page, select **Access control (IAM)**.

6. Create a role for every set of permissions you will need: 

<img src="https://mintcdn.com/incredibuild-docs-migrated/J_iESDJtkumUEvdP/images/images/Cloud/azure_permissions1.png?fit=max&auto=format&n=J_iESDJtkumUEvdP&q=85&s=e928bbb87640a4585ba4b5257c999c12" alt="" width="1295" height="569" data-path="images/images/Cloud/azure_permissions1.png" />

1. Click **Add** > **Add Custom Role**.

2. Click **Start from JSON** and select the JSON with the permissions for this role.

<img src="https://mintcdn.com/incredibuild-docs-migrated/J_iESDJtkumUEvdP/images/images/Cloud/azure_permissions2.png?fit=max&auto=format&n=J_iESDJtkumUEvdP&q=85&s=20fe77e78420850925640cf8e9c2a417" alt="" width="1073" height="391" data-path="images/images/Cloud/azure_permissions2.png" />

3. Go to **Assignable Scopes** and select the desired Subscription.

<img src="https://mintcdn.com/incredibuild-docs-migrated/J_iESDJtkumUEvdP/images/images/Cloud/azure_permissions3.png?fit=max&auto=format&n=J_iESDJtkumUEvdP&q=85&s=d2a717ad4173bb34775340836d08ac48" alt="" width="1051" height="183" data-path="images/images/Cloud/azure_permissions3.png" />

4. Click **Review and Create**.

5. Repeat this procedure if you are creating more than one role.

## Assign the Roles to the Application

If you are using a single set of custom permissions, assign the role directly on your subscription. Otherwise, assign the individual roles as needed to relevant resource groups. The second option involves repeating the following procedure for each role.

1. Go to the relevant resource group or to the subscription.

2. Go to **Access control (IAM) > Add > Add Role Assignment**.

<img src="https://mintcdn.com/incredibuild-docs-migrated/J_iESDJtkumUEvdP/images/images/Cloud/azure_permissions4.png?fit=max&auto=format&n=J_iESDJtkumUEvdP&q=85&s=53b41ceacb418322c74334666b559d7c" alt="" width="952" height="571" data-path="images/images/Cloud/azure_permissions4.png" />

3. On the **Add role assignment** dialog box, select one of the custom roles you just created.

<img src="https://mintcdn.com/incredibuild-docs-migrated/J_iESDJtkumUEvdP/images/images/Cloud/azure_permissions5.png?fit=max&auto=format&n=J_iESDJtkumUEvdP&q=85&s=976b412294b0804bc17b3d6a5dfd455e" alt="" width="786" height="782" data-path="images/images/Cloud/azure_permissions5.png" />

4. Select the application you created earlier that will be used by Incredibuild:

<img src="https://mintcdn.com/incredibuild-docs-migrated/J_iESDJtkumUEvdP/images/images/Cloud/azure_permissions6.png?fit=max&auto=format&n=J_iESDJtkumUEvdP&q=85&s=64eceb45418aac5225a3ce11271a3964" alt="" width="1884" height="801" data-path="images/images/Cloud/azure_permissions6.png" />

5. Click **Review and Assign**.

## Updating the Azure Client Secret After Initial Setup

You can update the Azure Client Secret at any time by going to the Update Key button in the Cloud Settings:

<img src="https://mintcdn.com/incredibuild-docs-migrated/J_iESDJtkumUEvdP/images/images/Cloud/update_key.png?fit=max&auto=format&n=J_iESDJtkumUEvdP&q=85&s=dcd998636d28867fc796e21c0e16b3c2" alt="" width="2537" height="1215" data-path="images/images/Cloud/update_key.png" />

Enter a new Client Secret and click **Submit**.

<img src="https://mintcdn.com/incredibuild-docs-migrated/J_iESDJtkumUEvdP/images/images/Cloud/update_key_azure.png?fit=max&auto=format&n=J_iESDJtkumUEvdP&q=85&s=5cfe31dd0f53e42fd88c169a040c2fa5" alt="" width="626" height="451" data-path="images/images/Cloud/update_key_azure.png" />
