Skip to content

SWA CLI Tool Device Login #966

@serdar

Description

@serdar

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
  • 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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions