Data connection for MS Outlook using Exchange connector?

I want to connect my work Outlook email into Foundry.

I work remote with a Windows 365 Cloud PC, so I don’t manage the credentials to get the source connection set up info. So I gotta explain to our IT company how to get the missing values for me in the image below:

I searched dev forums and found this thread from July 2024: https://community.palantir.com/t/ms-exchange-online-to-foundry/386
But the thread doesn’t discuss using the current Exchange connector available on the Data Connection app, so I suspect this solution was made before the connector was available in Foundry. Developer Assist says to use the Exchange connector for Outlook, and doesn’t mention this stuff.

So how much from that forum thread is still relevant using the current Exchange connector? Then what exactly should I ask the IT company to get or do so I can connect to Outlook using the Exchange connector?

Edit: I did read the documentation https://cdn.cdata.com/help/CEJ/jdbc/pg_connectionj.htm , but the stuff in here doesn’t specifically mention Outlook.

Hello @crackyflipside,

In short: Both options work, but with a different tradeoff.

Connector

The connector can be used but you won’t be able to fetch the attachments (per current state, as of today, september 2024) via the connector.

The elements you need to connect are the same as for the External Transform: You need a client_id, client_secret, tenant_id, and the shared mailbox you want to connect to.

To what I recall, you should use the MS Graph mode in Schema field.

The setup on Exchange/Microsoft side is the same as the External Transforms post (need the Mail.Read permission, etc.)

External Transforms

The thread that you posted is still relevant. The External Transforms approach might be more flexible, as it can fetch the attachments of the emails.
See the thread for more information.

Both

You could use the connector to fetch the emails and the metadata of the attachments, and then you could use an external transforms to only fetch the attachments !

Hope that helps !

1 Like

Hey @VincentF I finally got authorized by IT admin but am getting this error trying to preview source:

I am able to open login.microsoft.com from my browser no problem so I don’t think the firewall is an issue. let me know if there’s any other changes I need to make on my router.

The IT admin sent me two values for the secret key, but both returned the same error (also the values have hyphens, do I keep the hyphens?):

These are the connection settings. I changed Schema to MSGraph, but kept the rest as default values.:

Where am I screwing this up?

Thanks,

Still trying to figure this one out.

Added egress policies and changed some settings in the connections:

Now getting a different error code (this feels like progress):

Going to send a message to Palantir support on Foundry, to give them the login credentials directly and hopefully they’ll point out where I’m being stupid.

I’ll keep this thread updated with any solutions for future visitors.

Are you sure you are picking the client_secret ?

To what I recall, there are 2 closely-named fields (secret_id and client_secret ? maybe ?) in case you mixed them up.

Also you sent the error digested by AIP, sharing the original error might be more relevant in the context of this forum.

I will check with the IT dept about the client secret, to make sure they are getting the right one. Do the other codes seem like the right labels (i.e. Application ID being Client ID, and Directory ID being Tenant ID)?

Regarding the error code, I was concerned about privacy issues since it did show the application code. I’ll edit them out on this post:

