Skip to content

Login fails if password starts with @ #2134

@Tinathnath

Description

@Tinathnath

Description

Hi,
I have an AZ Devops Pipeline to deploy SPFx packages.
There are multiple jobs running the same commands so I created a template.
It works like a charm... until today. The service account I use to login to my environment has a password starting with an "@" and it seems like the CLI does not like it.

Steps to reproduce

  • Create a template pipeline with M365 CLI commands, including m365 login
  • Use template parameter to pass user account and password to the command
  • Use a secret variable to store the password
  • Run the pipeline

Expected result

Login successfull.

Actual result

Login fails with error:
image

What I highlighted in blue is the password without the "@" (???).
Seems like Devops/M365 cli is trying to fetch a file.

Here's my template:

steps:
  - task: NodeTool@0
    displayName: Install NodeJS
    inputs:
      versionSpec: ${{ parameters.nodeVersion }}
  
  - task: Npm@1
    displayName: Install Office365 CLI
    inputs:
      command: 'custom'
      customCommand: 'install -g @pnp/cli-microsoft365'

  - script: m365 login -t password -u "${{ parameters.adminLogin }}" -p "$ADMIN_PWD" --verbose
    env:
      ADMIN_PWD: ${{ parameters.adminPassword }}
    displayName: Login to Office 365

  - script: m365 spo app add -p ${{ parameters.packagePath }} --overwrite --verbose
    displayName: Upload SPFx package

  - script: m365 spo app deploy --name ${{ parameters.packageName }} --verbose
    displayName: Deploy SPFx package

Environment

Azure Devops pipeline. Ubuntu-latest agent job. M365 CLI latest.

Thank you :)

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions