Configure an Azure Active Directory as a datasource
Purpose
Azure Active Directory (Azure AD) is a Microsoft’s enterprise cloud-based identity and access management service which is massively used in enterprise solutions but can be complicated to implement.
This documentation shows how to configure an OAuth2 connection with Elements Connect for Jira Cloud using the "Client credentials" grant type.
Connecting to an Azure Active Directory is useful to display more information about the reporter of a request to support agents for example. The office location of a reporter can be fetched and used to affect the ticket to the relevant support group or to automatically triage request to location-based queues in a Jira Service Management project.
Prerequisites
Have a Jira Cloud instance
Have Elements Connect installed on your instance
Have an Azure Active Directory up and running
Configuration steps
Azure Active Directory configuration
Elements Connect configuration
Azure Active Directory configuration
From the "Azure Active Directory configuration", as a Microsoft Azure admin:
Create a new "App registration" and give it a meaningful name (i.e.: "Elements Connect" or "Jira"):
![](../__attachments/10964828247/image-2020-12-18-11-47-24-488%20(1).png?inst-v=9fdb14ed-4bc9-4150-9682-af9fdd6c0846)
Click "Register"
A client ID was automatically generated for your App:
![](../__attachments/10964828247/image2022-9-28_14-9-52%20(1).png?inst-v=9fdb14ed-4bc9-4150-9682-af9fdd6c0846)
The next step is to generate a client secret.
To do that, go to "Certificates & secrets"
Click "New client secret"
![](../__attachments/10964828247/image2022-9-28_13-36-16%20(1).png?inst-v=9fdb14ed-4bc9-4150-9682-af9fdd6c0846)
Provide your secret with a name and select the expiry duration of your choice:
![](../__attachments/10964828247/image2022-9-28_13-37-19%20(1).png?inst-v=9fdb14ed-4bc9-4150-9682-af9fdd6c0846)
Remember to save your secret somewhere safe, as you won't be able to access it anymore after that. You may also generate new ones.
Elements Connect configuration
Go to Elements Connect administration by clicking on “Apps”, then Elements Connect
![af73a4fc-b6c0-4f2f-b563-6cee0e407d59.png](../__attachments/10964828247/af73a4fc-b6c0-4f2f-b563-6cee0e407d59.png?inst-v=9fdb14ed-4bc9-4150-9682-af9fdd6c0846)
Click on “Create datasource”
![910f9664-d145-4475-ae67-aa3613510dd4.png](../__attachments/10964828247/910f9664-d145-4475-ae67-aa3613510dd4.png?inst-v=9fdb14ed-4bc9-4150-9682-af9fdd6c0846)
Select “REST API”
![](../__attachments/10964828247/image2022-7-11_11-15-12.png?inst-v=9fdb14ed-4bc9-4150-9682-af9fdd6c0846)
Give your datasource a name, then configure it as follows:
![](../__attachments/10964828247/image-20221124-101830.png?inst-v=9fdb14ed-4bc9-4150-9682-af9fdd6c0846)
Base URL:
https://graph.microsoft.com/v1.0
API Documentation: https://learn.microsoft.com/en-us/rest/api/azure/
API Test URL:
https://graph.microsoft.com/v1.0/users
(this is a working endpoint that will work against the connection tester)
Authentication mode: OAuth 2
Token URL: go to your Azure AD app > Overview > Endpoints > URL under "OAuth 2.0 token endpoint (v2)"
![](../__attachments/10964828247/image2022-9-28_13-49-44%20(1).png?inst-v=9fdb14ed-4bc9-4150-9682-af9fdd6c0846)
Client ID: go to your Azure AD app > Overview > Client ID
![](../__attachments/10964828247/image2022-9-28_13-52-51%20(1).png?inst-v=9fdb14ed-4bc9-4150-9682-af9fdd6c0846)
Client secret: use the secret you generated when registering your app
Client authentication: choose where you want to send the client ID and client secret (header or body) - for Azure AD, we recommend sending credentials to the body
Scopes: https://graph.microsoft.com/.default (default), or any other scopes defined when registering your app
Click the “Test connection” button
![](../__attachments/10964828247/image-20220628-200242.png?inst-v=9fdb14ed-4bc9-4150-9682-af9fdd6c0846)
Save your datasource configuration. You’re all set!