Windows Azure:创建 Blob 容器时出现错误 300 模糊重定向
我遵循了有关在 Windows Azure 上创建 Blob 的教程。但是当我这样做时,我收到一个异常错误:
创建容器时出错服务器遇到未知故障:远程服务器返回错误:(300) 模糊重定向。
代码是:
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);
}
}
谁能告诉我如何解决这个问题......
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....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我猜连接字符串有问题?您可以分享连接字符串吗? (X 出你的共享密钥...)
你还可以安装 Fiddler(调试 HTTP 代理)并查看 HTTP 请求是什么样的。这可能会让问题变得更加明显。
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.
我也面临同样的问题。我不确定这是否是解决方法。我将 ServiceConfiguration.csfg 中的容器名称值从“照片”修改为“照片”,并且它有效。
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.
我认为您不能在队列、表或 blob 名称中给出大写字母。该名称只能包含小写字符。
I think you can not give upper case letters in queue, table or blob name. The name should have only lower case characters.