# Microsoft Azure and Entra ID Integration Setup

## Getting Started <a href="#h_01hq2w79mbvtwg0vax1wc6kk64" id="h_01hq2w79mbvtwg0vax1wc6kk64"></a>

BalkanID recommends creating a separate service account for the purposes of this integration, instead of using personal or employee named accounts.&#x20;

## Requirements: <a href="#h_01hq2w7w31src22b47qmq1sjkf" id="h_01hq2w7w31src22b47qmq1sjkf"></a>

* ***Application (client) ID***
* ***BalkanID Secret Key***
* ***Directory (tenant) ID***

*Note: The organization should possess an Entra ID Premium P1/P2 license and assign it to the user responsible for setting up the configuration. It is recommended for this user to have the Global Administrator Role.*

## Getting the configuration <a href="#h_01hph1a7504r5dj3y22k4phm3s" id="h_01hph1a7504r5dj3y22k4phm3s"></a>

### **Register the BalkanID application within Azure**

1. Within your Azure portal, from the Dashboard search and navigate to *App Registrations*.

   <figure><img src="https://2975852473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbVGYwk8aSk5yI1GDPEW9%2Fuploads%2FSVyXkBZogErnnJFkb5n8%2Fimage.png?alt=media&#x26;token=016260b0-3734-4072-bbe2-767de56e688c" alt=""><figcaption></figcaption></figure>
2. Click **New Registration**.

   <figure><img src="https://2975852473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbVGYwk8aSk5yI1GDPEW9%2Fuploads%2FvC2LtCRDp4in8dWvr5ka%2Fimage.png?alt=media&#x26;token=e9e52272-a637-470c-94c4-b1204e95835c" alt=""><figcaption></figcaption></figure>
3. Fill in the details to register the application as mentioned in the screenshot.

   <figure><img src="https://2975852473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbVGYwk8aSk5yI1GDPEW9%2Fuploads%2F99JpjzoilSkC5SyLJD9Z%2Fimage.png?alt=media&#x26;token=c9cf2582-20f6-4632-9ead-29171ec5182e" alt=""><figcaption></figcaption></figure>
4. Copy the *Application (client) ID* and *Directory (tenant) ID* after app registration. You will need these values to configure Azure within BalkanID.

   <figure><img src="https://2975852473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbVGYwk8aSk5yI1GDPEW9%2Fuploads%2FbtFdM4NVG3AMLrSZSobW%2Fimage.png?alt=media&#x26;token=f275644b-3028-4476-a7a3-a4a69611ae3b" alt=""><figcaption></figcaption></figure>

### Configure API permissions for the BalkanID application <a href="#h_01ha5cpf882fztz3tehn2wm0sv" id="h_01ha5cpf882fztz3tehn2wm0sv"></a>

1. Within your Azure portal, navigate to *API Permissions* and select **Add a permission**. Select **Microsoft Graph**.

   <figure><img src="https://2975852473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbVGYwk8aSk5yI1GDPEW9%2Fuploads%2FJlRyYnZd649C5TFG2Vj1%2Fimage.png?alt=media&#x26;token=ff172109-2da1-4318-8708-f1aacf83f014" alt=""><figcaption></figcaption></figure>
2. Within Microsoft Graph section, you will see a choice between Delegated or Application permissions. Select **Application permissions**.

   <figure><img src="https://2975852473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbVGYwk8aSk5yI1GDPEW9%2Fuploads%2Fn8j4ucqkqeVmy5F8NKPG%2Fimage.png?alt=media&#x26;token=38ba8b89-6bbf-4b4d-8d84-83c6137ba45e" alt=""><figcaption></figcaption></figure>
