How can I access the automagically-created CLOUD_STORAGE_ACCOUNT connection string in Azure? -


when associate website storage account, connection string automatically created in configuration:

enter image description here

however, can't figure out how connection string @ runtime. old-school

configurationmanager.connectionstrings["cloud_storage_account"]

returns null, , tried (out of desperation)

cloudconfigurationmanager.getsetting("cloud_storage_account");

which, of course, didn't work it's not application setting. examples i've found have people reproducing configuration string new connection string (which can accessed first method) or app setting (accessed second).

this seems stupid. created azure, , guaranteed more correct create.

so how can aholt of "cloud_storage_account" connection string @ runtime?

edit:

i'm configuring website via portal. linked storage account under linked resources.

enter image description here

details configuring (including connection strings) here: https://www.windowsazure.com/en-us/manage/services/web-sites/how-to-configure-websites/

it's bit cryptic. but, use connection string named "cloud_storage_account" configured in azure portal, must have connection string named "cloud_storage_account" in local web.config (in connectionstrings) section. when publishing, 1 configured in portal replace 1 in web.config.

then can use configurationmanager.connectionstrings["cloud_storage_account"].connectionstring


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -