Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何通过网站MVC4连接Azure blob存储_Azure_Web_Blob - Fatal编程技术网

如何通过网站MVC4连接Azure blob存储

如何通过网站MVC4连接Azure blob存储,azure,web,blob,Azure,Web,Blob,我在WindowsAzure上开发了一个网站,MVC4。我试着上传并从blob中获取照片。 我的相关代码(从web上的其他示例中获得): var storageAccount=CloudStorageAccount.Parse(ConfigurationManager.ConnectionStrings[“StorageConnection”].ConnectionString) 我的相关web.config代码: <add name="StorageConnection" connect

我在WindowsAzure上开发了一个网站,MVC4。我试着上传并从blob中获取照片。 我的相关代码(从web上的其他示例中获得):

var storageAccount=CloudStorageAccount.Parse(ConfigurationManager.ConnectionStrings[“StorageConnection”].ConnectionString)

我的相关web.config代码:

<add name="StorageConnection" connectionString="DefaultEndPointsProtocol=https;AccountName=abc;AccountKey=*******"/>

当我运行时,出现了一个格式异常。请注意,这是一个网站

根据一些帖子,当我将连接字符串放到app.config时,没有解决方案


非常感谢您的帮助

您不能使用
连接字符串
节来存储Azure存储连接字符串!
改用
appSettings
,您将不会遇到任何问题。令人困惑的是,存储凭据也被命名为“连接字符串”,但它与配置文件中的
connectionStrings
部分无关<代码>连接字符串部分仅用于数据库连接字符串。

我在web.config代码中发现了一个小错误:“AccountNam=abc;”。它应该是“AccountName=abc;”[AccountNam中缺少:“e]。这可能是原因吗?不,我在发帖时犯了复制粘贴错误。我纠正它。好的。我只是想确认一下,因为我得到了一个格式异常:)。您在代码中的什么地方得到异常?我在这一行得到异常:var storageAccount=CloudStorageAccount.Parse(ConfigurationManager.ConnectionStrings[“StorageConnection”].ConnectionString);
<add name="StorageConnection" connectionString="DefaultEndPointsProtocol=https;AccountName=abc;AccountKey=*******"/>