It’s common that a part of the data of a web page is saved in another service such as storage account or SQL server. When the website is hosted on Azure Cloud Service, when we visit the page, the w3wp process of IIS component will need to send out a request to the target remote server to read the needed data.
But when the Cloud Service fails to read the data from the remote server and developer wants to troubleshoot this issue, it will be difficult as by default users are unable to track the outbound traffic from Cloud Service to these remote servers. If user can capture trace of inbound traffic from the remote server side, it’s good as user can somehow make sure that the request from Cloud Service reaches remote server successfully and get the response code by filtering with the source IP address. But if the remote server is also a Cloud platform service, such as Azure Storage Account which will not allow user to capture network trace, it will be a big problem.
This blog will mainly talk about how to capture the outbound traffic initiated by the Cloud Service application and sent by application (w3wp process in IIS component).
In order to follow this blog, user should have already done following points:
To make this blog easier to understand, here is a short explanation of the sample project first.
This sample project is a simple MVC based webpage server project. It contains in total 3 pages, index, about and contact page. According to the controller, every time when user visits the about page, it will build connection with a remote Azure Storage Account and query some data from the Table endpoint of the Storage Account. The IP address of the remote Storage Account is 20.150.90.38.
Once the data is read from Azure Storage Account, it will insert it into the about page of the website. The text is “string to display”, and the about page will look like:
The configuration needed is as following:
<system.net>
<defaultProxy>
<proxy autoDetect="false" bypassonlocal="false" proxyaddress="http://127.0.0.1:8888" usesystemdefault="false" />
</defaultProxy>
</system.net>
Since the .Net application of Cloud Service will definitely start before user can RDP into the instance(s), as explained in the official document of Fiddler, user can only do some configuration change in order to meet the purpose. There are two possible options here but the nature of them is the same:
The WireShark (Layer 4/TCP) and Fiddler (Layer 7/HTTP) are both running and capturing the traffic. When someone visits the specified webpage (About page in this example) hosted in this Cloud Service, from WireShark trace, it’s clear that there is outgoing traffic from local (10.0.1.4) to target storage account (20.150.90.38) and the remote storage account server returns the application data to this Cloud Service instance, but there is nothing captured in Fiddler.
After the required configuration change is added/uncommented, this time, the traffic from this Cloud Service instance to target Storage Account sent by w3wp process can be successfully captured in Fiddler as well. If the decrypt HTTPS traffic feature is configured correctly (only needed when the underlying traffic from w3wp is using https protocol), when user double-clicks on the captured request, we can see the request details as normal requests sent out from browser in Fiddler.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.