Interesting, I'd been passing along subscription v...
# automation-api
Interesting, I'd been passing along subscription variables for creating resources in multiple subscriptions but it appears like azure-native.resources.ResourceGroup doesn't support a subscription input so everything ended up in what I assume is set via my az cli (ARM_SUBSCRIPTION_ID). Is there a way to handle that elegantly (One API call -> One Pulumi Inline Program Run -> Resources in 2+ Subscriptions)? Can I swap the pulumi config back and forth every-time I go to create a resource?
to clarify, the purpose is we have separate subscriptions per region (NA / Europe) for regulatory compliance
What I'm trying to avoid is having two program runs be necessary (one for each subscription)
You can use an explicit provider to control which account resources get created in:
interesting so create ProviderA that's set to Sub A, B->B and pass them in the ResourceOptions
đź‘Ť 1
i'll give that a shot
@lemon-agent-27707 do I need to run it as a service principal to make the provider work like that?
I am unsure on the exact details of configuring the azure provider. @tall-librarian-49374 might know, also a good question for the #azure channel.
do I need to run it as a service principal to make the provider work like that?
No, you shouldn’t need that.
@tall-librarian-49374 any idea why after specifying (provider=MySubscriptionProvider) I'm seeing error messages indicating it's using the azure CLI?
Copy code
+  pulumi:pulumi:Stack SDP-cinsights-dual creating
+  pulumi:providers:azure-native amap_provider creating
+  pulumi:providers:azure-native amap_provider created
+  pulumi:providers:azure-native emea_provider creating
azure-native:resources:ResourceGroup cinsights-dual-amap-rg  error: building auth config: obtain subscription(...) from Azure CLI: Error parsing json result from the Azure CLI: Error waiting for the Azure CLI: exit status 1
+  pulumi:providers:azure-native emea_provider created