[英]Access Azure Blob Storage from on-premises IIS application
I have an on premises .NET/IIS application for which I have developed new functionality to allow users to upload images to Azure Blob Storage. 我有一个本地.NET / IIS应用程序,为此我开发了新功能,以允许用户将图像上传到Azure Blob存储。 Everything works fine in my development environment, and now I am ready to deploy this application on premises to my production environment.
一切在我的开发环境中都可以正常工作,现在我可以将该应用程序在本地部署到生产环境中了。
I can't figure out how to do this. 我不知道该怎么做。 Is it possible?
可能吗? If so, how do I do this?
如果是这样,我该怎么做?
A little more detail: 更多细节:
Thanks. 谢谢。
If all you have is a web application that you are deploying on-premises, you should not be using a Cloud Service project (which is a project that is ultimately deployed as an Azure Cloud Service). 如果仅拥有要在本地部署的Web应用程序,则不应使用Cloud Service项目(该项目最终将作为Azure Cloud Service部署)。 If you want the blob uploads to occur on the web server, you just need to add the Azure Storage NuGet package to your web project and use the storage libraries to upload the blobs (assuming you already have code like this somewhere since you say things are working on your dev box).
如果要在Web服务器上进行Blob上传,则只需将Azure Storage NuGet程序包添加到Web项目中,然后使用存储库上传Blob(假定您已经在某处拥有这样的代码,因为您说的是在您的开发箱上工作)。
I think the answer to my question is basically to ignore the cloud service project entirely and just deploy the underlying website as you would ordinarily deploy it, with two minor modifications. 我认为,我的问题的答案基本上是完全忽略云服务项目,仅按常规部署基础站点的方式进行部署,但有两个较小的修改。
In your Web.config file, comment out the AzureDiagnostics trace listeners: 在您的Web.config文件中,注释掉AzureDiagnostics跟踪侦听器:
<listeners> <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics"> <filter type="" /> </add>
Using these two modifications, I was able to deploy my underlying website to my local IIS while still accessing Azure Blob Storage from my on-premises solution. 使用这两个修改,我能够将基础网站部署到本地IIS,同时仍然可以从本地解决方案访问Azure Blob存储。
I am still not entirely sure whether I ever even needed or still need the Cloud Services project in my solution at all, but I am keeping it there for now. 我仍然不确定我的解决方案中是否需要甚至根本不需要Cloud Services项目,但是我现在将其保留在那里。
Hopefully, this question/answer will help somebody else searching for documentation on a hybrid on-premises and Azure solution since there really seems to be almost nothing out there on this subject. 希望这个问题/答案可以帮助其他人搜索有关混合本地和Azure解决方案的文档,因为关于该主题实际上似乎几乎没有任何东西。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.