https://pulumi.com logo
#azure
Title
# azure
v

victorious-exabyte-70545

07/03/2023, 11:52 PM
Is it possible to run get_* and specify a subscription id instead of using what is defined for the stack?
Copy code
Exception: invoke of azure-native:network:getSubnet failed: invocation of azure-native:network:getSubnet returned an error: request failed /subscriptions
b

bored-activity-40468

07/04/2023, 2:16 AM
Get* methods can take their own provider with InvokeOptions so you should be able to call a Get* method with a specific subscription.
v

victorious-exabyte-70545

07/05/2023, 9:14 PM
When I run this
Copy code
env_provider = azure.Provider(
        "alt_subscription_provider",
        subscription_id=env_subscription_id
    )

    sql = get_server(
        resource_group_name=sql_role_config['sql_rsg'],
        server_name=sql_role_config['sql_name'],
        opts=InvokeOptions(provider=env_provider)
    )
I get this error
Copy code
Exception: invoke of azure-native:sql:getServer failed: invocation of azure-native:sql:getServer returned an error: unrecognized data function (Invoke): azure-native:sql:getServer
Ignore, I was not creating the provider with azure_native and get_server was from azure_native.