# One line of code. Seven stops.

> What really happens between await http.GetAsync(...) and the JSON landing back in your app.

- **Format:** short video, 13 steps, ~64 seconds
- **Topic:** What actually happens when your app calls an Azure API with an HTTP client — DNS, the TLS handshake, Front Door, App Service, the Entra ID token, Azure SQL and the trip home, timed stop by stop.
- **Author:** Suthahar Jegatheesan (MSDEVBUILD)
- **Category:** Azure · Azure
- **Published:** 2026-08-11
- **Tags:** azure, dotnet, httpclient, webdevelopment, api, azureappservice, systemdesign, backenddeveloper, cloudcomputing, microsoftazure, csharp, performance, az204, msdevbuild
- **Canonical URL:** https://blog.msdevbuild.com/shorts/azure-http-request-journey/

---
## What you'll learn

- The seven stops every HTTP call to an Azure API makes, and what each one costs
- Why the first call is slow: 100 of the 160 ms is DNS and the TLS handshake, before your code runs
- Why new HttpClient() in a loop pays that cost forever, and IHttpClientFactory pays it once

## Understand it one step at a time

### 1. One line of code

You call an API with one line of code and get JSON back. Between those two moments, seven separate hops actually happen.

### 2. Stop 1 — Azure DNS

Your code calls a hostname. The internet routes on IP addresses. Azure DNS resolves one into the other before anything else can happen.

### 3. Stop 2 — the TLS handshake

Before a single byte of your actual request moves, client and server negotiate a cipher suite and swap certificates — a full round trip.

### 4. Stop 3 — Azure Front Door

Your request arrives at the nearest Azure Front Door edge point of presence, gets WAF-checked for anything nasty, then routes inward.

### 5. Stop 4 — App Service runs your code

Finally, your controller method runs on App Service. This is the only part most people picture when they think 'my API' — 5 ms of 160.

### 6. Stop 5 — a token from Entra ID

Your API needs to prove its own identity to the database. A managed identity token comes from Entra ID — no password in the chain at all.

### 7. Stop 6 — Azure SQL

The bit you actually asked for: one indexed query, travelling over the private network inside Azure, never touching the public internet.

### 8. Stop 7 — the trip home

The JSON response retraces the same seven stops in reverse, and your original await call finally returns to your code.

### 9. The whole trip, 160 ms

Seven stops end to end, every one of them doing real work you never see in the stack trace. Now look at what each one actually cost.

### 10. Where the time actually went

DNS, TLS and Front Door together were about two thirds of the 160 ms. Your controller code itself was 5 ms of the total.

### 11. Now call it a second time

Same code, same server, same endpoint. But the resolved address, the open TLS connection and the cached token are all still warm.

### 12. The one-line bug that undoes it

new HttpClient() instantiated inside a method throws all of that caching away — and pays the DNS and TLS tax again on every single call.

### 13. Now you know what await really costs

Next time an API call feels slow, you can name the exact stop — DNS, TLS, edge, compute, identity, database — instead of just guessing.

---

## The takeaway

**One line of code. Seven stops.**

Most of a slow API call is spent before your code runs — and almost all of that is reusable.
