Closed mattiethecat closed 2 years ago
Hi, I had the same issue today, but when triggering an ADF Pipeline.
I found a workaround and these are the changes i made:
from azure.mgmt.datafactory import DataFactoryManagementClient
from azure.identity import ClientSecretCredential
credentials = ClientSecretCredential(client_id=client_id, client_secret=client_secret, tenant_id=tenant_id)
adf_client = DataFactoryManagementClient(credentials, subscription_id)
Hope this helps :)
Also this is the full list of packages i used:
Hi @mattiethecat ,
This package azure-mgmt-datafactory
with version 1.0.0
is created by the next-generation code generator that has lots of importtant breaking changes.
You can follow this migration guide to fix your code.
If you don't want to use this new version now, you just need to keep verion < 1.0.0
.
Hi @mattiethecat. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “/unresolve
” to remove the “issue-addressed” label and continue the conversation.
Hi @mattiethecat, since you haven’t asked that we “/unresolve
” the issue, we’ll close this out. If you believe further discussion is needed, please add a comment “/unresolve
” to reopen the issue.
Describe the bug In the 1.0.0 release, azure-mgmt-datafactory has this error:
Exception has occurred: AttributeError 'ServicePrincipalCredentials' object has no attribute 'get_token'
To Reproduce Steps to reproduce the behavior:
Install the following: conda create --yes --quiet --name myEnvironment3 python=3.6.8 call activate myEnvironment3 pip install azure-mgmt-datafactory==1.0.0 pip install msrestazure
Create a python file and execute it:
from azure.mgmt.datafactory import DataFactoryManagementClient from azure.common.credentials import ServicePrincipalCredentials from azure.mgmt.datafactory.models import Dataset, PipelineResource
df_name = '...' rg_name = '...' client_id= '...' client_secret='...' tenant_id ='...' subscription_id = '...'
credentials = ServicePrincipalCredentials(client_id=client_id, secret=client_secret, tenant=tenant_id) adf_client = DataFactoryManagementClient(credentials, subscription_id) dflist = adf_client.factories.list_by_resource_group(rg_name) for i in dflist: print (i)
Expected behavior A list of data factories . Error can be avoided by changing the above pip install step to be: pip install azure-mgmt-datafactory==0.14.0