Start by creating a Web Activity to retrieve the token. Set it up as follows:
- URL:
https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token
- Method: POST
- Headers:
-
Content-Type: application/x-www-form-urlencoded
-
- Body:
client_id=<Your_Application_ID>&client_secret=<Your_Application_Secret>&grant_type=client_credentials&scope=https://graph.microsoft.com/.default
Then, create another Web Activity to call Microsoft Graph API. Set it up as follows:
- URL:
https://graph.microsoft.com/v1.0/users?$filter=department eq 'Your_Department'
- Method: GET
- Headers:
Authorization: Bearer @{activity('GetTokenActivity').output.access_token}
Use a Copy Activity to transform the response into a CSV file :
- Source Dataset: A dataset pointing to the output of the Web Activity (Graph API response).
- Sink Dataset: A dataset pointing to a CSV file.
Finally, use a Copy Activity to upload the CSV file to your SFTP serverStart by creating a Web Activity to retrieve the token. Set it up as follows:
- URL:
https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token
- Method: POST
- Headers:
-
Content-Type: application/x-www-form-urlencoded
-
- Body:
client_id=<Your_Application_ID>&client_secret=<Your_Application_Secret>&grant_type=client_credentials&scope=https://graph.microsoft.com/.default
Then, create another Web Activity to call Microsoft Graph API. Set it up as follows:
- URL:
https://graph.microsoft.com/v1.0/users?$filter=department eq 'Your_Department'
- Method: GET
- Headers:
Authorization: Bearer @{activity('GetTokenActivity').output.access_token}
Use a Copy Activity to transform the response into a CSV file :
- Source Dataset: A dataset pointing to the output of the Web Activity (Graph API response).
- Sink Dataset: A dataset pointing to a CSV file.
Finally, use a Copy Activity to upload the CSV file to your SFTP server