3. As shown in the screenshots below:
   * From the *RoleManagement* section, select *RoleManagement.Read.All*

     <figure><img src="https://2975852473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbVGYwk8aSk5yI1GDPEW9%2Fuploads%2FfuTiJl1VR5UnFyRe7ezL%2Fimage.png?alt=media&#x26;token=4bc7b62b-3e0f-4dcd-8e96-e337acd5e48e" alt=""><figcaption></figcaption></figure>
   * From the *AuditLog* section, select *AuditLog.Read.All*.

     <figure><img src="https://2975852473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbVGYwk8aSk5yI1GDPEW9%2Fuploads%2FV5fqCRaZkIs4rjCmy1Ae%2Fimage.png?alt=media&#x26;token=72dd5317-3839-4a73-8016-f7013ab7b190" alt=""><figcaption></figcaption></figure>
   * From the *AdministrativeUnit* section, select *AdministrativeUnit.Read.All*.<br>

     <figure><img src="https://2975852473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbVGYwk8aSk5yI1GDPEW9%2Fuploads%2FNfsWT2NoUtif57tz7Sdd%2Fimage.png?alt=media&#x26;token=81e37046-c96b-4602-859e-0a8a13dd706f" alt=""><figcaption></figcaption></figure>
   * From the *Application* section, select *Application.Read.All*.
   * From the *Directory* section, select *Directory.Read.All*.

     <figure><img src="https://2975852473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbVGYwk8aSk5yI1GDPEW9%2Fuploads%2FDXU8wbXgB0gD29bmGkPc%2Fimage.png?alt=media&#x26;token=151d66d2-1de2-4a86-9af7-8f47c7e2e7e7" alt=""><figcaption></figcaption></figure>
   * From the *Group* section, select *Group.Read.All*.
   * From the *User* section, select *User.Read.All*.
4. Click *Grant admin consent..* link for whatever permissions were assigned recently in the above steps (in example below, the directory is named “Default Directory”) as shown in the screenshot below.&#x20;

   <figure><img src="https://2975852473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbVGYwk8aSk5yI1GDPEW9%2Fuploads%2F1RHDwLmnPBBWzFRzguI0%2Fimage.png?alt=media&#x26;token=a8329eb2-ccfe-4f08-9124-df939f1fc91c" alt=""><figcaption></figcaption></figure>
5. Once granted, you will see status of each permission change from *Not granted* for your directory to *Granted* for your directory. The final list of permissions should match what is shown below.&#x20;

   <figure><img src="https://2975852473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbVGYwk8aSk5yI1GDPEW9%2Fuploads%2FypsaLCrQH3p80dQWIGcc%2Fimage.png?alt=media&#x26;token=e2d4c83f-f9f0-45f1-a051-4bb4cc1b4370" alt=""><figcaption></figcaption></figure>

### Generate a secret for the BalkanID application to use <a href="#h_01ha5cpf899d1089zeqagedfgq" id="h_01ha5cpf899d1089zeqagedfgq"></a>

1. Navigate to Certificates & secrets. Select New client secret. For description, use “BalkanID Secret Key”. For expiration, select your preferred expiration. Please note that you will need to reissue and update the client secret once this secret expires.

   <figure><img src="https://2975852473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbVGYwk8aSk5yI1GDPEW9%2Fuploads%2FR8CkNY2Q8dPuApdZyVWc%2Fimage.png?alt=media&#x26;token=69761fae-3cc0-4219-96a6-3cc092e89824" alt=""><figcaption></figcaption></figure>
2. Copy the Value of the newly created BalkanID Secret Key. You will need this value to configure Azure within BalkanID.\
   \
   \&#xNAN;***CAUTION:** Please note that the entire Value may not be visible. You should use the copy to clipboard action next to the Value field to copy the entire value.*

   <figure><img src="https://2975852473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbVGYwk8aSk5yI1GDPEW9%2Fuploads%2FD5dIrysG4zO9nEax4lHa%2Fimage.png?alt=media&#x26;token=bc4b0dc3-b353-4f32-86af-00789e1f0a7e" alt=""><figcaption></figcaption></figure>

## Configure Azure integration within your BalkanID tenant <a href="#h_01ha5cpf89c5qza2tmxet813kp" id="h_01ha5cpf89c5qza2tmxet813kp"></a>

1. Login to the BalkanID application and switch to the tenant you would like to add your integration to.
2. Head to *Integrations* > **Add Integration**, select **Azure.**

   <figure><img src="https://2975852473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbVGYwk8aSk5yI1GDPEW9%2Fuploads%2FK1qyyKyxxY7K23dLHBir%2Fimage.png?alt=media&#x26;token=2602e254-22f7-4a99-911a-aad18e10d275" alt=""><figcaption></figcaption></figure>

   <figure><img src="https://2975852473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbVGYwk8aSk5yI1GDPEW9%2Fuploads%2FenQITf4CjG9UZFlcke3Y%2Fimage.png?alt=media&#x26;token=05eb19b8-bb88-4a5d-aae8-966840a8ea8f" alt=""><figcaption></figcaption></figure>
