Azure / static-web-apps-cli

Azure Static Web Apps CLI ✨
https://aka.ms/swa/cli-local-development
MIT License
583 stars 110 forks source link

Unable to find a valid subscription when running swa login #784

Closed Gonkers closed 7 months ago

Gonkers commented 7 months ago

Before filing this issue, please ensure you're using the latest CLI by running swa --version and comparing to the latest version on npm.

Are you accessing the CLI from the default port :4280 ?

Make sure you are accessing the URL printed in the console when running swa start!

ℹ️ NOTE: Make sure to enable debug logs when running any swa commands using --verbose=silly

Describe the bug I ran the command swa login and received the error ✔ Successfully logged into Azure! ✖ Failed to setup project: No valid subscription found for tenant XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX. Please read https://docs.microsoft.com/azure/cost-management-billing/manage/no-subscriptions-found

✖ If you believe this behavior is unexpected, please raise a GitHub issue at: https://github.com/Azure/static-web-apps-cli/issues/new/choose

To Reproduce Steps to reproduce the behavior:

  1. Run swa login

Expected behavior I expected to login to Azure.

Screenshots

PS C:\Users\gonkers\source\repos\static-test> npm install -g @azure/static-web-apps-cli
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@azure/msal-node@2.5.1',
npm WARN EBADENGINE   required: { node: '16|| 18 || 20' },
npm WARN EBADENGINE   current: { node: 'v21.2.0', npm: '10.2.3' }
npm WARN EBADENGINE }

added 324 packages in 16s

48 packages are looking for funding
  run `npm fund` for details
PS C:\Users\gonkers\source\repos\static-test> swa

Welcome to Azure Static Web Apps CLI (1.1.6)

(node:31040) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
→ No configuration found, running swa init...

(node:18064) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
√ Choose a configuration name: ... static-test

Detected configuration for your app:
- Framework(s): none
- App location: .
- Output location: .
- API location:
- API language:
- API version:
- Data API location:
- App build command:
- API build command:
- App dev server command:
- App dev server URL:

- API dev server URL:

√ Are these settings correct? ... no
× What's your app location? ... .
✖ Operation canceled. Exit.

PS C:\Users\gonkers\source\repos\static-test> swa login

Welcome to Azure Static Web Apps CLI (1.1.6)

(node:37080) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Checking Azure session...
✔ Successfully logged into Azure!
✖ Failed to setup project: No valid subscription found for tenant XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX..
  Please read https://docs.microsoft.com/azure/cost-management-billing/manage/no-subscriptions-found

✖ If you believe this behavior is unexpected, please raise a GitHub issue at:
  https://github.com/Azure/static-web-apps-cli/issues/new/choose

Desktop (please complete the following information):

Additional context I am just trying to get started with Azure static web apps with the swa cli. I was following the instructions here https://azure.github.io/static-web-apps-cli/docs/use/install

Gonkers commented 7 months ago

It looks like have to specify the subscription with the --subscription-id parameter. swa login --subscription-id XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX