使用Azure Blob Emulator访问容器URL

时间:2017-06-07 09:54:42

标签: c# azure-storage-blobs azure-emulator

我正在尝试使用Azure模拟器来创建容器,但我认为不起作用:

模拟器端点:

BlobEndpoint: http://127.0.0.1:10000/

App.config:

<appSettings>
  <add key="StorageConnectionString" value="UseDevelopmentStorage=true;" />
</appSettings>

代码:

CloudStorageAccount storageAccount =
                   CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("StorageConnectionString"));

        CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();

        CloudBlobContainer container = blobClient.GetContainerReference("mycontainer");
await container.CreateIfNotExistsAsync();

但是当我尝试访问http://127.0.0.1:10000/mycontainer时,我得到了:

The requested URI does not represent any resource on the server.

1 个答案:

答案 0 :(得分:2)

正确的容器URI应为http://127.0.0.1:10000/devstoreaccount1/mycontainer,您是如何尝试访问它的?我不认为直接在浏览器中打开它是可行的。