cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Newest version of dbx-workspace always returns NoneType

pjruhnke
New Contributor

I just updated the `databricks-sdk` library to the newest version on PyPi, and for some reason, I am almost always getting this error:

File "/home/site/wwwroot/.python_packages/lib/site-packages/databricks/sdk/credentials_provider.py", line 283, in token_source_for aad_endpoint = cfg.arm_environment.active_directory_endpoint AttributeError: 'NoneType' object has no attribute 'active_directory_endpoint'It happens within this function, and I've checked: no value is null. 

Here is the code that causes this issue

self.client = WorkspaceClient( host=dbx_workspace, azure_workspace_resource_id=resource, azure_tenant_id=tenant_id, azure_client_id=client_id, azure_client_secret=client_secret, )

Is it because of my requirements.txt? Is there a mismatch because it seemed to have worked before?

azure-functions==1.21.*
cffi==1.17.1
azure-servicebus<=7.14.1
azure-storage-queue==12.12.0
azure-mgmt-core>=1.5.0
invoke==2.2.0
black==25.1.0
flake8==7.1.2
pytest-cov==6.0.0
environs
regex==2024.11.6
requests==2.32.3
azure-keyvault-secrets<5.0.0,>=4.3.0
azure-identity==1.20.0
azure-mgmt-resource==23.3.0
azure-mgmt-datafactory==9.1.0
azure-core>=1.30.0
azure-common==1.1.28
kayday==2.2.6
jsonmerge==1.9.2
opencensus-ext-azure==1.1.14
tzlocal>=5.3
python-dateutil>=2.9.0
pika==1.3.2
protobuf==6.30.*
msal>=1.30.0
databricks-sdk>=0.57.0
psycopg2-binary==2.9.10
urllib3==2.3.0
cryptography==43.0.3 # pin to avoid breaking changes

 

 

2 REPLIES 2

szymon_dybczak
Esteemed Contributor III

Hi @pjruhnke ,

I don't think this problem is related to your requirements.txt. I've created fresh python virtual environment using your requirements file and I in my case everything worked as expected.
Maybe try to once again, but this time create new virtual envirionment?

nayan_wylde
Esteemed Contributor

It seems your issue is in getting the AAD token. You are using an SPN to authenticate. You can try to update the azure packages too.

azure-identity>=1.21.0
azure-core>=1.32.0
azure-mgmt-core>=1.6.0
databricks-sdk>=0.57.0