abundant-knife-92318
09/19/2023, 2:33 PMARM_
environment variables to configure the Azure Native provider to use a Service Principal. I'm doing a quick and dirty check before my Program runs to check that the environment variables are all set...
foreach (DictionaryEntry e in Environment.GetEnvironmentVariables())
{
if (e.Key.ToString()!.StartsWith("ARM")) Console.WriteLine(e.Key + ":" + e.Value);
}
And this returns exactly what I would expect to see...
ARM_CLIENT_ID:xxxxxxxxxxxxxxxxx
ARM_TENANT_ID:xxxxxxxxxxxxxxxxx
ARM_CLIENT_SECRET:xxxxxxxxxxxxxxxxx
ARM_SUBSCRIPTION_ID:xxxxxxxxxxxxxxxxx
Yet when the Program runs it is still trying to use the Azure CLI:
error: obtain subscription() from Azure CLI: parsing json result from the Azure CLI: waiting for the Azure CLI: exit status 1: ERROR: No subscription found. Run 'az account set' to select a subscription.
Am I missing something?billowy-army-68599
abundant-knife-92318
09/19/2023, 9:07 PMProvider = new Provider("azure-provider", new ProviderArgs()
{
Environment = "public",
ClientId = AppConfig.GetValue<string>("ARM_CLIENT_ID"),
ClientSecret = AppConfig.GetValue<string>("ARM_CLIENT_SECRET"),
TenantId = AppConfig.GetValue<string>("ARM_TENANT_ID"),
SubscriptionId = AppConfig.GetValue<string>("ARM_SUBSCRIPTION_ID")
});
...I got an error stating that location had not been set...
azure-native:resources:ResourceGroup resource 'rg-dev-sta-marketplace-eus-001' has a problem: missing required property 'location'. Either set it explicitly or configure it with 'pulumi config set azure-native:location <value>'.
but there is no Location property on the Provider, and I have already set the azure-native:location
in my stack config.