Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataFactoryManagementClient() authentication fails when using DefaultAzureCredential? #14635

Closed
SeaDude opened this issue Oct 20, 2020 · 3 comments
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Data Factory Mgmt This issue is related to a management-plane library. needs-team-triage Workflow: This issue needs the team to triage. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@SeaDude
Copy link

SeaDude commented Oct 20, 2020

  • Package Name: azure.mgmt.datafactory
  • Package Version: azure-mgmt-datafactory==0.13.0
  • Operating System: Unbuntu 20
  • Python Version: 3.8.5

Describe the bug
I use DefaultAzureCredential for all Python dev up to this point (KeyVault clients, BlobStorage clients, etc). This is my first time working with azure.mgmt.datafactory in Python. When trying to use DefaultAzureCredential, I get the error: AttributeError: 'DefaultAzureCredential' object has no attribute 'signed_session'.

To Reproduce
Steps to reproduce the behavior:

credential = DefaultAzureCredential()
resource_client = ResourceManagementClient(credential, subscription_id)
adf_client = DataFactoryManagementClient(credential, subscription_id)
rg_name = 'RG_ADF_SANDBOX1'
df_name = 'df20201019test'
df_resource = Factory(location='westus')
df = adf_client.factories.create_or_update(rg_name, df_name, df_resource) #<----ERROR HERE

Expected behavior
The DefaultAzureCredential cred chain would be used to authenticate DataFactoryManagementClient().

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Oct 20, 2020
@kaerm kaerm added Data Factory Mgmt This issue is related to a management-plane library. needs-team-triage Workflow: This issue needs the team to triage. labels Oct 20, 2020
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Oct 20, 2020
@ganeshbch
Copy link

This issue is addressed here: https://docs.microsoft.com/en-us/azure/developer/python/azure-sdk-authenticate?tabs=cmd

Search "Using DefaultAzureCredential with SDK management libraries" on this page and it will take you to the section that gives more information to resolve this issue.

It can be resolved by using Wrapper Classes.

@SeaDude
Copy link
Author

SeaDude commented Oct 22, 2020

Thank you for the link @Ganeshbhargav. I don't understand how the wrapper works, so I probably won't incorporate it into my code. I'll stick to ServicePrincipalCredentials (I think thats what its called) until DefaultAzureCredential is implemented for this library.

@SeaDude SeaDude closed this as completed Oct 22, 2020
@kaerm
Copy link
Contributor

kaerm commented Oct 26, 2020

@lmazuel should the link on this docs page lead to https://github.com/jongio/azidext#python instead? It seems to have additional instructions to help make things easier to incorporate

openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-python that referenced this issue Jun 2, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Data Factory Mgmt This issue is related to a management-plane library. needs-team-triage Workflow: This issue needs the team to triage. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

3 participants