简体   繁体   中英

creating Azure Data factory linked service using Managed identity with python

I'm using python scripts to create and manage data factory pipelines, when I want to create a linked service, I'm just using this code:

https://docs.microsoft.com/en-us/azure/data-factory/quickstart-create-data-factory-python#create-a-linked-service

but now I want to create the linked service using managed identity and not by name and key, and I can't find any example of how to do it with python.

I managed to do it manually like so: 在此处输入图像描述

but I want to do it using python.

thanks!

service_endpoint str Required Blob service endpoint of the Azure Blob Storage resource. It is mutually exclusive with connectionString, sasUri property.

According to the API documentation , you should use service_endpoint to create linked service with Managed identity. You should pass Blob service endpoint to service_endpoint .

The following is my test code:

ls_name = 'storageLinkedService001'
endpoint_string = 'https://<account name>.blob.core.windows.net'
ls_azure_storage = LinkedServiceResource(properties=AzureBlobStorageLinkedService(service_endpoint=endpoint_string))
ls = adf_client.linked_services.create_or_update(rg_name, df_name, ls_name, ls_azure_storage)

Result:

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM