Skip to content

Latest commit

 

History

History
253 lines (127 loc) · 11.9 KB

privateendpoints.md

File metadata and controls

253 lines (127 loc) · 11.9 KB

Optional: Enable Private Endpoints

If you need to ensure that all endpoints are private, you can integrate with a virtual network and restrict access to each resource via the same VNet.

Example network:

The resources in Azure should be accessible only via private IP addresses, accessible optionally via another private, on-premises network.

Limitations

In this mode, the system does have some limitations around data collection and configuration.

  • The installer does not take into account private endpoint resources, so once an installation is converted to private endpoints, manual upgrades are needed if version updates are deployed. The manual process for installation and upgrade is documented.
  • Also, due to how calls are tracked with Graph pushing notifications to the app service, this won’t be possible with privately protected endpoint.

The lack of calls can be mitigated if the only app service has a public endpoint, but assuming that too is private, it’s impossible to receive webhook notifications from Graph API for calls and therefore we can’t log call data.

VNet Configuration

For these steps to work, we need a virtual network (VNet) pre-configured with x2 subnets – a default one and then one for app services.

A screenshot of a phone Description automatically generated

All the dependencies will use the default subnet, and the app service will integrate with a second one.

Private endpoints are created on the VNet and add DNS zones for each resource as needed, so that each service has a private, internal IP address.

Example: for App Insights, when we create the endpoint, we get a new network interface card for it with a private IP address (10.0.0.X) + a DNS “westeurope-5.in.ai.privatelink.monitor.azure.com” (same as the public address).

A blue screen with white text Description automatically generated

In this case, the browser will now route requests to the private address, will pass internally to the App Insights instance and therefore be accepted.

In our example we’re using Azure DNS, so resource name registration happens automatically.

A screenshot of a computer Description automatically generated

Your own infrastructure may have different requirements.

Important: if you have your own DNS infrastructure to integrate with, please add verification steps for each Azure service added below.

Configure Services for Private Access Only

In this guide, we assume that you have a working system created by either the installer or the manual configuration method.

App Service

Add a private endpoint so access to it is restricted. In the “networking” blade of the app service:

A screenshot of a computer Description automatically generated

https://learn.microsoft.com/en-us/azure/private-link/private-endpoint-overview

Next, we need to integrate the app service into our VNet so the web-jobs can access private resources. Back in the networking blade click “VNet integration”

A screenshot of a computer Description automatically generated

A screenshot of a computer Description automatically generated

Now, any HTTP calls from outside the private network will not arrive at the app service.

SQL Server

Restrict public access and enable a private endpoint.

A screenshot of a computer Description automatically generated

A screenshot of a computer Description automatically generated

This will create a network interface for the private endpoint:

A screenshot of a computer Description automatically generated

Select the same VNet.

A screenshot of a computer Description automatically generated

You may wish to create a specific IP address. We’re going for automatic configuration.

A screenshot of a computer Description automatically generated

Now, apps need to use this internal address to connect to any database on this server.

Redis Cache

A similar setup with Redis is needed.

https://learn.microsoft.com/en-us/azure/azure-cache-for-redis/cache-private-link

A screenshot of a computer Description automatically generated

A screenshot of a computer Description automatically generated

A screenshot of a computer Description automatically generated

Service Bus

Private endpoints and network isolation require a Premium tier service-bus. The installer creates a basic tier bus, so this needs to be upgraded first – via a “standard tier” level too.

A screenshot of a computer Description automatically generated

The service bus created by default is a basic tier one, so we need to migrate through the standard tier too:

Screens screenshot of a screenshot of a screenshot Description automatically generated

…meaning we need to create a standard tier namespace, and also a premium one.

A yellow and purple text Description automatically generated

A screenshot of a computer Description automatically generated

Once your options are configured, you can start the migration from basic to premium.

A screenshot of a computer screen Description automatically generated

Once done we can create private endpoints as before:

A screenshot of a computer Description automatically generated

As before this will create a network interface in the selected VNet + register with DNS if managed by Azure.

Storage Account

For storage, we need to configure private endpoints for table + blob services.

A screenshot of a computer Description automatically generated

Enable private endpoints for blob & table storage.

A screenshot of a computer Description automatically generated

Ensure the right sub-resource is selected.

A screenshot of a computer Description automatically generated

DNS configuration is done if managed by Azure. Manual configuration will be needed if DNS is handled by your own infrastructure.

A screenshot of a computer Description automatically generated

Repeat the same for blob storage.

Optional: Language Service

Language service is optionally used for Teams channel sentiment analysis and other areas of M365. If your configuration doesn’t include this, you don’t need to follow this step.

A screenshot of a computer Description automatically generated

Disable public access and save changes.

A screenshot of a computer Description automatically generated

There’s only one sub-resource:

A screenshot of a computer Description automatically generated

Configure how you want the endpoint to appear on the VNet:

A screenshot of a computer Description automatically generated

Specify DNS

A screenshot of a computer Description automatically generated

No changes should be needed for configuration thanks to the CNAME above mapping the public DNS to the private DNS.

Application Insights

Access to App Insights ingestion and tracking is limited via “Azure Monitor Private Link Scopes” on the “Network Isolation” blade.

A screenshot of a web page Description automatically generated

Create new:

A screenshot of a computer Description automatically generated

Add a network interface for private endpoint scope: A screenshot of a computer Description automatically generated

A screenshot of a computer Description automatically generated

Configure DNS. There are a few services that App Insights need to have DNS for:

A screenshot of a computer Description automatically generated

One the scope & endpoint are added, you can configure Application Insights to use them.

A screenshot of a computer Description automatically generated

With public-network ingestion disabled, any attempts to log data will be denied. Here’s an example response:

A computer screen shot of a program code Description automatically generated

Equally with reading the data:

A close-up of a document Description automatically generated

You can only now read/write telemetry data from a device on the same VNet.

Log Analytics

Configure the workspace in the same way as Application Insights.

A screenshot of a computer Description automatically generated

Important: if you don’t configure log analytics with the same Azure Monitor Private Link Scope, no telemetry data will be readable.

Configure App Services

Once components have been configured, the app service configuration will need to be updated.

Disable Call Imports

As public endpoints are needed for webhooks and this is precisely what we’ve disabled, we should stop the solution from even trying to setup the webhook as it will fail and generate errors.

In the app-services configuration, disable the calls import:

A screenshot of a computer Description automatically generated

Save changes.

Change SQL Connection

Changing the SQL server connection will start the web-jobs to crash as they’ll no longer be able to access SQL from the previous DNS with this error:

SqlException: Reason: An instance-specific error occurred while establishing a connection to SQL Server. Connection was denied since Deny Public Network Access is set to Yes. To connect to this server, use the Private Endpoint from inside your virtual network.

In the app services configuration, change the SQL connection DNS:

A screenshot of a computer Description automatically generated

Check app-service web job logs from a virtual machine on same VNet:

A screenshot of a computer Description automatically generated

Verify web-jobs are running:

A screenshot of a web jobs application Description automatically generated

Both web-jobs should be in the “running” state, without restarts.

Redis

Redis doesn’t require a change as a CNAME record is added so, in my example, “advanalyticsdev.redis.cache.windows.net” points to “advanalyticsdev.privatelink.redis.cache.windows.net”, which is pointed at the local VNet IP address.

This means that no changes should be needed for the app-service to work with the old, public DNS.

Service Bus

Equally the service-bus DNS should still work for the same reasons.

Power BI Service (Optional)

The Power BI service will need to access the private endpoint for SQL if you’re using PBI reports - https://learn.microsoft.com/en-us/power-bi/enterprise/service-security-private-links