Skip to content

Cannot login with cli 3.0.8 and teamsapp.yml 1.8 #13565

Closed
@ThomasPe

Description

@ThomasPe

Describe the bug
I upgraded my teams app solution to 1.8 in the teamsapp.yml.
For the deployment via Azure DevOps Pipelines it seems I need the CLI version 3.0.8 as anything lower will result in a version error.
But with that version I cannot log in using a Password / Client Secret.

To Reproduce
here's my DevOps yaml:

- script: |
    npm install @microsoft/[email protected]
  displayName: "Install CLI"
  workingDirectory: $(Pipeline.Workspace)/TeamsApp

- script: |
    npx teamsapp auth login azure \
    --username $(AZURE_SERVICE_PRINCIPAL_NAME) \
    --service-principal true \
    --tenant $(AZURE_TENANT_ID) \
    --password $(AZURE_SERVICE_PRINCIPAL_PASSWORD) \
    --interactive false 
  displayName: "Login Azure by service principal"
  workingDirectory: $(Pipeline.Workspace)/TeamsApp
(✖) Error: unknown.UnhandledError: An unexpected error has occurred while performing the unknown task. {"stack":"AggregateAuthenticationError: ChainedTokenCredential authentication failed.\nAuthenticationRequiredError: invalid_scope: 1002012 - [2025-03-27 20:28:34Z]: AADSTS1002012: The provided value for scope https://management.core.windows.net/user_impersonation is not valid. Client credential flows must have a scope value with /.default suffixed to the resource identifier (application ID URI). Trace ID: cf0070cd-cc37-4911-b1ad-11ea1cb9ad00 Correlation ID: 0a64959d-60fe-4569-8399-ba260d74ef1d Timestamp: 2025-03-27 20:28:34Z - Correlation ID: 0a64959d-60fe-4569-8399-ba260d74ef1d - Trace ID: cf0070cd-cc37-4911-b1ad-11ea1cb9ad00\n    at /home/vsts/work/1/s/node_modules/@microsoft/teamsapp-cli/lib/index.js:2:162247\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async Object.withSpan (/home/vsts/work/1/s/node_modules/@microsoft/teamsapp-cli/lib/index.js:20:737957)\n    at async ChainedTokenCredential.getToken (/home/vsts/work/1/s/node_modules/@microsoft/teamsapp-cli/lib/index.js:2:161614)","message":"ChainedTokenCredential authentication failed.\nAuthenticationRequiredError: invalid_scope: 1002012 - [2025-03-27 20:28:34Z]: AADSTS1002012: The provided value for scope https://management.core.windows.net/user_impersonation is not valid. Client credential flows must have a scope value with /.default suffixed to the resource identifier (application ID URI). Trace ID: cf0070cd-cc37-4911-b1ad-11ea1cb9ad00 Correlation ID: 0a64959d-60fe-4569-8399-ba260d74ef1d Timestamp: 2025-03-27 20:28:34Z - Correlation ID: 0a64959d-60fe-4569-8399-ba260d74ef1d - Trace ID: cf0070cd-cc37-4911-b1ad-11ea1cb9ad00","errors":[{"stack":"AuthenticationRequiredError: invalid_scope: 1002012 - [2025-03-27 20:28:34Z]: AADSTS1002012: The provided value for scope https://management.core.windows.net/user_impersonation is not valid. Client credential flows must have a scope value with /.default suffixed to the resource identifier (application ID URI). Trace ID: cf0070cd-cc37-4911-b1ad-11ea1cb9ad00 Correlation ID: 0a64959d-60fe-4569-8399-ba260d74ef1d Timestamp: 2025-03-27 20:28:34Z - Correlation ID: 0a64959d-60fe-4569-8399-ba260d74ef1d - Trace ID: cf0070cd-cc37-4911-b1ad-11ea1cb9ad00\n    at handleMsalError (/home/vsts/work/1/s/node_modules/@microsoft/teamsapp-cli/lib/index.js:2:117222)\n    at MsalClientSecret.doGetToken (/home/vsts/work/1/s/node_modules/@microsoft/teamsapp-cli/lib/index.js:2:167367)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async Object.withSpan (/home/vsts/work/1/s/node_modules/@microsoft/teamsapp-cli/lib/index.js:20:737957)\n    at async /home/vsts/work/1/s/node_modules/@microsoft/teamsapp-cli/lib/index.js:2:161924\n    at async Object.withSpan (/home/vsts/work/1/s/node_modules/@microsoft/teamsapp-cli/lib/index.js:20:737957)\n    at async ChainedTokenCredential.getToken (/home/vsts/work/1/s/node_modules/@microsoft/teamsapp-cli/lib/index.js:2:161614)","message":"invalid_scope: 1002012 - [2025-03-27 20:28:34Z]: AADSTS1002012: The provided value for scope https://management.core.windows.net/user_impersonation is not valid. Client credential flows must have a scope value with /.default suffixed to the resource identifier (application ID URI). Trace ID: cf0070cd-cc37-4911-b1ad-11ea1cb9ad00 Correlation ID: 0a64959d-60fe-4569-8399-ba260d74ef1d Timestamp: 2025-03-27 20:28:34Z - Correlation ID: 0a64959d-60fe-4569-8399-ba260d74ef1d - Trace ID: cf0070cd-cc37-4911-b1ad-11ea1cb9ad00","name":"AuthenticationRequiredError"}],"name":"AggregateAuthenticationError"}

Expected behavior
A successfull login & authenticated cli

CLI Information (please complete the following information):

  • OS: ubuntu
  • Version 3.0.8

Additional context
teamsapp.yml Version 1.8

Metadata

Metadata

Labels

TA:E2ETeam Area: E2EbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions