Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provision fails with "[Login.sur]: We couldn't find a subscription.", I am logged in into Azure. #13181

Closed
andreyselitsky opened this issue Feb 12, 2025 · 10 comments
Assignees
Labels
*duplicate This issue or pull request already exists

Comments

@andreyselitsky
Copy link

andreyselitsky commented Feb 12, 2025

To Reproduce
Steps to reproduce the behavior:

  • Create a basic bot sample in TTK.
  • Click Provision

Screenshots

Image

VS Code Extension Information (please complete the following information):
[email protected]
[email protected] (Universal)
[email protected] (24B2083)

Additional Ctx

  • Sign Out/Sign In doesn't help
  • I am logged-in into Azure and I have more than one subscriptions
Copy link

👋 Hi @andreyselitsky,

Thank you for reporting this issue! We want to let you know that:

⏱️ Our team will personally review your issue
🎯 You can expect a response within 2 business days

✨ This is an AI-generated initial response
🤖 AI-Generated Preliminary Analysis:

The error message "[Login.sur]: We couldn't find a subscription" indicates that the Teams Toolkit is unable to find a valid Azure subscription associated with your logged-in account. Here are some steps to troubleshoot and resolve this issue:

Steps to Resolve

  1. Verify Azure Subscription:

    • Ensure that your Azure account has an active subscription. You can check this by logging into the Azure Portal and navigating to "Subscriptions" to see if there are any active subscriptions listed.
  2. Sign Out and Sign In Again:

    • Sign out from your Azure account in Visual Studio Code and sign in again.
    • To sign out, go to the bottom left corner of VS Code where your account profile is located, click on it, and select "Sign out from Azure".
    • After signing out, sign back in using the correct Azure account that has the active subscription.
  3. Clear Cache:

    • Sometimes, cached credentials might cause issues. Clear the cache by deleting the %USERPROFILE%\.fx\account folder (for Windows) or the equivalent directory on MacOS.
    • Restart Visual Studio Code after clearing the cache.
  4. Check Tenant ID:

    • Ensure that the correct tenant ID is being used. You can find the tenant ID in the Azure Portal under "Azure Active Directory" -> "Properties".
    • Verify the tenant ID in your Teams Toolkit settings or environment configuration files.
  5. Use the Accounts Sidebar:

    • Use the 'Accounts' sidebar at the bottom left of VS Code to manage signed-in accounts. Ensure that the correct Azure account is selected.
  6. Create a New Subscription:

    • If no subscription is available, you may need to create a new one. Go to the Azure Portal and create a new subscription, such as "Pay as you go".
    • Sign out and back into VS Code to refresh the subscription list.

Additional Resources

Summary

By following these steps, you should be able to resolve the issue of not finding an Azure subscription when provisioning your bot. Ensure that you have an active subscription, sign out and back into your Azure account, clear any cached credentials, check your tenant ID, and use the accounts sidebar in VS Code to manage your accounts.

If the issue persists after trying these steps, please provide any additional error messages or logs for further assistance.


Note: This is an automated first response generated by AI. A human team member will review your issue and provide a more detailed response soon. We appreciate your patience!

@microsoft-github-policy-service microsoft-github-policy-service bot added the needs attention This issue needs the attention of a contributor. label Feb 12, 2025
@HuihuiWu-Microsoft
Copy link
Contributor

Thanks @andreyselitsky for reporting this to us. Could you help provide following info to locate the root cause?

1> Is your account under single tenant or multiple tenants?
2> Which tenant is your subscriptions in?
3> Does your tenant have MFA enabled?

Additional info could help like logs in TTK output window and Microsoft Authentication output window.

@HuihuiWu-Microsoft HuihuiWu-Microsoft added needs more info Need user to provide more info and removed investigating needs attention This issue needs the attention of a contributor. labels Feb 13, 2025
@andreyselitsky
Copy link
Author

I just realized I have just one subscription, which is the Azure Plan Offer (Pay-as-you-Go). Could that be causing this error?

@microsoft-github-policy-service microsoft-github-policy-service bot added needs attention This issue needs the attention of a contributor. and removed needs more info Need user to provide more info labels Feb 13, 2025
@HuihuiWu-Microsoft
Copy link
Contributor

@andreyselitsky Is the subscription under a MFA-enabled secondary tenant?

@HuihuiWu-Microsoft HuihuiWu-Microsoft added needs more info Need user to provide more info and removed needs attention This issue needs the attention of a contributor. labels Feb 13, 2025
@andreyselitsky
Copy link
Author

Yes, both under MFA.

@microsoft-github-policy-service microsoft-github-policy-service bot added needs attention This issue needs the attention of a contributor. and removed needs more info Need user to provide more info labels Feb 13, 2025
@HuihuiWu-Microsoft
Copy link
Contributor

@andreyselitsky If the sub is under non-home tenant, then it's expected behavior to not listed. In that case, TTK fails to find valid subscription. Could you help confirm whether it's in home tenant or not?

@andreyselitsky
Copy link
Author

Sorry, I'm not sure I follow. I have an M365 dev tenant (.onmicrosoft.com) with custom app upload for developing copilots and Teams bots, and the subscription is in this tenant.

I just installed the Azure Resources extension, and when I run "Azure: Select Subscriptions..." it correctly shows my subscription.

@HuihuiWu-Microsoft
Copy link
Contributor

Could you help check your settings for microsoft-authentication? If it's msal, change to classic and clear ./fx/account folder. Then try again to see whether you still have the issue.

Image

@HuihuiWu-Microsoft HuihuiWu-Microsoft added needs more info Need user to provide more info and removed needs attention This issue needs the attention of a contributor. labels Feb 14, 2025
@andreyselitsky
Copy link
Author

Yes, that helped! I now see a prompt for a new resource group name. I guess since I only have one subscription, it just goes straight to creating the resource group. Thanks for your help!

Image

@microsoft-github-policy-service microsoft-github-policy-service bot added needs attention This issue needs the attention of a contributor. and removed needs more info Need user to provide more info labels Feb 14, 2025
@HuihuiWu-Microsoft
Copy link
Contributor

Duplicated with #13155

@HuihuiWu-Microsoft HuihuiWu-Microsoft added *duplicate This issue or pull request already exists and removed needs attention This issue needs the attention of a contributor. labels Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
*duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants