Azure / azure-sdk-for-python

This repository is for active development of the Azure SDK for Python. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/python/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-python.
MIT License
4.52k stars 2.75k forks source link

Factory Class default value for identity #9530

Closed Quisl closed 4 years ago

Quisl commented 4 years ago

Is your feature request related to a problem? Please describe. When I create an Azure Data Factory with the SDK (or REST API) it does not have a SystemAssigned identity. However, when I create it via the Azure Portal or Powershell it does.

According to the documentation, this is expected behaviour: https://docs.microsoft.com/en-us/azure/data-factory/data-factory-service-identity#generate-managed-identity

However, I find it confusing that not all Azure connections work the same way.

Describe the solution you'd like Can you set the default value of identity to

FactoryIdentity(type="SystemAssigned")

or something like this?:

https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/models/factory.py#L77

Describe alternatives you've considered An other way is that Data Factories should never come with a managed identity (--> change behaviour of PowerShell and Azure Portal). This would reduce confusion. Then the SDK users always need to import FactoryIdentity manually whenever they need it (current behaviour). But at least they will know that they need to do it in the first place.

Additional context I'm not exactly sure of the consequences. But I can not imagine of the reasoning behind the current behaviour. Are there any negative consequences if you always had a managed identity for all Azure Data Factories?

ghost commented 4 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc

lmy269 commented 4 years ago

@shawnxzq to take a look

bigdatamoore commented 4 years ago

Hi, this syntax works to create a Factory object and assign it a system identity:

Factory(location="eastus",identity=FactoryIdentity())
lmazuel commented 4 years ago

Thanks @bigdatamoore ! Closing the issue