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

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

Open
1 task
brt0555 opened this issue Aug 21, 2024 · 9 comments
Open
1 task

Comments

@brt0555
Copy link

brt0555 commented Aug 21, 2024

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 ?

  • No, I am using a different port number (--port) and accessing the CLI from that port
  • [X ] Yes, I am accessing the CLI from 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

  • details:
    • tenantId:
    • clientId:
    • clientSecret:
  • useKeychain: true
    Keychain is enabled
    Executing swaCliPersistencePlugin
    Executing before cache access plugin
    Machine ID:
    Invoking crypto service
    Getting credentials
    Getting credentials from native keychain
    Getting keychain reference
    isKeychainEnabled: true
    KeychainCache: undefined
    Attempting to load native keychain
    Executing after cache access plugin
    Machine ID:
    Invoking crypto service
    Did TokenCacheContext cache changed: true
    Setting credentials in keychain
    Encrypting credentials
    Encrypted credentials:
    Setting credentials in native keychain
    Getting keychain reference
    isKeychainEnabled: true
    KeychainCache: undefined
    Attempting to load native keychain
    ✖ Failed to setup project: this.keychainCache.findCredentials is not a function

✖ 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):

  • OS: Windows
  • Version 11
@laurieatkinson
Copy link

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

@Timothyw0
Copy link
Member

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
Copy link

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

@rodrigorodriguez
Copy link

Solution: #879 (comment)

Login first with az login, then swa login.

@kirtimaan-askin
Copy link

kirtimaan-askin commented Sep 5, 2024 via email

@kirtimaan-askin
Copy link

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
Copy link

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

@kirtimaan-askin
Copy link

kirtimaan-askin commented Sep 12, 2024

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

@sergiojrdotnet
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants