https://pulumi.com logo
#dotnet
Title
# dotnet
a

able-rose-67471

02/11/2021, 9:17 AM
Hey guys! Just wondering if it's possible to import resources from a different subscription? We have a CI pipeline that stands up infrastructure for each development branch and then deploys to that infrastructure to our 'dev' subscription. We also have a 'global' subscription that hosts a KeyVault to store all of our applications SSL certificates. I was hoping using the
KeyVault.Get()
method would work, since it requires the full resource ID (including the subscription segment). But when I try that, it returns "does not exist". Similarly, I've also tried the
pulumi import
and that won't work either (I would have to switch subscriptions before running it, and then switch back after which results in the same "does not exist" message. I thought I'd check on here before heading back to the drawing board as I fear I may have misunderstood the import capabilities!
f

full-winter-70537

02/11/2021, 9:42 AM
I am not an expert by any means, but I've noticed that Pulumi is limited by your underlying
az login
. Perhaps try logging from CLI into both subscriptions, then running your Pulumi code
a

able-rose-67471

02/11/2021, 9:50 AM
My login has access to both subscriptions but you can only
set
one as the default. It seems like Pulumi can only use that default subscription.
a

able-rose-67471

02/11/2021, 11:21 AM
@tall-librarian-49374 - 'Explicit Provider Configuration' looks like it may be exactly what I'm after! https://www.pulumi.com/docs/reference/pkg/azure/provider/ Thanks for your help!