azure-sdk-for-python: ImportError: cannot import name 'AccessTokenInfo' from 'azure.core.credentials'

  • Package Name: azure-identity
  • Package Version: 1.18.0 and 1.19.0
  • Operating System: linux-ubuntu
  • Python Version: 3.10

Describe the bug Locally all is good, however, when I run from a DevOps pipeline:

- task: AzureFunctionApp@2
    inputs:
      connectedServiceNameARM: "${{ parameters.azureSubscription }}"
      appType: "functionAppLinux"
      appName: ${{ parameters.functionAppName }}
      package: "$(System.DefaultWorkingDirectory)/**/*.zip"
      deploymentMethod: "zipDeploy"

It throws the error: ImportError: cannot import name ‘AccessTokenInfo’ from ‘azure.core.credentials’. My requirements file has azure-identity included in it.

To Reproduce Steps to reproduce the behavior:

  1. Have a python file with from azure.identity import DefaultAzureCredential
  2. Have a requirements.txt file with azure-identity
  3. Run pipeline with - task: AzureFunctionApp@2

Expected behavior To be able to have my app service run from an Azure App Service as it does locally.

Workaround azure-identity==1.17.1

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (9 by maintainers)

Most upvoted comments

Fully deployed.