title: ASP.NET Web Forms - Deploying to Azure - "The resource you are looking for has been removed or is temporarily unavailable."
body: <p>I'm experiencing an error when I deploy my ASP.NET project to a web app service in Azure. I can't replicate it when running my code in the local development environment/web server (IIS). </p>
  
  <p>To give some background, the particular page I'm struggling with is the newest page I've added to the project; all other pages work fine. I am doing a bit of query-string passing, but even without passing the query string in the URL, I'm seeing the same error.</p>
  
  <p>Error: </p>
  
  <blockquote>
    <p>The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.</p>
  </blockquote>
  
  <p>Here's the code of the page that's not working (.aspx):</p>
  
  <pre><code>&lt;%@ Page Title="Car Photos" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CarImages.aspx.cs" Inherits="CarImages" %&gt;
  
  &lt;asp:Content ID="Content1" ContentPlaceHolderID="MainContent" Runat="Server"&gt;
       &lt;customControls:Header runat="server" heading="Car Photos"&gt;&lt;/customControls:Header&gt;
      &lt;div class="row"&gt;
  
          &lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="&lt;%$ ConnectionStrings: MYCONNSTRING %&gt;" 
              SelectCommand="SELECT CarImages.CarImage, CarImages.CarName, Cars.CarID, Cars.Model FROM CarImages INNER JOIN Cars ON CarImages.CarID = Cars.CarID WHERE (Cars.CarID = CarImages.CarID)"&gt;
                  &lt;SelectParameters&gt;
                      &lt;asp:QueryStringParameter Name="CarID" QueryStringField="CarID" Type="Int32" /&gt;
                  &lt;/SelectParameters&gt;
          &lt;/asp:SqlDataSource&gt;
  
          &lt;asp:Label ID="ErrorLabel" runat="server" Text=""&gt;&lt;/asp:Label&gt;
          &lt;br /&gt;
          &lt;br /&gt;
  
          &lt;asp:Image ID="Image1" runat="server" Height="284px" Width="432px"/&gt;
          &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
  
  
      &lt;/div&gt;
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p>... and the code behind (.aspx.cs): </p>
  
  <pre><code>public class MyClass
  {
      public string ImagePath { get; set; }
      public int Id { get; set; }
      public string Name { get; set; }
  
  }
  
  public partial class CarImages : System.Web.UI.Page
  {
      protected void Page_Load(object sender, EventArgs e)
      {
          string queryStringId = (Request.QueryString["CarID"]).ToString();
          int queryStringIdNum = Int32.Parse(queryStringId);
  
          SqlConnection con = new SqlConnection("Data Source=SECRETSERVER.database.windows.net;Initial Catalog=SECRETDB;User ID=SECRET;Password=SECRET");
          SqlCommand sql = new SqlCommand(@"SELECT CarID, CarImage, CarName FROM CarImages WHERE CarID = @queryStringIdNum", con);
          sql.Parameters.AddWithValue("@queryStringIdNum", queryStringIdNum);
  
          con.Open();
  
          //using(var command = sql)
          //{
          using (var reader = sql.ExecuteReader())
          {
              var list = new List&lt;MyClass&gt;();
              while (reader.Read())
                  list.Add(new MyClass
                  {
                      ImagePath = reader.GetString(1),
                      Id = reader.GetInt32(0),
                      Name = reader.GetString(2)
                  });
  
              bool isEmpty = !list.Any();
  
              if (isEmpty)
              {
                  ErrorLabel.ForeColor = Color.Red;
                  ErrorLabel.Text = "No images currently uploaded. Please check back later";
                  Image1.Visible = false;
              }
              else
              {
                  ErrorLabel.ForeColor = Color.Green;
                  ErrorLabel.Text = "Image found!";
                  foreach (var img in list)
                  {
                      Image1.ImageUrl = img.ImagePath;
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>I appreciate anyone with a bit of insight. I'm struggling to determine what might be causing this, since it works fine in the local webserver (i.e. building and testing from VS 2017). Thanks all!</p>