> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# What is Service Endpoint

> Azure service endpoints provide secure direct VNet connectivity to Azure services, routing traffic over Microsoft backbone and enabling subnet level access control versus public internet

[Service endpoints](https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-service-endpoints-overview) provide secure, direct connectivity between your virtual network (VNet) and supported Azure services. Instead of routing traffic over the public internet, requests travel across the Microsoft backbone network — improving performance and security. Service endpoints also let the target service see requests as originating from your subnet's identity, so you can restrict access at the VNet or subnet level rather than by individual VM private IPs.

For example, when a VM in your subnet accesses an Azure Storage account, packets do not leave Microsoft's network.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/JJJT303TRGQwcVP2/images/AZ-700-Designing-and-Implementing-Microsoft-Azure-Networking-Solutions/Explain-Virtual-Network-Service-Endpoints/What-is-Service-Endpoint/azure-service-endpoints-virtual-network-diagram.jpg?fit=max&auto=format&n=JJJT303TRGQwcVP2&q=85&s=db20a27d768bdf63c94e5acc0b6704f6" alt="The image illustrates a diagram explaining Microsoft Azure service endpoints, highlighting secure connectivity and optimal routing for Azure services through a virtual network." width="1920" height="1080" data-path="images/AZ-700-Designing-and-Implementing-Microsoft-Azure-Networking-Solutions/Explain-Virtual-Network-Service-Endpoints/What-is-Service-Endpoint/azure-service-endpoints-virtual-network-diagram.jpg" />
</Frame>

In the diagram above a VM (10.1.1.4) accesses a Storage account. With a configured service endpoint, traffic to the Azure service is routed over the Microsoft backbone. The Storage account’s firewall can be configured to allow only the VNet, a specific subnet, or on-premises NAT IPs — because you authorize the virtual network or subnet, not the VM’s private IP — and you can block internet access completely.

Below is a step-by-step demonstration of adding a service endpoint and verifying the result.

## Test environment (portal resources)

I used the Azure portal to deploy a VM and a Storage account. The resource group lists both resources and related networking components.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/JJJT303TRGQwcVP2/images/AZ-700-Designing-and-Implementing-Microsoft-Azure-Networking-Solutions/Explain-Virtual-Network-Service-Endpoints/What-is-Service-Endpoint/azure-portal-rg-az700-resources.jpg?fit=max&auto=format&n=JJJT303TRGQwcVP2&q=85&s=111f9e2731a8badb7018a8a71b4362d1" alt="This image shows a Microsoft Azure portal page for a resource group named &#x22;rg-az700-service-endpoints,&#x22; listing various resources such as storage accounts, network interfaces, and virtual machines, all located in East US." width="1920" height="1080" data-path="images/AZ-700-Designing-and-Implementing-Microsoft-Azure-Networking-Solutions/Explain-Virtual-Network-Service-Endpoints/What-is-Service-Endpoint/azure-portal-rg-az700-resources.jpg" />
</Frame>

The Storage container named `data` currently allows anonymous (public) access. I uploaded images to that container and can access a blob directly via its URL.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/JJJT303TRGQwcVP2/images/AZ-700-Designing-and-Implementing-Microsoft-Azure-Networking-Solutions/Explain-Virtual-Network-Service-Endpoints/What-is-Service-Endpoint/azure-portal-storage-account-blob.jpg?fit=max&auto=format&n=JJJT303TRGQwcVP2&q=85&s=824f2d896db8448b1bbb12e276e2de54" alt="The image shows a Microsoft Azure portal interface displaying a storage account with one container named &#x22;data,&#x22; which has a Blob access level and is available." width="1920" height="1080" data-path="images/AZ-700-Designing-and-Implementing-Microsoft-Azure-Networking-Solutions/Explain-Virtual-Network-Service-Endpoints/What-is-Service-Endpoint/azure-portal-storage-account-blob.jpg" />
</Frame>

To verify connectivity from inside the VNet, I SSH into the VM and curl the blob URL. This demonstrates access before applying any network restrictions.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/JJJT303TRGQwcVP2/images/AZ-700-Designing-and-Implementing-Microsoft-Azure-Networking-Solutions/Explain-Virtual-Network-Service-Endpoints/What-is-Service-Endpoint/azure-portal-virtual-machines-linux.jpg?fit=max&auto=format&n=JJJT303TRGQwcVP2&q=85&s=ec815f0aec2fbf512de5f0cd4c82cb95" alt="The image shows the Microsoft Azure portal interface displaying a list of virtual machines, with one VM named &#x22;vm-service-endpoints&#x22; that is running Linux in the East US region." width="1920" height="1080" data-path="images/AZ-700-Designing-and-Implementing-Microsoft-Azure-Networking-Solutions/Explain-Virtual-Network-Service-Endpoints/What-is-Service-Endpoint/azure-portal-virtual-machines-linux.jpg" />
</Frame>

```bash theme={null}
kodekloude@vm-service-endpoints:~$ curl https://sanavidm.blob.core.windows.net/data/gl2.jpeg
Warning: Binary output can mess up your terminal. Use "--output -" to tell
Warning: curl to output it to your terminal anyway, or consider "--output `FILE`"
Warning: to save to a file.
kodekloude@vm-service-endpoints:~$
```

## Restricting the Storage account to a VNet/subnet (enable service endpoint)

