Diana Bele
Independent Consultancy
This playbook guides the Engineering and DevOps teams to identify and clean-up unused Azure Private Links & Services. Unused Azure Private Links are private links that aren’t used in a running deployment.
Although Microsoft doesn’t charge for the service, it’s best to remove Azure private links that are no longer being used and have no private endpoints attached to them in order to reduce the number of running services that an organization is actively maintaining to the ones it is actually using; thus, helping reduce the attack surface and make efficient use of cloud inventory.
We acknowledge that the specific instructions to perform this activity may change over time as Azure rolls out new features, pricing models, user interfaces, etc. and have tried to link out to relevant Azure provided documentation where possible to help this document stay relevant over time.
The insights, instructions, and resources provided herein, in combination with those available direct from Azure should help individuals have a more complete understanding of this action as it pertains to FinOps and usage optimization.
Any persona that has owner or contributor access to an Azure subscription.
To effectively use this playbook you must be running Azure Subscription with proper billing details, Azure PaaS services (Azure SQL, Storage, Monitoring) with private endpoint enabled.
Below is important to the success of running this play:
Links to tools, utilities and templates to use during the playbook.
Who: FinOps Analyst
What: Conduct assessment on Azure Private Link service using Azure portal to enable Monitoring, identify unused Azure Private Link, Post approval from your organization perform clean-up using the change management process (using IaC or Manual depending on organization strategy.
Source: Manage Azure Private Endpoints
If you haven’t already, enable Diagnostics within Azure Monitor for Private Link services. This will allow you to collect relevant telemetry data. You can configure this through the Azure Portal or by using Azure PowerShell or Azure CLI.
If you don’t have one already, create a Log Analytics workspace in Azure. This workspace will be used to store and analyze the monitoring data.
Configure Diagnostics within Azure Monitor to send data to your Log Analytics workspace. Query Log Analytics for Private Link Usage using the below query which retrieves heartbeats related to Private Link services and their associated network interfaces:
| where ResourceProvider == “MICROSOFT.NETWORK” and Resource == “PRIVATELINKSERVICES” and ResourceType == “NETWORKINTERFACE”
| project PrivateLinkServiceName, ResourceId, TimeGenerated
Analyze the query results to identify Private Link services that have not been used for a significant period. It’s crucial to exercise caution in this process, considering potential implications for connectivity.
You may want to set a lengthy time frame to avoid accidentally removing necessary connections that happen infrequently. Doing so ensures that the FinOps initiative maintains credibility and doesn’t disrupt essential operations.
Additionally, it’s advisable to seek consensus and provide the data to relevant stakeholders, such as engineers and business units, before considering any removal actions. Unused Private Link services may lack recent heartbeat entries, indicating they haven’t been actively used. Compile a report detailing these findings, highlighting potential areas for cost optimization while prioritizing operational stability.
Once you’ve identified the unused Private Link services, you can take the necessary actions to delete them.
Note: Private links should be removed via the same method they were deployed (IaC or manual). This should take about 10 minutes.
Unused Azure Private Links that aren’t used in a running deployment will be identified and deleted to reduce the number of resources that are no longer being actively used. This benefits organizations by reducing the number of running services which require maintenance and thus helping reduce its attack surface and making for a more efficient use of cloud inventory. Additionally, this activity helps with:
Number of unused private links reduced: the number of items that have been deleted as part of this exercise.
It is possible that some of these resources are being kept around as idle in order to be used in the future – Informed ignore of the unused Azure Private Links with the added labeling that – although unused now – They will be re-utilised at a later stage in the future.
https://www.finops.org/framework/phases/
Offers resources and community support for adopting FinOps best practices, focusing on cost management and optimization in the cloud. FinOps Foundation
We’d like to thank the following people for their work on this Playbook:
We’d also like to thank our supporters, Dusty Bowling, Brian Robbins, and Noel Crowley.