If I have code like the following, then I can create a container and it will use the default request options I specify:
Listing A:
auto account = azure::storage::cloud_storage_account::parse(L"connection_string_here");
auto client = account.create_cloud_blob_client(my_generate_default_options());
auto container = client.get_container_reference(my_container_name);
Now container will use the m_client member to get the default options for requests and everything works nicely.
If instead, I want to create a container from a URI and credentials, I have the nice helper function available in the SDK:
This means, the client cannot have default request options. Instead, I have to write more code to do the same thing init is doing if I want to have the default options but create from a URI and SAS token:
This lets us create the container with either a connection string or a SAS token, and then act on the container and blobs using a retry policy we specify, without having to give the request options for every operation on the blob.
@mattdurak Maybe in the future we'll consider add another constructor for cloud_blob_client which accepts default blob options as third parameter. Thanks for your feedback.
If I have code like the following, then I can create a container and it will use the default request options I specify:
Listing A:
Now container will use the
m_client
member to get the default options for requests and everything works nicely.If instead, I want to create a container from a URI and credentials, I have the nice helper function available in the SDK:
Listing B:
Internally, this creates a client for the container like this:
This means, the client cannot have default request options. Instead, I have to write more code to do the same thing
init
is doing if I want to have the default options but create from a URI and SAS token:Listing C:
What I would love is to just write this (instead of the code in Listing C)
Listing D:
This lets us create the container with either a connection string or a SAS token, and then act on the container and blobs using a retry policy we specify, without having to give the request options for every operation on the blob.