sonic-cloud-arch
sonic-cloud-arch

Reputation: 11

HTTP Rest API from Azure Cosmos DB User Defined Function (UDF)

I am working with CosmosDB and fetching data, which has a few tokenized fields due to security. The obvious way to handle this is to make a query, get the data from CosmosDB and then de-tokenize it using a REST API.

But I am trying to check if there is a way where in we can use a UDF in Azure CosmosDB and make a REST API call from the UDF Javascript, which so far I am unable to do. If this is possible, I only call the query (with the UDF) and I get de-tokenized data back.

** The de-tokenize process has to happen through a REST API call to external party.

Any help or experience will be appreciated.

Thanks

Upvotes: 1

Views: 263

Answers (1)

Mark Brown
Mark Brown

Reputation: 8783

This is not possible with a UDF or any server-side capability in Cosmos. The security implications for this is why it's not allowed/possible.

You'll need to read the data into your app, then make the REST call before passing down to the user.

Thanks.

Upvotes: 1

Related Questions