每个请求都出现 Azure 400 错误请求 [英] Azure 400 Bad Request on every request

查看:32
本文介绍了每个请求都出现 Azure 400 错误请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于某种原因,我的 DevStorage 帐户已停止工作.在对 DevStorage(Blob 和 Table)的每个请求中,我都会收到 400 Bad Request 错误.不过,我可以使用 Azure 存储资源管理器浏览 DevStorage.

For some reason my DevStorage account has stopped working. I get a 400 Bad Request error on every request to DevStorage (both Blob and Table). I can browse DevStorage with Azure Storage Explorer, though.

这真的很奇怪,因为我不知道对环境有任何改变.

This is really strange, because I'm not aware of changing anything to the environment.

我重新安装了 Azure SDK 2.1(2013 年 7 月).即使在干净安装后,它也不起作用.当我将云服务部署到 Windows Azure 时,它​​运行良好.在模拟器中运行它不会.

I have re-installed Azure SDK 2.1 (July 2013). Even after a clean install, it does not work. When I deploy the cloud service to Windows Azure, it works fine. Running it in the emulator doesn't.

我实际上使用与示例相同的代码进行连接,但我还是会发布它.

I actually use the same code as the samples to connect, but I'll post it anyway.

// Storage account
var storageAccount = CloudStorageAccount.Parse(
        CloudConfigurationManager.GetSetting("StorageConnectionString"));

// Blob client
var blobClient = storageAccount.CreateCloudBlobClient();

// Container
var cloudContainer = blobClient.GetContainerReference(container);
cloudContainer.CreateIfNotExists();

  • StorageConnectionString 的值为 UseDevelopmentStorage=true.
  • 容器是小写的,只能包含字母(例如图片").
  • 我以管理员身份运行 Visual Studio 2012.
  • 任何帮助将不胜感激!

    推荐答案

    您是否有机会安装昨天发布的最新版本的 Storage Client 库 (3.0.0.0)?这可能是您的代码停止工作的原因之一,因为最新版本的库不能与存储模拟器一起使用(向下滚动到这篇文章的底部:http://blogs.msdn.com/b/windowsazurestorage/archive/2013/11/27/windows-azure-storage-release-introducing-cors-json-minute-metrics-and-more.aspx).如果查看详细的错误消息,您会看到其中一个请求头无效.

    Did you by any chance install the latest version of Storage Client library (3.0.0.0) which was released yesterday? That could be one reason why your code stopped working because the latest version of library doesn't work with storage emulator (Scroll down to the bottom of this post: http://blogs.msdn.com/b/windowsazurestorage/archive/2013/11/27/windows-azure-storage-release-introducing-cors-json-minute-metrics-and-more.aspx). If you look at the detailed error message, you will see One of the request headers is invalid.

    更新:2014 年 2 月 3 日

    请下载支持最新存储客户端库的Storage Emulator 2.2.1 Preview.可以在此处找到有关此版本的更多信息:http://blogs.msdn.com/b/windowsazurestorage/archive/2014/01/27/windows-azure-storage-emulator-2-2-1-preview-release-with-support-for-2013-08-15-version.aspx.

    Please download Storage Emulator 2.2.1 Preview which has support for latest storage client library. More information about this release can be found here: http://blogs.msdn.com/b/windowsazurestorage/archive/2014/01/27/windows-azure-storage-emulator-2-2-1-preview-release-with-support-for-2013-08-15-version.aspx.

    更新:2014 年 4 月 15 日

    如果您使用的是 SDK 版本 2.3,则无需安装 Storage Emulator 2.2.1.Storage Emulator 2.3 版完全支持 Storage 客户端库 3.x.

    If you're using SDK Version 2.3, then there's no need for installing Storage Emulator 2.2.1. Storage Emulator in version 2.3 fully supports Storage client library 3.x.

    这篇关于每个请求都出现 Azure 400 错误请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