Cosmos DB trigger integration beween different subscriptions.

osharena 86 Reputation points
2023-01-02T07:05:05.703+00:00

Hi,

I'm trying to integrate Azure Cosmos DB + Azure Funtion referring following guide.
https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/serverless-computing-database

I was wondering if I can integrate those between different subscriptions. (Cosmos DB is in subscriptions "A", and Function is in subscriptions "B")
Like the attachment, when I do "Edit Trigger", I can see "Cosmos DB account connection"s only in my subscription.
I'd like to use a Cosmos DB connection which is in a different subscription not mine. And of course, manager of the different subscription is ready to provide cosmos DB secret key if it's required.

275259-azure-function.png

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,835 questions
0 comments No comments
{count} votes

Accepted answer
  1. TP 116K Reputation points
    2023-01-02T07:51:15.797+00:00

    Hi,

    In your screenshot, select Custom App Setting, then enter values similar to below:

    Key:

    subAdatabasename_COSMOSDB  
    

    Value:

    AccountEndpoint=https://subAdatabasename.documents.azure.com:443/;AccountKey=WrjnoAFNkYHambsY3lK8DzQgIAcn32RKbjH4BepDiQbexlyTu2af6UKfhqk2zW0gbDP57RH1D8ooACDbrHdamQ==;  
    

    You obtain the connection string for Value above by navigating in portal to the target Cosmos DB -- Keys -- Primary Connection String

    -TP

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.