veda
veda

Reputation: 6604

Windows Azure: Error 300 Ambiguous Redirect when creating a blob container

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....

Upvotes: 0

Views: 925

Answers (3)

bhavesh lad
bhavesh lad

Reputation: 1292

I think you can not give upper case letters in queue, table or blob name. The name should have only lower case characters.

Upvotes: 0

Manoj Attal
Manoj Attal

Reputation: 2826

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.

Upvotes: 0

user94559
user94559

Reputation: 60153

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.

Upvotes: 1

Related Questions