0
votes

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. 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:

  • My environment is Windows Server 2008 R2 running IIS 7.5
  • The service connects to the actual Azure Blob Storage in the cloud, and I can save images online (that is, I log into my account on the Azure portal and I can see the images uploaded in my test container) from my development environment (VS 2013 with IIS Express) using the Azure Development Compute/Storage Emulator from Azure SDK 3.3.
  • I cannot get the solution working on my development box(es) using IIS 7.5.
  • I have tried "Deploy" the solution from the "Build" menu in my solution, but nothing happens. Attempting to "Publish" the Cloud Service Project in my solution just takes me to Azure to publish it online. Is that what is necessary to get my solution working? Publishing the Cloud Service project?

Thanks.

2

2 Answers

0
votes

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). 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).

0
votes

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.

  1. Add your Azure Blob connection string in your Web.config file so that you can access it from your project without needing to reference the Cloud Storage Account settings (i.e., CloudConfigurationManager.GetSetting, etc.).
  2. In your Web.config file, comment out the AzureDiagnostics trace listeners:

      <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.

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.

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.