Remote Debugging Of Web Apps On Azure

In this article we will go step by step about how we can debug a website that is hosted on Microsoft Azure using Visual Studio. For developers the debugging option is most important but if the project hosted on the cloud what we can do for solution? Microsoft Azure introduced this feature in Azure SDK 2.2 version.

Prerequisites

You will learn
  • Remote Debugging of Azure Web App.
Step 1: Create any Visual Studio project from template

Step 2: If empty project is selected please add one WebForm page in project.

Step 3: Add below code in WebForm1.aspx,

  1. <body>  
  2.   
  3. <form id="form1" runat="server">  
  4. <div>  
  5.   
  6. <asp:Button ID="btnClick" Text="Click Me" OnClick="btnClick_Click" runat="server" />  
  7. <asp:Label ID="lbl1" runat="server" />  
  8. </div>  
  9.   
  10. </form>  
  11.   
  12. </body>  
Add below code in WebForm1.aspx.cs,
  1. protected void btnClick_Click(object sender, EventArgs e)  
  2. {  
  3. string mytext = "Microsoft Azure";  
  4. lbl1.Text = mytext;  
  5. }  
Step 4: Now set the debug point on button click,



Step 5: Right click on Project name & select “Publish” option,



Step 6: Select publish target - Microsoft Azure Web Apps,



Step 7: Select existing web app from list or create new web app.



Step 8: Click on Next button,



Step 9: Change Configuration to “Debug”,



Step 10: Click on Publish button,



Wait for uploading website on azure.

Step 11: When Azure Web App will run Open “Server Explorer” from Visual Studio,



Remote debugging will add on particular web app & automatically web app will open in browser.




Congratulations! You have successfully debuged the website which is hosted on Microsoft Azure!
Read more articles on Azure:

Up Next
    Ebook Download
    View all
    Learn
    View all