1. Open the Storage account in the Azure portal and go to Networking.
2. Change **Public network access** from “All networks” to **Selected networks**.
3. Under Virtual networks, click **Add existing virtual network** (or Add), then choose:
   * Subscription
   * Virtual network
   * Specific subnet where your VM runs
4. Save the configuration.

When you add the subnet, the Azure portal often enables the `Microsoft.Storage` service endpoint for that subnet automatically. You can also enable service endpoints directly on the virtual network > Subnets blade.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/JJJT303TRGQwcVP2/images/AZ-700-Designing-and-Implementing-Microsoft-Azure-Networking-Solutions/Explain-Virtual-Network-Service-Endpoints/What-is-Service-Endpoint/azure-portal-storage-account-details.jpg?fit=max&auto=format&n=JJJT303TRGQwcVP2&q=85&s=f204bfc39e28c44a3c5b75a9b5918d94" alt="The image shows the Microsoft Azure portal interface displaying the details of a storage account named &#x22;sanavidm.&#x22; It includes information about resource group, location, subscription, performance, replication, and several properties related to security and networking." width="1920" height="1080" data-path="images/AZ-700-Designing-and-Implementing-Microsoft-Azure-Networking-Solutions/Explain-Virtual-Network-Service-Endpoints/What-is-Service-Endpoint/azure-portal-storage-account-details.jpg" />
</Frame>

Choose your subscription, the virtual network, and the specific subnet where the VM runs; then click Add and Save.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/JJJT303TRGQwcVP2/images/AZ-700-Designing-and-Implementing-Microsoft-Azure-Networking-Solutions/Explain-Virtual-Network-Service-Endpoints/What-is-Service-Endpoint/azure-portal-network-access-settings-screenshot.jpg?fit=max&auto=format&n=JJJT303TRGQwcVP2&q=85&s=9fdf14da7921ff76464b78a08f8f7135" alt="The image is a screenshot of a Microsoft Azure portal page showing network access settings, including options for enabling or disabling public network access. There is also a side panel open for adding networks with fields for subscription, virtual networks, and subnets." width="1920" height="1080" data-path="images/AZ-700-Designing-and-Implementing-Microsoft-Azure-Networking-Solutions/Explain-Virtual-Network-Service-Endpoints/What-is-Service-Endpoint/azure-portal-network-access-settings-screenshot.jpg" />
</Frame>

<Callout icon="lightbulb" color="#1CB2FE">
  After enabling a service endpoint, propagation can take up to 15 minutes. During this time access behavior may not change immediately.
</Callout>

## Verify access after applying the restriction

After saving and waiting for propagation, public (browser) access to the blob will be denied (authorization failure). However, a VM in the authorized subnet will continue to reach the Storage account over the Microsoft backbone.

From the same VM after enabling the Storage account to allow only the selected VNet/subnet:

```bash theme={null}
# From the same VM after enabling the storage account to allow only the selected VNet/subnet
kodekloude@vm-service-endpoints:~$ curl https://sanavidm.blob.core.windows.net/data/gl2.jpeg
Warning: Binary output can mess up your terminal. Use "--output -" to tell
Warning: curl to output it to your terminal anyway, or consider "--output `FILE`"
Warning: to save to a file.
kodekloude@vm-service-endpoints:~$
```

This confirms the Storage account sees the request as coming from your VNet/subnet and that traffic stays on Microsoft’s internal network.

## Implementation notes and caveats

* Enabling a service endpoint injects system routes and configures Azure’s internal routing so traffic to the supported service is routed over the Microsoft backbone instead of the public internet.
* DNS resolution for the service FQDN still returns a Microsoft public IP. The VM uses its private IP to connect, but the destination IP is a Microsoft-owned public IP; on-premises clients will still see a public endpoint unless you supplement with NAT/DNS or more advanced routing.
* Service endpoints authorize a VNet/subnet identity to the service — you do not authorize individual VM private IPs.
* For strict private connectivity (FQDN resolves to a private IP within your VNet) and full private-to-private resolution, use Azure Private Endpoint (Private Link). Private Endpoints assign private IPs in your VNet and integrate with private DNS.

## Quick comparison

| Feature                                        | Service Endpoint | Private Endpoint (Private Link)  |
| ---------------------------------------------- | ---------------- | -------------------------------- |
| Traffic stays on Microsoft backbone            | Yes              | Yes                              |
| Service FQDN resolves to public IP             | Yes              | No — resolves to private IP      |
| Requires subnet/VNet authorization             | Yes              | Yes — plus private IP assignment |
| Best for strict private access and private DNS | No               | Yes                              |

Service endpoints are a simple and effective way to secure PaaS access from VNets. For scenarios that require full private addressing and private DNS resolution, prefer Private Endpoint.

## Links and references

* [Azure Virtual Network service endpoints overview](https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-service-endpoints-overview)
* [Azure Storage network security (service endpoints)](https://learn.microsoft.com/en-us/azure/storage/common/storage-network-security?tabs=azure-portal#service-endpoints)
* [Azure Private Link / Private Endpoint overview](https://learn.microsoft.com/en-us/azure/private-link/private-endpoint-overview)

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/az-700-designing-and-implementing-microsoft-azure-networking-solutions/module/eaba2742-d4a4-4233-8056-b3eaec8692a5/lesson/5a426397-3c8b-4ae7-98a8-53b0dc0f0aef" />
</CardGroup>
