title: Image upload not working on Azure Storage
body: <p>I have just deployed my c# web application to windows azure. Image upload works fine on my local machine however now the website has been deployed the image upload doesn't work with azure storage. I just recieve an error saying <code>Error. An error occurred while processing your request.</code> When trying to upload an image.</p>
  
  <p>Any help would be grateful.</p>
  
  <p><strong>Image Upload Controller</strong></p>
  
  <pre><code>public ActionResult Create(UserprofileImage userprofileimage, HttpPostedFileBase file)
          {
              if (ModelState.IsValid)
              {
                  if (file != null)
                  {
                      var manager = new UserManager&lt;ApplicationUser&gt;(new UserStore&lt;ApplicationUser&gt;(new ApplicationDbContext()));
                      var currentUser = manager.FindById(User.Identity.GetUserId());
                      file.SaveAs(HttpContext.Server.MapPath("~/Images/")
                                                            + file.FileName);
                      userprofileimage.userImagePath = file.FileName;
                      userprofileimage.UserId = currentUser.Id;
                      userprofileimage.current = 1;
                      db.UserprofileImages.Add(userprofileimage);
                      db.SaveChanges();
                      var userimage = db.UserprofileImages.Where(u =&gt; u.UserId == currentUser.Id &amp;&amp; u.Id != userprofileimage.Id).ToList();
                      foreach(var item in userimage)
                      {
                          item.Id = 0;
                          db.SaveChanges();
                      }
  
                      return RedirectToAction("Index", "Profile");
                  }
  
  
              }
  
              return View(userprofileimage);
          }
  </code></pre>
  
  <p>** Image Upload HTML **</p>
  
  <pre><code>@using (Html.BeginForm("Create", "UserprofileImage", null, FormMethod.Post,
                                new { enctype = "multipart/form-data" }))
  {
      @Html.AntiForgeryToken()
  
      &lt;div class="form-horizontal"&gt;
  
          &lt;hr /&gt;
          @Html.ValidationSummary(true)
  
          &lt;div class="form-group"&gt;
              &lt;div class="control-label col-md-2"&gt;
                  Profile Image
              &lt;/div&gt; 
              &lt;div class="col-md-10"&gt;
                  &lt;input id="userImagePath" title="Upload a profile picture"
                         type="file" name="file" /&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div class="form-group"&gt;
              &lt;div class="col-md-offset-2 col-md-10"&gt;
                  &lt;input type="submit" value="Create" class="btn btn-default" /&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  }
  </code></pre>