The explorer command failed to run:
java.lang.Throwable:RemoteException: INVALID_ARGUMENT (MagritteExplorer:SqlError) with instance ID ad132af6-4bcd-4d94-ac44-2b77cb845c90: {reason=Failed to retrieve OAuth token information. AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app ‘[REDACTED]’. Trace ID: a4449a84-bbde-490f-9b3f-8a6146695d00 Correlation ID: 1640c714-7fca-41e9-8cdc-f2f1b56ff052 Timestamp: 2024-11-04 14:08:07Z. , sqlState=HY000, vendorCode=0, originalErrorInstanceId=233bd50a-54e6-4115-9051-2973784a21e8, stacktrace=com.palantir.magritte.explorer.jdbc.MagritteExplorerErrors.sqlError(MagritteExplorerErrors.java:25)
shadow.com.palantir.magritte.magritte_foundry_provided_driver_cdata_jdbc_exchange_source.com.palantir.magritte.jdbc.explorer.JdbcExplorationRunner.runExplorationRequest(JdbcExplorationRunner.java:164)
shadow.com.palantir.magritte.magritte_foundry_provided_driver_cdata_jdbc_exchange_source.com.palantir.magritte.jdbc.explorer.JdbcExplorationRunner.getTables(JdbcExplorationRunner.java:65)
shadow.com.palantir.magritte.magritte_foundry_provided_driver_cdata_jdbc_exchange_source.com.palantir.magritte.foundryprovideddrivers.FoundryProvidedDriversSource.getTables(FoundryProvidedDriversSource.java:50)
com.palantir.magritte.source.explore.TableBasedExplorableSourceV2$1.visitGetTablesRequest(TableBasedExplorableSourceV2.java:30)
com.palantir.magritte.source.explore.TableBasedExplorableSourceV2$1.visitGetTablesRequest(TableBasedExplorableSourceV2.java:27)
com.palantir.magritte.explorer.api.TableBasedExplorationRequestV2$GetTablesRequestWrapper.accept(TableBasedExplorationRequestV2.java:326)
com.palantir.magritte.explorer.api.TableBasedExplorationRequestV2.accept(TableBasedExplorationRequestV2.java:90)
com.palantir.magritte.source.explore.TableBasedExplorableSourceV2.exploreTableBasedV2(TableBasedExplorableSourceV2.java:27)
com.palantir.magritte.api.Source$1.visitTableBasedV2(Source.java:50)
com.palantir.magritte.api.Source$1.visitTableBasedV2(Source.java:37)
com.palantir.magritte.explorer.api.ExplorationRequest$TableBasedV2Wrapper.accept(ExplorationRequest.java:405)
com.palantir.magritte.explorer.api.ExplorationRequest.accept(ExplorationRequest.java:86)
com.palantir.magritte.api.Source.explore(Source.java:37)
com.palantir.magritte.cloud.explorer.CloudSourceExplorationResource.lambda$getExplorationResponse$12(CloudSourceExplorationResource.java:138)
com.palantir.magritte.cloud.explorer.CloudSourceExplorationResource.rethrowRuntimeExceptionsAsExplorerCommandFailures(CloudSourceExplorationResource.java:181)
com.palantir.magritte.cloud.explorer.CloudSourceExplorationResource.getExplorationResponse(CloudSourceExplorationResource.java:128)
com.palantir.magritte.cloud.explorer.CloudSourceExplorationServiceEndpoints$GetExplorationResponseEndpoint.handleRequest(CloudSourceExplorationServiceEndpoints.java:68)
com.palantir.conjure.java.undertow.runtime.ConjureExceptionHandler.handleRequest(ConjureExceptionHandler.java:42)
com.palantir.tracing.undertow.TracedStateHandler.handleRequest(TracedStateHandler.java:44)
com.palantir.conjure.java.undertow.runtime.LoggingContextHandler.handleRequest(LoggingContextHandler.java:40)
io.undertow.server.Connectors.executeRootHandler(Connectors.java:395)
io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:861)
com.palantir.witchcraft.ActiveCountingExecutorService$TaskWrapper.run(ActiveCountingExecutorService.java:84)
com.palantir.nylon.threads.RenamingExecutorService$RenamingRunnable.run(RenamingExecutorService.java:92)
org.jboss.threads.EnhancedViewExecutor$EnhancedViewExecutorRunnable.run(EnhancedViewExecutor.java:501)
org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2675)
org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2654)
org.jboss.threads.EnhancedQueueExecutor.runThreadBody(EnhancedQueueExecutor.java:1627)
org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1594)
com.palantir.tritium.metrics.TaggedMetricsThreadFactory$InstrumentedTask.run(TaggedMetricsThreadFactory.java:94)
java.lang.Thread.run(Thread.java:840)}
com.palantir.conjure.java.dialogue.serde.DefaultClients.newRemoteException(DefaultClients.java:148)
com.palantir.conjure.java.dialogue.serde.DefaultClients.block(DefaultClients.java:123)
com.palantir.conjure.java.dialogue.serde.DefaultClients.callBlocking(DefaultClients.java:76)
com.palantir.magritte.cloud.explorer.CloudSourceExplorationServiceBlocking$1.getExplorationResponse(CloudSourceExplorationServiceBlocking.java:84)
com.palantir.magritte.coordinator.command.CloudSourceExplorationRequestMapper$1.subtype(CloudSourceExplorationRequestMapper.java:102)
com.palantir.magritte.coordinator.command.CloudSourceExplorationRequestMapper$1.subtype(CloudSourceExplorationRequestMapper.java:62)
com.palantir.magritte.bridge.command.SourceExplorationCommand.map(SourceExplorationCommand.java:50)
com.palantir.magritte.coordinator.command.CloudSourceExplorationRequestMapper.getCloudSourceExplorationResponse(CloudSourceExplorationRequestMapper.java:62)
com.palantir.magritte.coordinator.command.SourceExplorerCommandRunner.getCloudRunExplorerResponse(SourceExplorerCommandRunner.java:144)
com.palantir.magritte.coordinator.command.SourceExplorerCommandRunner.lambda$getExplorerResponseForSourceWithReadyRuntime$1(SourceExplorerCommandRunner.java:117)
com.palantir.magritte.store.source.api.RuntimePlatformResponse$VisitorBuilder$1.visitCloud(RuntimePlatformResponse.java:175)
com.palantir.magritte.store.source.api.RuntimePlatformResponse$CloudWrapper.accept(RuntimePlatformResponse.java:297)
com.palantir.magritte.store.source.api.RuntimePlatformResponse.accept(RuntimePlatformResponse.java:70)
com.palantir.magritte.coordinator.command.SourceExplorerCommandRunner.getExplorerResponseForSourceWithReadyRuntime(SourceExplorerCommandRunner.java:101)
com.palantir.magritte.coordinator.command.SourceExplorerCommandRunner.getExplorerResponseForSource(SourceExplorerCommandRunner.java:92)
com.palantir.magritte.coordinator.resources.TableBasedSourceExplorationResource.getExplorerResponse(TableBasedSourceExplorationResource.java:202)
com.palantir.magritte.coordinator.resources.TableBasedSourceExplorationResource.getTables(TableBasedSourceExplorationResource.java:78)
com.palantir.magritte.coordinator.api.TableBasedSourceExplorationServiceEndpoints$GetTablesEndpoint.handleRequest(TableBasedSourceExplorationServiceEndpoints.java:81)
com.palantir.conjure.java.undertow.runtime.ConjureExceptionHandler.handleRequest(ConjureExceptionHandler.java:42)
com.palantir.tracing.undertow.TracedStateHandler.handleRequest(TracedStateHandler.java:44)
com.palantir.conjure.java.undertow.runtime.LoggingContextHandler.handleRequest(LoggingContextHandler.java:40)
io.undertow.server.Connectors.executeRootHandler(Connectors.java:395)
io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:861)
com.palantir.witchcraft.ActiveCountingExecutorService$TaskWrapper.run(ActiveCountingExecutorService.java:84)
com.palantir.nylon.threads.RenamingExecutorService$RenamingRunnable.run(RenamingExecutorService.java:92)
org.jboss.threads.EnhancedViewExecutor$EnhancedViewExecutorRunnable.run(EnhancedViewExecutor.java:501)
org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2675)
org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2654)
org.jboss.threads.EnhancedQueueExecutor.runThreadBody(EnhancedQueueExecutor.java:1627)
org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1594)
com.palantir.tritium.metrics.TaggedMetricsThreadFactory$InstrumentedTask.run(TaggedMetricsThreadFactory.java:94)
java.lang.Thread.run(Thread.java:840)

Also, thank you for all your help so far.

The application ID shouldn’t be sensitive.
Also, note that in the error message, the same was stated related to the secret_id/value: client secret value, not the client secret ID

1 Like

Hi,
In case this helps - these are our connection settings that work. UserId being shared mailbox we are connecting to.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.