This message was deleted.
# azure
s
This message was deleted.
m
I haven’t seen that error before. I assume you ran
az login
before?
i
or create a provider object for the whole transaction:
Copy code
var provider = new Pulumi.AzureNative.Provider("provider", new Pulumi.AzureNative.ProviderArgs()
        {
            SubscriptionId = p.subscriptionId,
            ClientId = p.servicePrincipalId,
            ClientSecret = p.servicePrincipalSecret,
            TenantId = p.tenantId,
            PartnerId = p.partnerId
        });
and attach it to the rg managing the kv
Copy code
// Azure Resource Group
        var rg = new Pulumi.AzureNative.Resources.ResourceGroup("rg", new()
        {
            ResourceGroupName = $"rg-{p.projectName}-{p.env}",
            Location = p.location,
            Tags = { { "env", p.env } }
        }, new CustomResourceOptions() { Provider = provider });
w
Yep we are all authenticated via azure CLI using azure logim
Patrick what is p in the context of your code>
i
settings i’ve defined locally
w
so in your case p.tenantID contains the tenant ID or is becoming the tenant ID? p.tenant ID must contain your tenant ID and your setting it equal to TenantID?
i
is the tenant ID
i have set the tenant ID via stack config
w
can you show how that is done? Because thats my prob I need to get the tenant ID
i
pulumi config set tenantId VALUE
w
ok
i
then you can do like: tenantId = config.Get(“tenantId”);
w
cool ok
@icy-doctor-13719 tenantId = config.Get(“tenantId”); has this method changed because it doesnt worjk
i
are you taking what I’m saying literally?
im showing you concepts
add a config
retrieve a config
w
I got it
thanks
i
try something like this:
Copy code
var provider = new Pulumi.AzureNative.Provider("provider", new Pulumi.AzureNative.ProviderArgs()
        {
            SubscriptionId = p.subscriptionId,
            ClientId = p.servicePrincipalId,
            ClientSecret = p.servicePrincipalSecret,
            TenantId = config.Get("tenantId"),
            PartnerId = p.partnerId
        });
and same for other properties
can exclude partnerid
w
ok so if the ID is in the yaml file if you do var tenantID = new Config().Get("AUS-Instanda:tenantId") ?? 0; you can get the tenant ID
thanks you for pointing me in the right direction!
i
you bet
yes, will appear in the stack YAML file
and if you have different environments, you can create separate stacks with separate YAML files
w
yep
m
I was getting a similar error today caused by Continuous Access Evaluation having being turned on in our tenant. To fix it I had to do an az logout followed by an az login as seen at https://www.jlaundry.nz/2022/terraform_error_continuous_access_evaluation/