Forum Discussion

bmmtf's avatar
bmmtf
Frequent Visitor
6 months ago
Solved

azure-core package dependency version

I have a custom package that I have imported to an environment. Suddenly my notebooks using this environment are running into an error:

ImportError: cannot import name 'AccessTokenInfo' from 'azure.core.credentials' (/home/trusted-service-user/cluster-env/trident_env/lib/python3.11/site-packages/azure/core/credentials.py)

 

My package uses azure-core version 1.38.2, it seems Fabric runtime 1.3 uses azure-core 1.30.2. My notebooks weren't running into this error before, and I have not made any updates to my package dependencies, I have basically changed nothing and my notebooks are suddenly breaking. Has the runtime changed it's azure-core dependency version? Am I not able to upgrade this built-in package version?

  • Only viable solution appears to be downgrading azure-core and azure-identity dependencies to those used by Fabric Runtime and refactoring the custom package.

6 Replies

  • bmmtf's avatar
    bmmtf
    Frequent Visitor

    After further investigation, it appears to be due to my azure-identity 1.25.2 package that depends on azure-core>=1.31.0. The azure-identity __init__.py file imports an AccessTokenInfo class from azure.core.credentials that is not present in azure-core version 1.30.2. Still not sure as to why this has randomly started raising the error, but worked fine in the past.

    • deborshi_nag's avatar
      deborshi_nag
      Icon for Super User rankSuper User

      Hello bmmtf one possible explanation is if someone changed the Spark Runtime in your Environment item. Microsoft unfortunately doesn't publish their Spark runtime version against the azure-core library version being used. 

       

      The version of azure-core is controlled by Fabric runtime. It may also change when Microsoft updates the Spark runtime! 

       

  • Hi bmmtf, 

     

    What happens if you remove the custom library, save the environment, wait a few minutes, and then add it back in?  

  • bmmtf's avatar
    bmmtf
    Frequent Visitor

    Hey deborshi_nag can confirm the Spark Runtime has not changed for the environment, it is set at 1.3.

     

    Understand the version of azure-core is controlled by Microsoft, can't understand why this has suddenly become breaking after no changes on our end, but not the first time it's happened in Fabric!

  • bmmtf's avatar
    bmmtf
    Frequent Visitor

    Only viable solution appears to be downgrading azure-core and azure-identity dependencies to those used by Fabric Runtime and refactoring the custom package.