Azure / static-web-apps-cli

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

Cannot login or deploy application: findCredentials is not a function error #885

Open brt0555 opened 3 months ago

brt0555 commented 3 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 cannot deploy an application. It was working fine, but I have updated to the newest version. During running swa deploy i got:

Checking Azure session... Executing authenticateWithAzureIdentity

✖ If you believe this behavior is unexpected, please raise a GitHub issue at: https://github.com/Azure/static-web-apps-cli/issues/new/choose It also happens when i try toswa login`

Configuration used: { "$schema": "https://aka.ms/azure/static-web-apps-cli/schema", "configurations": { "app-frontend": { "appLocation": ".", "outputLocation": "dist", "appBuildCommand": "npm run build", "run": "npm run dev", "appDevserverUrl": "http://localhost:5173", "tenant": "XXXX", "appName": "app-stage", "resourceGroup": "app-sgr-stage", "env": "prod" } } }

Desktop (please complete the following information):

laurieatkinson commented 3 months ago

I am having the same issue after updating to version 2.0.1 and am unable to deploy.

Timothyw0 commented 3 months ago

Hi, acknowledging this issue. We will test this locally and get it resolved. In the meantime, are you able to login or deploy using a prior version?

kirtimaan-askin commented 2 months ago

+1 facing the same issue. OS: macOS 14.6.1 (23G93) Processor: Apple M3 Pro SWA Version: 2.0.1

rodrigorodriguez commented 2 months ago

Solution: https://github.com/Azure/static-web-apps-cli/issues/879#issuecomment-2283416213

Login first with az login, then swa login.

kirtimaan-askin commented 2 months ago

Going to give it a try and update back

From: Rodrigo Rodriguez @.> Date: Wednesday, 4 September 2024 at 21:54 To: Azure/static-web-apps-cli @.> Cc: Kirtimaan Lodha @.>, Comment @.> Subject: Re: [Azure/static-web-apps-cli] Cannot login or deploy application: findCredentials is not a function error (Issue #885)

Solution: #879 (comment)https://github.com/Azure/static-web-apps-cli/issues/879#issuecomment-2283416213

Login first with az login, then swa login.

— Reply to this email directly, view it on GitHubhttps://github.com/Azure/static-web-apps-cli/issues/885#issuecomment-2329502128, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A5VOFDDZHOO2CNH5X2B3SZDZU4X4DAVCNFSM6AAAAABM3TB3OCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRZGUYDEMJSHA. You are receiving this because you commented.Message ID: @.***>

kirtimaan-askin commented 2 months ago

I can confirm that installing Azure CLI on my MacBook and then using az login to same tenant and subscription solved the issue. After az login, I am able to deploy the SWA from latest stable release of the swa package. Thank @rodrigorodriguez

Definitely this can be marked and documented as a setup step or a dependency though

malthuswaswrong commented 2 months ago

+1 for issue. Affects the Visual Studio publish as it seems to shell to swa.cmd.

kirtimaan-askin commented 2 months ago

@malthuswaswrong you can try using az cli to login first, and then try VS publish

sergiojrdotnet commented 5 days ago

I’m still getting the same error even after running az login. Image