1
votes

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

1

1 Answers

1
votes

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.