1
votes

I have an ASP.NET application that uses the DocumentDB .NET SDK (latest version v 1.10).

I am using the new local emulator.

When the app is started locally, I am not able to see the requests made by my .NET SDK to local emulator in Fiddler. However, I can see in Fiddler the requests to local emulator made by the web application "Data explorer" (shipped with Local emulator) in my browser. I can also browse in Fiddler DocumentDB requests from my locally deployed web app on a remote DocumentDB endpoint (in Azure).

I suspect there is some configs to be set in .NET SDK so that requests are intercepted by Fiddler proxy.

3

3 Answers

2
votes

We finally managed to find a solution with two things to change:

  • In documentdb client instanciation set connectionPolicy.EnableEndpointDiscovery = false; (do not push this to production)

  • And replace the documentdb endpoint url from https://localhost:8081 to https://localhost.fiddler:8081

0
votes

Are you using Direct mode while connecting to the local emulator?

Fiddler will not be able to intercept requests when using direct connectivity since it can only intercept http traffic. Changing the connection policy to gateway should allow fiddler to intercept the requests.

0
votes

You can use fiddler to see the request and response if you choose Gateway or DirectHttps mode. When you use .NET SDK, it will not automatically direct to the fiddler proxy so that you won't see your request/response automatically. You can either set the proxy in your app config

 <system.net>
    <defaultProxy>
      <proxy
        usesystemdefault="False"
        bypassonlocal="True"
        proxyaddress="http://127.0.0.1:8888"/>
    </defaultProxy>
  </system.net>

Or you can use https://localhost.fiddler, which will go through fiddler proxy so that request/reponse is captured. Note this option will make request to fail if fiddler is NOT running.