azure-search-openai-demo icon indicating copy to clipboard operation
azure-search-openai-demo copied to clipboard

Failed to Resolve User Access to Subscription with ID ****

Open XGUERETTE opened this issue 1 year ago • 4 comments
trafficstars

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> Hi, I am trying to use GitHub CodeSpace to provision resources and deploy the application and for some reason even after I have authenticated, I received the error here below when I attempt to run the `azd up` Command . Initially, when I ran azd up, I could not see the target subscription and the tenant in which I wanted to deploy and provision the resources. For some reason, it saw other tenants where my UserId is invited, but not my main tenant. Therefore, I have added the AZURE_SUBSCRIPTION_ID and AZURE_TENANT_ID and AZURE_AUTH_TENANT_ID as environment variables with the command `azd env set`.
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

azd up

Any log messages given by the failure

ERROR: deployment failed: failing invoking action 'provision', error deploying infrastructure: resolving bicep parameters file: fetching current principal id: getting tenant id for subscription XXXXXX-XXXXX-XXXX-XXXX-XXXXXXX. Error: failed to resolve user access to subscription with ID 'XXXXXX-XXXXX-XXXX-XXXX-XXXXXXX'. If you recently gained access to this subscription, run azd auth login again to reload subscriptions. Otherwise, visit this subscription in Azure Portal using the browser, then run azd auth login

Expected/desired behavior

OS and Version?

Linux codespaces-bfda10 6.2.0-1018-azure #18~22.04.1-Ubuntu SMP Tue Nov 21 19:25:02 UTC 2023 x86_64 GNU/Linux

azd version?

azd version 1.5.1 (commit 3856d1e98281683b8d112e222c0a7c7b3e148e96)

Versions

npm -version : 8.19.4

Mention any other details that might be useful

Is it possible that my Tenant/Subscription is not visibile because the GitHub CodeSpace is not a Managed Device in my Tenant? Thank you


Thanks! We'll be in touch soon.

XGUERETTE avatar Dec 27 '23 21:12 XGUERETTE

If you are trying to login via Github Codespace, and your tenant admin requires only managed devices to log in using the command line, yes this could be a reason you can't login. You would only be able to deploy from a managed device in this case.

mattgotteiner avatar Jan 03 '24 22:01 mattgotteiner

I am also getting this error, I'm working locally in VS Code Terminal. I have been able to deploy before (i.e. it worked yesterday).

I've followed the azd auth login prompt. I've also tried az account clear && az login to clear up any weird state issues. No luck.

reneenoble avatar May 22 '24 06:05 reneenoble

Also getting these issues

tim-basic avatar Nov 12 '24 03:11 tim-basic

It worked for me when I deleted .azure directory from the working directory and initialized azd again

Giga-Bytes avatar May 05 '25 08:05 Giga-Bytes