# Setup in your Azure

Here is a guide on how to connect your credentials to NetBook.

We wish to simplify the process so that you would need minimal intervention from your IT teams.&#x20;

### **Create an Azure AD Application:**

1. Sign in to your Azure Account through the [Azure portal](https://portal.azure.com/).
2. Select **Azure Active Directory**.
3. Select **App registrations**.
4. Select **New registration**.
5. Name the application. Select a supported account type, which determines who can use the application. You've created your Azure AD application and service principal.

![](https://391902796-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9XrcTyYWOONNvoNk8VBs%2Fuploads%2FQAjEvruCgF7DEGS9R1Mt%2Fimage.png?alt=media\&token=1c886ad2-518d-47ca-8c52-657c01fff2c5)

You've created your Azure AD application and service principal.

### Configure the application to access web API:

1. Sign in to the [Azure portal](https://portal.azure.com/).
2. If you have access to multiple tenants, use the **Directory + subscription** filter ![](https://docs.microsoft.com/en-us/azure/active-directory/develop/media/quickstart-configure-app-access-web-apis/portal-01-directory-subscription-filter.png) in the top menu to select the tenant containing your client app's registration.
3. Select **Azure Active Directory** > **App registrations**, and then select your client application (*not* your web API).
4. Select **API permissions** > **Add a permission** > **Microsoft APIs**.
5. Select the **Azure Service Management** -> Check **user\_impersonation.**
6. Select **Add permissions** to complete the process.

After adding permissions to your API, you should see the selected permissions under **Configured permissions**.&#x20;

![](https://391902796-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9XrcTyYWOONNvoNk8VBs%2Fuploads%2Fzvf2pumMCcwSpjAilr7N%2Fimage.png?alt=media\&token=b8588cc4-053f-45f3-881e-52ecefe525e6)

You might also notice the *User.Read* permission for the Microsoft Graph API. This permission is added automatically when you register an app in the Azure portal.

For Authentication, we need to create application secret.

### Create a new application secret <a href="#option-2-create-a-new-application-secret" id="option-2-create-a-new-application-secret"></a>

1. Select **Azure Active Directory**.
2. From **App registrations** in Azure AD, select your application.
3. Select **Certificates & secrets**.
4. Select **Client secrets -> New client secret**.
5. Provide a description of the secret, and a duration. When done, select **Add**.

   After saving the client secret, the value of the client secret is displayed. Copy this value because you won't be able to retrieve the key later. You will provide the key value with the application ID to sign in as the application. Store the key value where your application can retrieve it.

![](https://docs.microsoft.com/en-us/azure/active-directory/develop/media/howto-create-service-principal-portal/copy-secret.png)

### **Create resource groups:**

1. Sign in to the [Azure portal](https://portal.azure.com/).
2. Select **Resource groups**

![](https://391902796-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9XrcTyYWOONNvoNk8VBs%2Fuploads%2F1L3AUaIRiCPeKv4VChlj%2Fmanage-resource-groups-add-group.png?alt=media\&token=4a8f1e10-8a55-4ec0-8522-4242898262f5)

3\. Select **Add**.

4\.  Enter the following values:

* **Subscription**: Select your Azure subscription.
* **Resource group**: Enter a new resource group name.
* **Region**: Select an Azure location, such as **East US**.

![](https://391902796-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9XrcTyYWOONNvoNk8VBs%2Fuploads%2FovQ5JHgag2mTK8E9NxJR%2Fimage.png?alt=media\&token=02ae9538-c4c4-471d-a784-8ae2829935db)

5\. Select **Review + Create**

6\. Select **Create**. It takes a few seconds to create a resource group.

7\. Select **Refresh** from the top menu to refresh the resource group list, and then select the newly created resource group to open it. Or select **Notification**(the bell icon) from the top, and then select **Go to resource group** to open the newly created resource group.

![](https://391902796-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9XrcTyYWOONNvoNk8VBs%2Fuploads%2FTCJwAWdYbURiPBSDOjAC%2Fmanage-resource-groups-add-group-go-to-resource-group.png?alt=media\&token=b3d3560f-1a9a-4031-9472-7ff2da9a4c35)

\
In Azure RBAC, to grant access, you assign an Azure role.

1. In the list of **Resource groups**, open the new **netbook** resource group.
2. In the navigation menu, click **Access control (IAM)**.
3. Click the **Role assignments** tab to see the current list of role assignments.

![](https://391902796-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9XrcTyYWOONNvoNk8VBs%2Fuploads%2F6zUuTXNbtkw6yULRzABh%2Fimage.png?alt=media\&token=987b53ed-e9cc-4fa9-87db-18914f514d70)

4\. Click **Add** > **Add role assignment**.

If you don't have permissions to assign roles, the Add role assignment option will be disabled.

![](https://391902796-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9XrcTyYWOONNvoNk8VBs%2Fuploads%2FRqAfVYNFCkLeBbacGDoO%2Fimage.png?alt=media\&token=bae28ddf-48d0-40b8-9ea0-ec23082367fb)

5\. On the **Role** tab, select the **Contributor** role.

![](https://docs.microsoft.com/en-us/azure/includes/role-based-access-control/media/add-role-assignment-role-generic.png)

6\. On the **Members** tab, select yourself or another user.

7\. On the **Review + assign** tab, review the role assignment settings.

8\. Click **Review + assign** to assign the role.

After a few moments, the user is assigned the Virtual Machine Contributor role at the example-group resource group scope.

<br>
