相关疑难解决方法(0)

以编程方式创建blob存储容器

我有一个要求,在创建公司时,我的storageaccount中创建了一个关联的blob存储容器,容器名称设置为传入的字符串变量.我尝试了以下操作:

public void AddCompanyStorage(string subDomain)
    {
        //get the storage account.
        CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
            System.Configuration.ConfigurationManager.AppSettings["StorageConnectionString"].ToString());

        //blob client now
        CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();            

        //the container for this is companystyles
        CloudBlobContainer container = new CloudBlobContainer("https://mystore.blob.core.windows.net/" + subDomain);
    }
Run Code Online (Sandbox Code Playgroud)

然而,这并没有像我预期的那样创建容器,我是否以错误的方式进行此操作?这可能吗?

干杯

c# azure azure-storage azure-storage-blobs

11
推荐指数
1
解决办法
1万
查看次数

标签 统计

azure ×1

azure-storage ×1

azure-storage-blobs ×1

c# ×1