Hello @Rihards Nikitins
Thank you for providing the bicep code and insights into what you have done so far. Looking at the code I have identified the issue on line 253:
privateLinkServiceId: resLogAnalyticsWorkspace.id
This is part of the code for the resource type Microsoft.Network/privateEndpoint
resource reslawPrivateEndpoint 'Microsoft.Network/privateEndpoints@2021-05-01' = {
name: 'law-privendpoint'
location: parLocation
properties: {
privateLinkServiceConnections: [
{
name: 'law-PrivateEndpoint-PrivateLinkConnection'
properties: {
privateLinkServiceId: resLogAnalyticsWorkspace.id
groupIds: [
'azuremonitor'
]
}
}
]
subnet: {
id: resExistingSubnetForprivateEnpoint.id
}
}
}
As you can see, the code is refering to the workspace resource id, which is incorrect and should be referencing the Azure Monitor Private Link Resource Id as per the documentation. A quick deployment of a private link for AMPLS (for those who have never done it before, the guide can be found here) and a review of the deployment template confirmed my suspicions that line 253 should in fact be:
privateLinkServiceId: resAMprivateLinkScope.id
I've deployed this in my environment, and everything deploys and works as expected. Here is a copy of the updated template 265451-template.txt.
As for the original error. I am honestly not sure why it was coming up with "Feature not registered", but as the deployment showed me in the portal the exact resource it was failing on, it was quick enough to identify the problem.
I hope this helps provide you with the information you need. If it does, please make sure to mark the question as answered so it helps other people in future.
Kind regards
Alistair