This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
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?
Solved! Go to Solution.
Only viable solution appears to be downgrading azure-core and azure-identity dependencies to those used by Fabric Runtime and refactoring the custom package.
Only viable solution appears to be downgrading azure-core and azure-identity dependencies to those used by Fabric Runtime and refactoring the custom package.
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!
Hi @bmmtf,
What happens if you remove the custom library, save the environment, wait a few minutes, and then add it back in?
Proud to be a Super User! | |
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.
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!