Hey! Would like to know what's the best way to sha...
# azure
e
Hey! Would like to know what's the best way to share information between multiple stacks. In my
dev
stack I create a CosmosDB, get the connection string, and then create a new AppService using the connection string. Then in my
tests
stack I would like to create a new AppService (in a different resource group but same subscription) and also reference the CosmosDB connection string from
dev
. Here's a beautiful drawing showing it. :D
b
use the getX() function and give it the name and resourcegroup and it will retrieve the details
like azure.cosmos.getAccount()
then you can access the other properties it's read from azure
g
b
is it possible to use StackReference if you use pulumi with local logins instead of cloud
e
@better-rainbow-14549 To use the GetX() function, I need the resource-name and the id, right? How I could get the Id in runtime?
b
no you don't need the ID
azure.cosmosdb.getAccount({ name: "mycosmos", resourceGroup: "myresourcegroup" })
e
@gentle-diamond-70147 Was trying to avoid using it because currently triyng the C# lib and it doesn't seems to be available, but if necessary going to try other library
g
StackReference is available in C# I believe and should work with local logins.
e
@better-rainbow-14549 Can't find something like that in the C# lib tho.
@gentle-diamond-70147 Cool, going to take a look! 🙂 thanks
b
x.get() take the ID and are used internally by pulumi, but cosmos.getAccount() is separate (it exists in the nodejs package anyway)
👍 1