Azure / azure-storage-python

Microsoft Azure Storage Library for Python
https://azure-storage.readthedocs.io
MIT License
339 stars 241 forks source link

Support multiple clouds on vendor package #646

Closed grgarcia-ms closed 4 years ago

grgarcia-ms commented 4 years ago

Which service(blob, file, queue) does this issue concern?

storage

Which version of the SDK was used? Please provide the output of pip freeze.

py3:0.11.9

What problem was encountered?

hardcoded constant to blob.core.windows.net, this does not work in other clouds

Have you found a mitigation/solution?

https://github.com/Azure/azure-storage-python/blob/master/azure-storage-common/azure/storage/common/_constants.py#L24

Note: for table service, please post the issue here instead: https://github.com/Azure/azure-cosmosdb-python.

xiafu-msft commented 4 years ago

Hi @grgarcia-ms

Thanks for reaching out! It's not hardcoded, you could set custom_domain when your endpoint is not in this format {account_name}.{service}.{endpoint_suffix} if your endpoint is in that format, you can set endpoint_suffix when you create a service instance. In addition, set connection_string will also take your customized endpoint if your customized endpoint is in the connection string.

For example: service_client = AppendBlobService(account_name, account_key, endpoint_suffix='core.chinacloudapi.cn') code link: https://github.com/Azure/azure-storage-python/blob/master/azure-storage-blob/azure/storage/blob/appendblobservice.py#L73-L110

Feel free to let me know if you need any other help!

xiafu-msft commented 4 years ago

Close this for now, if your problem is not addressed feel free to reopen it! ^_^