Hi @Andrew Gibson,
If you attempt to create a private endpoint for a Log Analytics workspace using an ARM or Bicep template that points directly to the workspace, you may encounter the below error message.
Subscription /subscriptions/xxxxxxxxxx-xxxxxx-xxxx-xxxxxxxxx/resourceGroups//providers/Microsoft.Network/subscriptions/ is not registered for feature Microsoft.Network/AllowPrivateEndpoints required to carry out the requested operation
This means you cannot configure a private endpoint directly to a Log Analytics workspace.
To resolve this issue, you need to use an Azure Monitor Private Link Scope. I tested this in my lab through the portal, and it works correctly using the Azure Monitor Private Link Scope.
This is the correct approach when configuring via any code (such as Bicep or ARM templates) as well.
Below is the Bicep code to create a private endpoint.
This is a partial snippet for the resource type Microsoft.Network/privateEndpoints
.
resource reslawPrivateEndpoint 'Microsoft.Network/privateEndpoints@2021-05-01' = {
name: 'law-privendpoint'
location: parLocation
properties: {
privateLinkServiceConnections: [
{
name: 'law-PrivateEndpoint-PrivateLinkConnection'
properties: {
privateLinkServiceId: resAMprivateLinkScope.id
groupIds: [
'azuremonitor'
]
}
}
]
subnet: {
id: resExistingSubnetForprivateEnpoint.id
}
}
}
I hope this is helpful! Do not hesitate to let me know if you have any other questions.
I really appreciate your feedback. It’s valuable to us. Please click Accept Answer on this post to assist other community members facing similar issues in finding the correct solution.