Integration activity not working

Hello

I have a process that uses microsoft integration activities that worked fine in test tenant
However when publishing it in a new tenant and new machine it gave me an error :

Microsoft.Graph.ServiceException: Code: generalException
Message: An error occurred sending the request.

I don’t understand as it worked fine in another machine. What can i do to correct this?

Here is the full error :

Microsoft.Graph.ServiceException: Code: generalException
Message: An error occurred sending the request.
—> UiPath.ConnectionClient.Contracts.ConnectionHttpException: Connection [4c31b024-c0e5-486d-ad80-bd4a7dd56d36] is invalid or you do not have access to it at UiPath.ConnectionClient.Helpers.HttpResponseMessageExtensions.EnsureConnectionStatusCodeAsync(HttpResponseMessage response, CancellationToken ct)
at UiPath.ConnectionClient.Helpers.HttpConnectionServiceClient.RequestAsync(Uri uri, HttpMethod method, String content, TimeSpan timeout, Dictionary2 headers, CancellationToken ct) at UiPath.ConnectionClient.Helpers.HttpConnectionServiceClient.RequestAsync[T](Uri uri, HttpMethod method, String content, TimeSpan timeout, Dictionary2 headers, CancellationToken ct)
at UiPath.ConnectionClient.Helpers.HttpConnectionServiceClient.RequestWithRetryAsync[T](Uri uri, HttpMethod method, String content, TimeSpan timeout, Dictionary2 headers, CancellationToken ct) at UiPath.ConnectionClient.ConnectionClient.<>c__DisplayClass7_0.<b__0>d.MoveNext() --- End of stack trace from previous location --- at UiPath.ConnectionClient.Helpers.CacheHelpers1.GetValueFromCache(MemoryCache cache, String key, Func1 refreshValueFunc, DateTimeOffset expiry, Boolean forceRefresh) at UiPath.ConnectionClient.Helpers.CacheHelpers1.GetValueFromCache(MemoryCache cache, String key, Func1 refreshValueFunc, Boolean forceRefresh) at UiPath.ConnectionClient.ConnectionClient.GetAccessToken(String connectionId, Boolean forceRefresh, CancellationToken ct) at UiPath.MicrosoftOffice365.Services.MicrosoftConnectionClient.GetTokenInternalAsync(String connectionId, CancellationToken ct) at UiPath.Shared.Authentication.Microsoft.Services.ConnectionCredentialService.GetTokenAsync(CancellationToken cancellationToken) at UiPath.MicrosoftOffice365.Services.MicrosoftConnectionClient.GetTokenAsync(String connectionId, CancellationToken cancellationToken) at UiPath.Shared.Services.Graph.GraphClientServiceFactory.AuthenticateUsingConnectionServiceAsync(OAuthDataOptions model, CancellationToken cancellationToken) at UiPath.Shared.Services.Graph.GraphClientServiceFactory.AuthenticateAsync(OAuthDataOptions model, CancellationToken cancellationToken) at UiPath.Shared.Authentication.Microsoft.Extensions.HttpRequestMessageExtensions.AuthorizeAsync(HttpRequestMessage request, Func2 getToken, CancellationToken ct)
at Microsoft.Graph.AuthenticationHandler.SendAsync(HttpRequestMessage httpRequestMessage, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
at Microsoft.Graph.SimpleHttpProvider.SendRequestAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)

you might try:

  1. Check Connection Settings: Make sure your connection information (like the tenant ID and secret key) is correct for the new tenant. Also, the user account you’re using needs to have the right permissions.
  2. Look at Network Settings: Sometimes, the network or internet settings on the new machine can block the connection. Check if there are any firewall or internet restrictions.
  3. Update UiPath and Activities: Ensure your UiPath software and the Microsoft activities are up to date. Sometimes, older versions can cause problems.
  4. Authentication Issues: The error is related to getting access tokens. Make sure the way you are logging in and getting access is set up right.
  5. Simple Testing: Try making a very basic process that just does the part that’s causing the error. This can help you figure out what’s going wrong more easily.
    6 Microsoft Graph API Permissions: Check if you have the right permissions set in the Microsoft Graph API. This is something you do in the Azure portal.