3. Set up the *Primary Application owner (mandatory)* and the *Description*, if any. Set up Secondary Application Owner(s), if any. <br>

   Select the Extraction Type. From here, you can configure your application using one of the following methods:

   1. **Direct integration** - Provide your Application (Client) ID, Client Secret and Azure Directory ID obtained above to set up a direct connection with BalkanID.
   2. **SCIM integration** - Provide SCIM server credentials to set up a SCIM connection with BalkanID.&#x20;
   3. **Manual file upload** - Upload Entity and Entity Relations through a .CSV file upload. Contact the team for assistance with this. &#x20;
   4. **Automated upload using API -** You can upload data using our [Bulk APIs](https://developer.balkan.id/) with the help of an API key which will be provided to you. Please refer to the [entity](https://developer.balkan.id/bulk-entities-upload-api-early-access-12828095e0) and [entity relation](https://developer.balkan.id/bulk-entity-relations-upload-api-early-access-12828102e0) upload docs for specific instructions on uploading your data through the API.&#x20;

   <figure><img src="https://2975852473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbVGYwk8aSk5yI1GDPEW9%2Fuploads%2FzryoF30k4jMBkLPssdVj%2Fimage.png?alt=media&#x26;token=5aabf56f-cce2-4ab4-b2a6-0976d25bea39" alt="" width="563"><figcaption></figcaption></figure>
4. Click on next to move onto *Optional Configuration.*
5. Fill **Optional configuration,** if required.  <br>

   <figure><img src="https://2975852473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbVGYwk8aSk5yI1GDPEW9%2Fuploads%2FvgCgyt5C48JaG9QxevOS%2Fimage.png?alt=media&#x26;token=84c48d74-f15d-4ccf-816f-eb7e5433b467" alt="" width="563"><figcaption></figcaption></figure>
6. Once you filled in the information, click **Save**. Your integration is now configured and you will see the status of the integration displayed alongside other integrations on the *Integrations* page. When data is available, the integration Status will read **Connected** and the integration Message will read **Data available**.

## Integration Scopes <a href="#h_01j5r9r7pmaq7g0ck77yz4hxhm" id="h_01j5r9r7pmaq7g0ck77yz4hxhm"></a>

| **Read Only (Access Review) Scopes**                                                                                                                                                               | **Lifecycle Management Scopes**                                                                                                                                                                                                                                                                                                                                                                        |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| RoleManagement.Read.All                                                                                                                                                                            | RoleManagement.ReadWrite.Directory                                                                                                                                                                                                                                                                                                                                                                     |
| AuditLog.Read.All                                                                                                                                                                                  | AuditLog.Read.All                                                                                                                                                                                                                                                                                                                                                                                      |
| AdministrativeUnit.Read.All                                                                                                                                                                        | AdministrativeUnit.ReadWrite.All                                                                                                                                                                                                                                                                                                                                                                       |
| Application.Read.All                                                                                                                                                                               | Application.ReadWrite.All and AppRoleAssignment.ReadWrite.All                                                                                                                                                                                                                                                                                                                                          |
| Directory.Read.All                                                                                                                                                                                 | Directory.ReadWrite.All                                                                                                                                                                                                                                                                                                                                                                                |
| Group.Read.All                                                                                                                                                                                     | Group.ReadWrite.All                                                                                                                                                                                                                                                                                                                                                                                    |
| GroupMember.Read.All                                                                                                                                                                               | GroupMember.ReadWrite.All                                                                                                                                                                                                                                                                                                                                                                              |
| User.Read                                                                                                                                                                                          | User.ReadWrite.All                                                                                                                                                                                                                                                                                                                                                                                     |
| User.Read.All                                                                                                                                                                                      | <p>Additionally, the <strong>Privileged Authentication Administrator Role</strong> must be assigned to the BalkanID Application's Service Principal to allow the following -<br>1. Deletion of Users and Groups with Privileged Roles (like User Administrator Role).<br>2. Creation of Role assignable Groups.<br><br>This needs to be done from the "Roles and administrators" menu in Entra ID.</p> |
| IdentityRiskEvent.Read.All                                                                                                                                                                         |                                                                                                                                                                                                                                                                                                                                                                                                        |
| <p>User-LifeCycleInfo.ReadWrite.All <br><br><strong>Note:</strong> This scope is required only for pulling HRIS data from Azure, specifically to retrieve the termination date of an employee.</p> |                                                                                                                                                                                                                                                                                                                                                                                                        |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.balkan.id/getting-started/setting-up-your-tenant/application-integrations/direct-application-integration/microsoft-azure-and-entra-id-integration-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
