The Problem
When I try to work with the storage emulator (v3.4.0.0), I receive the following exception:
System.Net.WebException: The remote server returned an error: (404) Not Found.
Specifically, this happens when I attempt to interact with my CloudBlobContainer
instance, which was created via blobClient.GetContainerReference( myContainerName )
. In this case, it's happening when I try the following:
var permissions = await container.GetPermissionsAsync();
When I debug the code and watch the container instance before this line is executed, I can see that the object's internals are indeed set to be using the emulator and that all of the appropriate fields/properties are as they should be (using the correct "devstoreaccount1" account name and so on).
Any idea why this is happening? Even better: how can I get my code to see the emulator?
Additional Info
127.0.0.1:10000
but get the message "Ping request could not find host 127.0.0.1:10000. Please check the name and try again."The problem wasn't with the emulator itself, it was with the code. Though I didn't see anything in the docs I read to explain this, it seems that it was necessary to call await container.CreateIfNotExistsAsync()
before interacting with the container object.
I assume this is because it has to physically create the container before applying any settings to it.