Azure / Azure/static-web-apps-cli

SWA CLI Tool Device Login

Open
#966 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
668
Forks
156
PR merge metrics
No merged PRs in 30d

Description

Using version `2.0.6`.

**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`

**Describe the bug**
I'm trying to authenticate the SWA CLI tool to deploy a simple static web application. After the initial authentication which succeeds I'm asked to re-auth with a devicelogin token, which our Azure admins have disabled. Is there any other way to authorise this without the devicelogin flow?

With verbose debugging turned on the last entry is:
azure:identity:info DeviceCodeCredential => MSAL Node V2 info message: [Mon, 28 Jul 2025 03:41:44 GMT] : [719c6b7d-da6e-461c-a575-a87a2c035eeb] : @azure/msal-common@15.9.0 : Info - Authorization pending. Continue polling.

**To Reproduce**
Steps to reproduce the behavior:

1. Go into your terminal
2. Type in command 'swa deploy'
3. 'Checking Azure session..." opens browser window and proceed to Authorize
4. Receive message 'Auth code was successfully acquired. You can close this window now.'
5. CLI now shows "To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code XXXXXXXX to authenticate."

**Expected behavior**
After initial authorization not expecting additional auth prompts.

**Desktop (please complete the following information):**

- Mac OS X 15.5 (24F74).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.