Create blob storage container in c# using fluent API
Is it possible to create containers directly with the API in the fluent namespace? If not, how do I get the CloudStorageAccount instance from my IStorageAccount one?
At least as of today, it is not possible. When it comes to managing storage accounts in Azure, there are two REST APIs - Storage Resource Provider REST API
and Storage Service REST API
. Former deals with management of storage account themselves (like creation/updation etc.) while the latter deals with the data in storage account. You can say that the former API deals with control plane and the latter deals with data plan. Creation of a blob container falls under latter category.
Fluent API
you mentioned is a wrapper over Storage Resource Provider API
while Microsoft.WindowsAzure.Storage
library is a wrapper over Storage Service REST API
. You would need to reference this library in your project to create blob containers.
What you could do is get the access key (key 1 or key 2) using the Fluent API. Once you have the key, you will create an instance of CloudStorageAccount
using Microsoft.WindowsAzure.Storage library and create a blob container using that. I know that this is not the answer you're looking for but unfortunately this is the only way as of today.