azure.identity.DefaultAzureCredential is an extremely useful helper, unfortunately this does not work for azure-mgmt components. It would be beneficial to have this mechanism unified.
Hi @bmc-msft
This is work in progress already, we'll release a new version of each mgmt package with identity support. I keep this issue assigned to me until then.
Thanks!
Hi @bmc-msft
This is getting closer we're still working, in the meantime I did a gist to explain how to do it:
https://gist.github.com/lmazuel/cc683d82ea1d7b40208de7c9fc8de59d
Hi @bmc-msft we improved that gist with an actual repo with more details:
https://github.com/jongio/azidext
I appreciate the continued feedback as you make progress on this.
Hello @lmazuel I'm linking this here https://stackoverflow.com/questions/61944440/accessing-azure-storage-via-certificate-based-service-principal-credentials-azu
Thank you, will be pending.
Any updates on this?
I think this works now with azure-mgmt-resource v15 https://pypi.org/project/azure-mgmt-resource/
Does anyone know if Python azure.mgmt.datafactory's DataFactoryManagementClient() is cutover to use DefaultAzureCredential() yet? I'm not sure where to see a list of libraries that are compatible.
When I try...:
credential = DefaultAzureCredential()
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)
I'm getting...:
AttributeError: 'DefaultAzureCredential' object has no attribute 'signed_session'
I love using DefaultAzureCredential for Function development (KeyVault clients, BlobStorage clients, etc.). Would really like to stick with the pattern for Azure Data Factory Python dev as well.
Disregard. This was answered elsewhere. I AM curious if there is a timeline for this library to begin using DefaultAzureCredential. This year, next year, 2050?
As someone who has stuggled with adopting Azure most of my career as a result of stuff like this I am majorly disappointed in such a breaking change. But for what its worth and in the spirit of open source here is my insights.
This is still prevalent in AzureCliCredential as well. The below modules are all effected by this. Additionally the base module aio is missing aiohttp python package. These were libs were installed from latest as of today.
from azure.identity.aio import DefaultAzureCredential, AzureCliCredential
from azure.mgmt import resource, compute, network, subscription
I think this works now with azure-mgmt-resource v15 https://pypi.org/project/azure-mgmt-resource/
it does not. latest libs are still broken.
Most helpful comment
Hi @bmc-msft
This is getting closer we're still working, in the meantime I did a gist to explain how to do it:
https://gist.github.com/lmazuel/cc683d82ea1d7b40208de7c9fc8de59d