views:

165

answers:

2

I followed a tutorial on creating a blob on windows azure. But when I do that, I get an exception error:

Error while creating containerThe server encountered an unknown failure: The remote server returned an error: (300) Ambiguous Redirect.

The code is :

private void SetContainersAndPermission()
    {
        try
        {
            // create a container
            var CloudAccountStorage = CloudStorageAccount.FromConfigurationSetting("BlobConnectionString");
            cloudBlobClient = CloudAccountStorage.CreateCloudBlobClient();
            CloudBlobContainer blobContainer = cloudBlobClient.GetContainerReference("documents");
            blobContainer.CreateIfNotExist();

            // permissions
            var containerPermissions = blobContainer.GetPermissions();
            containerPermissions.PublicAccess = BlobContainerPublicAccessType.Container;
            blobContainer.SetPermissions(containerPermissions);
        }
        catch(Exception ex)
        {
            throw new Exception("Error while creating container" + ex.Message);
        }
    }

Can anyone tell me How to solve this problem....

A: 

I would guess the connection string is somehow wrong? Can you share the connection string? (X out your shared key...)

You could also install Fiddler (debugging HTTP proxy) and see what the HTTP request looks like. That may make the issue more obvious.

smarx
Could you please tell me How to share the connection string...I just followed this tutorialhttp://www.c-sharpcorner.com/UploadFile/saurabh122/516/
veda
A: 

I also faced the same issue. I am not sure if this is the workaround for it. I modified the container name value in ServiceConfiguration.csfg from "Photograph" to "photograph" and it worked.

Manoj