@Shao Peng Sun Thanks for reaching out to Microsoft Q&A. I understand that you are looking for creating Blob Service Client with either Linked service, SAS token or service principle. Please correct me otherwise.
Please refer to the below code snippets-
Create blob service client using a shared access key- https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/storage/azure-storage-blob/samples/blob_samples_authentication.py#L66
Create blob service client using ClientSecretCredential- https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/storage/azure-storage-blob/samples/blob_samples_authentication.py#L88
Create blob service client using Azure Identity- https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/storage/azure-storage-blob/samples/blob_samples_authentication.py#L125
This doc shows how to construct the BlobServiceClient Class using SAS - https://learn.microsoft.com/en-us/python/api/azure-storage-blob/azure.storage.blob.blobserviceclient?view=azure-python
Does this help? Please let me know. Thank you!
Remember:
Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.
Want a reminder to come back and check responses? Here is how to subscribe to a notification.