Azure 400 Bad Request on every request - c#

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.
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();
Value of StorageConnectionString is UseDevelopmentStorage=true.
Container is lowercase, letters only (e.g. 'pictures').
I run Visual Studio 2012 as administrator.
Any help would be much appreciated!

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.
UPDATE: 03-Feb-2014
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.
UPDATE: 15-Apr-2014
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.

I had the same problem with Azure Storage Emulator 3.0.0 which came from Azure SDK 2.3 on VS 2013 update 2.
To solve the problem I started the Web Platform Installer and searched for Storage Emulator then ran the Azure SDK 2.3 (VS2013) and it installed Storage Emulator 3.2.0.0 which fixes the problem.

Related

The C# code running on Mac OS by Visual Studio 2019 for Mac is unable to write and read to/from the local Azure Storage Account Emulator

I used the following two connection strings in appsettings.json file to read and write from/to Azure Storage Emulator installed on my Mac machine:
"ConnectionString":"UseDevelopmentStorage=true"
And
"ConnectionString":"DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;
AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;
BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;
QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;"
As a background, I installed Visual Studio 2019 for Mac on a fresh Mac machine. I guess Visual Studio 2019 for Mac must already have been shipped with the emulator. The Mac's operating system is macOS Catalina Version 10.15.6.
The problem that I am facing is that I am totally unable to have blobs written to, or read from the emulator and I keep getting connection refused error message. This issue keeps happening despite Microsoft Azure Storage Explorer installed on the Mac machine communicates with the emulator successfully, displays all blobs, writes and reads to/from the storage.
What is missing in my connection string configuration or what else I'm supposed to do on my Mac machine to have the C# code read and write from/to the storage emulator.
The Azure Storage Emulator only works on Windows and is being deprecated. Other platforms use Azurite, but the integration for it with Visual Studio is incomplete, so you have to run it manually:
https://github.com/Azure/Azure-Functions/issues/1343#issuecomment-678536378
This was all found with 5 minutes of consulting MSDN and using Google.

Azure App Services isn't available

I've been trying to use Azure as Mobile App service and in the tutorial it is given to choose this :
Whilst when i try to follow it shows this :
Can anyone help ? Thank you :)
The Azure Visual Studio tooling, however, should be upgraded to version 2.8.1 or later...
https://azure.microsoft.com/en-us/downloads/
https://azure.microsoft.com/en-us/documentation/articles/app-service-api-whats-changed/
As Thiago suggested, you will have to install the latest Azure SDK to get the option.
If not, then you can select the Import option. This will require you to provide the publishsettings file.
You can download the publishsettings file from the Azure Portal. Here is a sample image: http://i.stack.imgur.com/YV2OQ.jpg
Once you have imported it, the IDE will pick the deployment endpoints from the file and you will be able to publish the App.
NOTE: Mobile Apps have the same deployment as the Web Apps. The IDE doesn't have the tooling to pick Mobile APPS from the subscription. Until then you will have to use the Import option in the VS deployment wizard.

Could not get the Microsoft Azure storage account settings

I'm trrying to publish an ASP.NET MVC project to azure.
In other computer i do this without problems, but in mine I don't.
The following error appears when publishing in Visual Studio 2013 :
Could not get the Microsoft Azure storage account settings for
'account-name' needed to configure an application module.
Please check your network connection and verify that the account exists.
Is your project using Azure SDK 2.6 but you also have Azure SDK 2.7 installed? I had the same error and upgrading my cloud project to Azure SDK 2.7 seemed to fix it.

Azure Blob Storage Emulator Error [duplicate]

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.
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();
Value of StorageConnectionString is UseDevelopmentStorage=true.
Container is lowercase, letters only (e.g. 'pictures').
I run Visual Studio 2012 as administrator.
Any help would be much appreciated!
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.
UPDATE: 03-Feb-2014
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.
UPDATE: 15-Apr-2014
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.
I had the same problem with Azure Storage Emulator 3.0.0 which came from Azure SDK 2.3 on VS 2013 update 2.
To solve the problem I started the Web Platform Installer and searched for Storage Emulator then ran the Azure SDK 2.3 (VS2013) and it installed Storage Emulator 3.2.0.0 which fixes the problem.

Executing windows azure web job

I create a small .exe that updates some tables in my database also create in azure, but all the times that I upload the .zip file required shows this error
Reading blogs I realized that some people are using the windows azure web job sdk, to upload their projects, it is worth to point it out that this library doesn't have a version for Visual Studio 2010, so it can't be used.
Is the use of the aforementioned sdk the only way to create and use console application web jobs?
Usually you get the failed to upload job error if the zip file does not have the job exe in the root folder.
This often happens when you zip the Debug/Release folder instead of its contents.
You don't have to use the Azure WebJobs SDK for your job. Any console application will work.
sdk the only way ...
No, WebJobs can run without the cloud SDK. To quote Hanselman
You don't have to use the WebJobs SDK with the WebJobs feature of
Windows Azure Web Sites.
As to what the exact problem is...with VS2010 and Azure that is hard to say with what you have presented.
WebJobs, since it sits on top of the Azure Web Sites service, it supports everything the Web Sites support. Including: python, php, bash, powershell, node.js, .net, cmd, bat, etc...

Categories