# Set up a Webhook for the Microsoft Graph API This guide shows step-by-step how to configure a webhook for the Microsoft Graph API to access Microsoft Cloud service resources from Foundry. [Learn more about the Microsoft Graph API ↗](https://learn.microsoft.com/en-us/graph/use-the-api). ## Prerequisites Prior to configuration, you must: * Sign in to your Microsoft account by typing `login.microsoftonline.com` into your browser to authenticate and generate an access token you can use to create the webhook. * Configure [network egress policies](../../administration/configure-egress/index.md) for both `login.microsoftonline.com` and `graph.microsoft.com` to allow outbound connections from Foundry. ## Instructions 1. [Create a REST API source](../webhooks-setup/index.md#create-a-source) for your webhook. 2. Include `login.microsoftonline.com` and `graph.microsoft.com` as the source's **Domains** without any **Authentication** restraints. 3. Set any necessary **Additional secrets**, such as the `TenantId`, `ClientId` and `ClientSecret` that you will use to authenticate against `login.microsoftonline.com`. You will find these after you [register an application in Microsoft Entra ↗](https://learn.microsoft.com/en-us/graph/auth-register-app-v2). 4. Add the network egress policies you [created above](#prerequisites) in the **Network connectivity** section before choosing **Save and continue**. ![The Source Setup window is displayed.](../../../assets/6e2bcefaf892180341292a9ca84fd71d2aef016f23d67095f5ac60a17e353990.webp) After you configure your REST API source, you will next configure your webhook to make two `POST` requests that: 1. Log in using the `login.microsoftonline.com` credentials created on the source to get a short-lived access token. 2. Make an API call to `graph.microsoft.com` using the access token in the response from the first call as the bearer token in the call's authentication header. ![The Calls configuration window is displayed.](../../../assets/492f27af6149352095afade17d61c6f9444dc95397e6b1d3a8f76d8cbf49307e.webp) [Learn more about configuring Webhooks in Data Connection](../webhooks-reference/index.md).