Skip to main content

Connection - Microsoft Graph API​

The Microsoft Graph API Connection uses the Microsoft Graph REST API to send, receive, and manage email in Microsoft 365 and Exchange Online mailboxes. It is the recommended replacement for the Exchange EWS connection, which Microsoft is retiring for Exchange Online on October 1, 2026.

The Microsoft Graph API Connection stores the sign-in and security settings that these Tasks and Triggers use to connect to the mailbox through Microsoft Graph:

Once the Connection is set up, no sign-in is needed for each run.

Available from VisualCron 13.3.1.

Choosing an authentication model​

The Connection supports two authentication flows and two credential types. Pick the combination that matches your app registration.

Auth flow

  • "Delegated (interactive)" (default): the Connection signs in as a user. You sign in once in the Connection editor; the sign-in is stored and refreshed for later runs. Use this when your tenant policy requires delegated access or when application permissions cannot be granted
  • "App-only (client credentials)": the Connection signs in as the application, with an application permission grant. No user sign-in is needed; the Server gets a token at run time. Use this for unattended automation

Credential type

  • "Client secret": the client secret of the application
  • "Certificate": a VisualCron Certificate with its private key

The editor shows and hides fields based on these two selections. Redirect URL and Tenant primary domain appear only for "Delegated (interactive)".

Common settings​

The Common settings and Proxy tabs are the same for every Connection type that has them; see Common settings and Proxy.

Test opens the Test Microsoft Graph Connection window. From email and To email are filled in with the mailbox of the Connection. Click Test in that window: the Server sends a test message with the subject "Test subject (from VisualCron)" from From email to To email. The test does not use the Proxy tab.

Main settings​

These fields are on Connection settings -> Main settings.

Auth flow and Credential type

See Choosing an authentication model.

Application (Client) Id

The Application (client) ID of your app registration. Required. See How to set up the app in Azure.

Tenant Id

The Directory (tenant) ID of your app registration. Required.

Mailbox / Email

The email address of the mailbox that the Connection works with, for example <user>@<tenant>.onmicrosoft.com. Required.

Client secret

The client secret value of the application. Shown and required for "Client secret". After saving, the stored secret is not displayed, and leaving the placeholder keeps the stored secret.

Certificate

Shown and required for "Certificate". Select a VisualCron Certificate that was imported as a ".pfx" file with its private key. The Windows certificate store is not used.

Redirect URL

Shown for "Delegated (interactive)". It has no default. Enter an address that matches a redirect URI of the app registration exactly, with a free port on the computer where the Client runs, for example http://localhost:<port>. The Client listens on that port during the sign-in.

Tenant primary domain

Shown for "Delegated (interactive)". The primary domain of the tenant, for example <tenant>.onmicrosoft.com. When it is empty, the Server refreshes the sign-in through the multi-tenant sign-in address, which an app registered for a single tenant does not accept. Fill it in for a single-tenant app.

Authenticate / Test Authentication

  • For "Delegated (interactive)", the button reads Authenticate. Click it to open a Microsoft sign-in on the Client computer. The Connection requests the delegated permissions Mail.ReadWrite, Mail.Send and User.Read. On success, the sign-in is stored with the Connection and refreshed for later runs
  • For "App-only (client credentials)", the button reads Test Authentication. Click it to open the same Test Microsoft Graph Connection window as Test. Click Test in that window to have the Server get a token and send a test message from From email to To email. No sign-in window opens

Proxy​

The Email Tasks that read, delete or move messages, and the Email Trigger, send their mail requests through the proxy on this tab, with the "HTTP Proxy", "SOCKS4" or "SOCKS5" type.

warning

Email - Send, the Test button, and the sign-in and token requests to Microsoft do not use the Proxy tab. Make sure that the Server can reach Microsoft Graph and the Microsoft sign-in addresses without the proxy on this tab.

How to set up the app in Azure​

Both authentication flows need an app registration in Microsoft Entra ID, a credential and Microsoft Graph permissions.

To register the app, complete the following steps:

  1. Sign in to the Microsoft Entra admin center.
  2. Open Microsoft Entra ID -> App registrations.
  3. Click New registration.
  4. Enter a name for the app.
  5. Select the supported account types for your organization.
  6. Click Register.
  7. On the Overview page, copy the Application (client) ID into Application (Client) Id in the Connection.
  8. Copy the Directory (tenant) ID into Tenant Id in the Connection.

The app is registered.

Create a client secret​

For the "Client secret" credential type, complete the following steps:

  1. In the app registration, open Certificates & secrets -> Client secrets.
  2. Click New client secret.
  3. Set an expiry.
  4. Click Add.
  5. Copy the secret value. It cannot be shown again.
  6. Enter the value in Client secret in the Connection.

The Connection can now sign in with the client secret.

Use a certificate​

For the "Certificate" credential type, complete the following steps:

  1. In the app registration, open Certificates & secrets -> Certificates.
  2. Upload the public key of the certificate.
  3. In the Client, import the certificate with its private key as a ".pfx" file. See Global - Certificates.
  4. Select the imported Certificate in Certificate in the Connection.

The Connection can now sign in with the certificate.

Add the Microsoft Graph permissions​

To add the permissions, complete the following steps:

  1. In the app registration, open API permissions -> Add a permission -> Microsoft Graph.
  2. Add the permissions for the Auth flow of the Connection:
    • For "App-only (client credentials)", the application permissions Mail.ReadWrite and Mail.Send
    • For "Delegated (interactive)", the delegated permissions Mail.ReadWrite, Mail.Send and User.Read, and Mail.ReadWrite.Shared if you work with shared mailboxes
  3. For "App-only (client credentials)", have an administrator click Grant admin consent.
  4. For "Delegated (interactive)", open Authentication.
  5. For "Delegated (interactive)", add a redirect URI that matches Redirect URL in the Connection.

The app can now be used by the Connection.

tip

Application permissions such as Mail.ReadWrite and Mail.Send give the app access to every mailbox in the tenant. Mailbox / Email does not limit that. To limit the app to the mailboxes it needs, ask your Exchange Online administrator to scope it with RBAC for Applications.

When the client secret or certificate expires, the Connection stops working.

Migrating from Exchange EWS​

Existing email Tasks and Triggers can be pointed from an Exchange EWS Connection to a Microsoft Graph API Connection without rebuilding them, with two exceptions:

  • Folder IDs are protocol-specific. Reselect the folder anywhere one is referenced, such as the Email Trigger and Email - Move messages
  • Message IDs are protocol-specific too. A message ID that an EWS-based Task wrote to a variable does not work in a Task that uses the Graph Connection, so switch every Task in the Job that passes message IDs

Troubleshooting​

Authentication succeeds but Tasks return 4xx errors​

The app registration is missing the Microsoft Graph permissions, or admin consent has not been granted. Check that Mail.ReadWrite and Mail.Send are present and consented for the flow that you use.

App-only test fails at once​

Check the application ID, Tenant Id, and that the client secret value (not the secret ID) was entered. Check that the secret has not expired.

Delegated sign-in cannot complete​

Redirect URL must match a redirect URI of the app registration exactly, including scheme and port. If the redirect port is in use or reserved on the Client computer, the Client reports that it cannot bind to the address. Change Redirect URL to a free port, and update the redirect URI of the app.

Delegated Jobs fail after a successful sign-in, with a single-tenant app​

Fill in Tenant primary domain.

Email - Send fails on a network that needs a proxy, while Get messages works​

Email - Send does not use the Proxy tab. See Proxy.

Folder not found after migrating from EWS​

Reselect the folder in the Trigger or Task. EWS and Graph folder IDs are not interchangeable.