简体   繁体   中英

Getting error when trying to connect to blob storage

This is the error:

Microsoft.WindowsAzure.ServiceRuntime Information: 100 : Role environment . INITIALIZING

Microsoft.WindowsAzure.ServiceRuntime Information: 100 : Role environment . INITIALED RETURNED. HResult=-2147024894

Microsoft.WindowsAzure.ServiceRuntime Error: 102 : Role environment . FAILED TO INITIALIZE. hr: -2147024894

Getting "StorageAccountName" from ServiceRuntime: FAIL.

Getting "StorageAccountName" from ConfigurationManager: FAIL.

Getting "StorageAccountKey" from ServiceRuntime: FAIL.

Getting "StorageAccountKey" from ConfigurationManager: FAIL.

Okay what is this and how do i fix it?

Info:

MVC application with azure blob connection.

I faced the same problem.

The solution was to set the "Startup Project" to the Cloud Service (little cloud icon) and not the website.

Doing this meant that Visual Studio deployed the cloud configuration to the compute emulator when I started the debugger. Previously, I had the website as the startup project.

The clue was the -2147024894 error message (aka 0x80070002) - File not found.

You can run your website even outside the local cloud service. The key is simply to have the values on the web.config of your application.

So in your case simply add the values for "StorageAccountName" and "StorageAccountKey" as AppSettings and CloudConfiguration.GetSetting will find them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM