pulumi / pulumi-azure

A Microsoft Azure Pulumi resource package, providing multi-language access to Azure
Apache License 2.0
134 stars 51 forks source link

Confusing error message about subscription_id #2497

Open mikhailshilkov opened 1 month ago

mikhailshilkov commented 1 month ago

Describe what happened

6.x versions of the provider now require setting an explicit subscriptionId configuration. However, if I don't set it, I get the following error

error: 1 error occurred:
        * `subscription_id` is a required provider property when performing a plan/apply operation

Notice that this is likely a Terraform error:

Please change the error message to be Pulumi-specific. It seems important given the potential number of users that hit this during upgrades.

Sample program

Any Azure Classic program with 6.0 or later

Log output

No response

Affected Resource(s)

No response

Output of pulumi about

pulumi-azure 6.2.0

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

danielrbradley commented 1 month ago

Yup, makes sense 👍

kraakevik commented 1 month ago

Is this a bug in terms of what the default provider is passing down to TF, or am I now required to either create a custom provider or set the config option azure:subscriptionId?

Method 1:

const subscriptionId = azure.authorization.getClientConfigOutput().subscriptionId
let azureClassicProvider = new azure_classic.Provider("Azure classic provider", {subscriptionId: subscriptionId})

Method 2:

config:
  azure:subscriptionId: 00000000-0000-0000-0000-0000000000

Since everything else is inferred from the current context, I feel like the subscriptionId should also be passed down by default? Am I missing something?

mikhailshilkov commented 1 month ago

@kraakevik I believe this is by design: https://www.pulumi.com/registry/packages/azure/v6-migration/#subscription-id-is-now-mandatory