Windows Azure:创建 Blob 容器时出现错误 300 模糊重定向

发布于 2024-08-27 20:21:21 字数 961 浏览 9 评论 0原文

我遵循了有关在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

终遇你 2024-09-03 20:21:21

我猜连接字符串有问题?您可以分享连接字符串吗? (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.

诗化ㄋ丶相逢 2024-09-03 20:21:21

我也面临同样的问题。我不确定这是否是解决方法。我将 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.

所有深爱都是秘密 2024-09-03 20:21:21

我认为您不能在队列、表或 blob 名称中给出大写字母。该名称只能包含小写字符。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文