Azure SWA offer swa login
command. What if I want to logout Azure account. What can I do? There is no swa logout
command by default.
Asked
Active
Viewed 240 times
1

Will Huang
- 2,955
- 2
- 37
- 90
2 Answers
1
It because I use Windows 10. Here are the commands we need to clear credentials.
Find all credential created by swa-cli
cmdkey.exe /list | findstr swa-cli
Clear all credential created by swa-cli
cmdkey.exe /list | findstr swa-cli | ForEach-Object {
cmdkey /delete:$($_.Split(' ')[5])
}

Will Huang
- 2,955
- 2
- 37
- 90
0
As of v1.1.4, there's a --clear-credentials
command-line option:
$ npx @azure/static-web-apps-cli login --help
Welcome to Azure Static Web Apps CLI (1.1.4)
Usage: swa login [options]
login into Azure
Options:
-S, --subscription-id <subscriptionId> Azure subscription ID used by this project (default: "...")
-R, --resource-group <resourceGroup> Azure resource group used by this project
-T, --tenant-id <tenantId> Azure tenant ID (default: "...")
-C, --client-id <clientId> Azure client ID
-CS, --client-secret <clientSecret> Azure client secret
-n, --app-name <appName> Azure Static Web App application name
-CC, --clear-credentials clear persisted credentials before login (default: false)
So you could run:
npx @azure/static-web-apps-cli login --clear-credentials
or:
npx @azure/static-web-apps-cli login -CC

tony19
- 125,647
- 18
- 229
- 307