Windows Azure: Exception while creating a blob container

Posted by veda on Stack Overflow See other posts from Stack Overflow or by veda
Published on 2010-04-07T16:10:17Z Indexed on 2010/04/07 16:13 UTC
Read the original article Hit count: 301

Filed under:
|
|

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

© Stack Overflow or respective owner

Related posts about Windows

Related posts about Azure