Azure / azure-cli

Azure Command-Line Interface
MIT License
4.03k stars 3.01k forks source link

Add option to interact with storage API using complete URI of storage service #21516

Open xolve opened 2 years ago

xolve commented 2 years ago

Is your feature request related to a problem? Please describe. I am experimenting with proxy layer on top existing storage accounts. User calls for operations on storage service using the complete URL e.g. "https://storage.contosoimagesproxy.net". The proxy service in turn connects to underlying storage account e.g. "https://contosoimages1.blob.core.windows.net".

This is currently supported in azure-sdk-for-python. I can create client to storage service and it works out of the box as:

service = BlobServiceClient(account_url="https://storage.contosoimagesproxy.net").

Describe the solution you'd like Storage module should accept a parameter for complete URL of storage account as storage-account-url. e.g.

az storage container list --storage-account-url "https://storage.contosoimagesproxy.net" --account-key "some_secret"

Describe alternatives you've considered NA

Additional context A similar issue raised for azure-powershell: https://github.com/Azure/azure-powershell/issues/17285

xolve commented 2 years ago

A sample PR for changes here: https://github.com/Azure/azure-cli/pull/21517

yonzhan commented 2 years ago

storage