straight-whale-42634
01/02/2025, 10:33 AMpulumi refresh
it presents me with:
error: Preview failed: OIDC authentication was requested via useOidc/ARM_USE_OIDC but no token or request URL were
configured. See https://www.pulumi.com/registry/packages/azure-native/installation-configuration/#credentials for more information.
Now, I am logged in locally with the az cli
and set the right account. I also have owner permissions on these Subscriptions in Azure.
My program is provisioning across one other subscription then the one i am logged in with, because we are trying to make a backup into another subscription. This code hasntt changed in half a year, but recently it stopped working locally. On CI/CD with Managed Identities, it still works.
pulumi about:
CLI
Version 3.144.1
Go Version go1.23.4
Go Compiler gc
Plugins
KIND NAME VERSION
resource azure 6.14.0
resource azure-native 2.79.0
resource command 1.0.1
resource docker 4.5.5
language dotnet 3.71.1
Host
OS darwin
Version 15.2
Arch arm64
melodic-tomato-39005
01/02/2025, 7:05 PMARM_OIDC_TOKEN
nor ARM_OIDC_TOKEN_FILE_PATH
are set, or their pulumi config equivalents.
Are you using Pulumi ESC?
Could you
1. show us your auth-related configuration, whether itβs in pulumi config (azure-native:β¦
) or env variable (ARM_...
)?
2. See if setting the environment variable PULUMI_ENABLE_AZCORE_BACKEND=false
makes a difference?straight-whale-42634
01/13/2025, 10:33 AMname: backend-infrastructure
runtime: dotnet
description: This project contains infrastructure for the Backend
pulumi.local.yaml
encryptionsalt: v1...
config:
azure-native:location: westeurope
backend-infrastructure:AspDotnetEnv: Development
azure-native:clientId: ....
As previously said, we never had to set anything here. it was working, as soon as we used az cli to login π we have not tried PULUMI_ENABLE_AZCORE_BACKEND yetmelodic-tomato-39005
01/13/2025, 12:09 PMuseOidc
or the env variable ARM_USE_OIDC
must be set to true for you to get this error. I cannot imagine how a bug would cause this, but I could be wrong. The code is pretty simple and used by many users. Could you double-check your environment?straight-whale-42634
01/13/2025, 12:35 PM- name: Running Pulumi ${{ inputs.action }} β¨ ${{ inputs.environment }}
uses: pulumi/actions@v6
env:
PULUMI_CONFIG_PASSPHRASE: ${{ secrets.passphrase }}
AZURE_STORAGE_ACCOUNT: ${{ secrets.storageAccount }}
AZURE_STORAGE_KEY: ${{ secrets.storageKey }}
ARM_USE_OIDC: "true"
ARM_TENANT_ID: ${{ secrets.tenantId }}
ARM_CLIENT_ID: ${{ secrets.orchestratorClientId }}
ARM_SUBSCRIPTION_ID: ${{ secrets.subscriptionId }}
ARM_SKIP_PROVIDER_REGISTRATION: "true"
USE_MSI: "true"
USE_OIDC: "true"
with:
command: ${{ inputs.action }}
stack-name: ${{ inputs.stack }}
work-dir: ${{ inputs.workDir }}
diff: true
refresh: true
upsert: true
color: always
pulumi-version: latest
suppress-progress: true
cloud-url: <azblob://qmpulumi-container>
Locally, we used to be able to do the following (sorry if too granular)
β― export PULUMI_CONFIG_PASSPHRASE=redacted
β― export AZURE_STORAGE_ACCOUNT=qmpulumi
β― export AZURE_STORAGE_KEY=redacted
β― az login
A web browser has been opened at ....
Retrieving tenants and subscriptions for the selection...
[Tenant and subscription selection]
No Subscription name Subscription ID Tenant
----- ------------------------------------ ------------------------------------ --------
[7] * Dev MAIN
The default is marked with an *; the default tenant is 'MAIN' and subscription is 'Dev' (Redacted).
Select a subscription and tenant (Type a number or Enter for no changes): 7
Tenant: MAIN
Subscription: Dev (Redacted)
ο
Ή οΌ ~/w/repo/sa/b/s/Api on ο ο¦ main *55 β― pulumi login <azblob://qmpulumi-container>
Logged in to ... as ... (<azblob://qmpulumi-container>
β― pulumi stack ls
NAME LAST UPDATE RESOURCE COUNT
631 7 months ago 29
774 6 months ago 20
779 6 months ago 0
837 5 months ago 0
dev* 25 minutes ago 33
β― pulumi refresh
Previewing refresh (dev):
Type Name Plan Info
pulumi:pulumi:Stack infrastructure-dev running.. 'dotnet build -nologo' completed successfully
ββ custom:resource DockerImage::dev
ββ azure-native:dbforpostgresql:Database dev-db
~ ββ azure-native:authorization:RoleAssignment dev-dev-bkp-reader-roleassignment refreshing. error: Preview failed: OIDC authentication was requested v
ββ azure-native:authorization:RoleAssignment container-keyvault-admin
~ ββ azure:appservice:CustomHostnameBinding dev refreshing. error: Preview failed: 1 error occurred:
~ ββ azure:appservice:CertificateBinding dev refreshing. error: Preview failed: 1 error occurred:
~ ββ azure-native:authorization:RoleAssignment dev-dev-bkp-msi-roleassignment refreshing. error: Preview failed: OIDC authentication was requested v
ββ azure-native:dbforpostgresql:FirewallRule sqlFwRuleAllowAll
ββ azure-native:authorization:RoleAssignment keyvault-administrator
ββ azure-native:dbforpostgresql:Administrator administrator
~ ββ azure-native:dataprotection:BackupVault dev-dev-bkp-vault refreshing. error: Preview failed: OIDC authentication was requested v
ββ azure-native:web:AppServicePlan dev
ββ azure-native:dbforpostgresql:Server dev-dev-server
~ ββ azure-native:network:RecordSet dev-txt refreshing. error: Preview failed: OIDC authentication was requested v
ββ azure-native:resources:ResourceGroup dev-dev
ββ azure-native:keyvault:Vault keyvault
ββ pulumi:providers:azure-native dev-dev-bkp-subscription
ββ pulumi:pulumi:StackReference organization/core-infrastructure/dev
~ ββ docker-build:index:Image dev-image refreshing.
~ ββ azure-native:dataprotection:BackupPolicy dev-dev-bkp-policy refreshing. error: Preview failed: OIDC authentication was requested v
ββ pulumi:providers:azure-native dev
~ ββ azure-native:resources:ResourceGroup dev-dev-bkp-rg refreshing. error: Preview failed: OIDC authentication was requested v
~ ββ azure-native:authorization:RoleAssignment dev-dev-bkp-ltr-backup-role refreshing. error: Preview failed: OIDC authentication was requested v
ββ azure-native:web:WebApp dev
ββ azure-native:authorization:RoleAssignment keyvault-secrets-officer-group
~ ββ azure-native:dataprotection:BackupInstance dev-dev-bkp-instance refreshing. error: Preview failed: OIDC authentication was requested v
~ ββ azure:appservice:ManagedCertificate dev-managed-cert refreshing. error: Preview failed: 1 error occurred:
~ ββ azure-native:network:RecordSet dev-cname refreshing. error: Preview failed: OIDC authentication was requested v
Resources:
16 unchanged
Meaning, that this usually worked out of the box. However, the only "downside" is that we are doing the DNS in another subscription. But I am owner of both - so should not be an issue..straight-whale-42634
01/13/2025, 12:45 PMmelodic-tomato-39005
01/13/2025, 12:49 PMUSE_MSI
and USE_OIDC
donβt do anything, to my knowledge, the correct ones are ARM_USE_MSI
and ARM_USE_OIDC
.
β’ That means that in your CI setup, only ARM_USE_OIDC
is set. That would explain why you get βOIDC authentication was requested via useOidc/ARM_USE_OIDC but no token or request URL were configuredβ, but thatβs locally?
β’ In your refresh output, I see two instances of pulumi:providers:azure-native
. If you configure those in the code, the environment variables are disregarded.straight-whale-42634
01/13/2025, 12:50 PMstraight-whale-42634
01/13/2025, 12:52 PMpublic CustomDomainWebApp(Options options)
{
new DNS(new DNS.Options(options.StackName, options.AppName, options.AppUrl, options.VerificationId));
....
and that DNS class:
public DNS(Options options)
{
string parentResourceGroupName = "dns-rg";
string parentDnsZoneName = "mydomain.com";
bool useOidc = Environment.GetEnvironmentVariable("USE_OIDC") == "true";
Provider otherSubscriptionProvider = new(options.AppName, new ProviderArgs
{
UseOidc = useOidc,
SubscriptionId = "dns-subscription-id",
Location = "West Europe"
});
However, again, this worked before - but maybe i have stopped using some env vars locally, which made this work. I recently got a new machine - but cant tie it directly to this not being used. Locally, I have tried setting export ARM_USE_OIDC=true to no avialstraight-whale-42634
01/13/2025, 3:18 PM