Skip to content

How do we get a connection string for a cosmos database in in a module. #8951

Answered by AdamRiddick
JohnLudlow asked this question in Q&A
Discussion options

You must be logged in to vote

You can call list connection strings against your existing cosmos DB reference;

cosmacc_existing.listConnectionStrings().connectionStrings[0].connectionString

I wouldn't recommend putting that directly in the function app setting though, and I imagine you'll get warnings about it (I hope). It would be better to put this value in a key vault secret and use a key vault secret reference (https://learn.microsoft.com/en-us/azure/app-service/app-service-key-vault-references?tabs=azure-cli) from your function app settings.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@JohnLudlow
Comment options

@ishan1608
Comment options

Answer selected by JohnLudlow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants