Hello Aleh Kamisarau,
Thank you for posting your question in the Microsoft Q&A forum.
When you deleted the resource group, the Azure Monitor Private Link Scope (AMPLS) was deleted, but the Data Collection Endpoint (DCE) remained. The association between the AMPLS and the DCE still exists, which prevents the deletion of the DCE. Attempting to delete the association results in an error because the linked AMPLS is missing. Re-creating the AMPLS with the same name allows the deletion of the association to proceed without errors, but the orphaned association remains. This creates a situation where you have two associations with the same name but different scope IDs, and only the recently created one can be deleted.
Please verify and confirm below configurations:
Navigate to the Azure Portal and go to the Data Collection Endpoint resource.
Check the Associations tab to see the existing associations with the AMPLS.
Note the details of the orphaned association, including its scope ID.
Re-create the Azure Monitor Private Link Scope (AMPLS) with the same name as the one that was deleted, this can be done using the Azure Portal, Azure CLI, or Azure PowerShell.
Once the AMPLS is re-created, navigate back to the Data Collection Endpoint resource.
Attempt to delete the association again. This should now proceed without errors since the linked AMPLS exists. However, note that the orphaned association might still persist.
If the orphaned association still exists, you may need to use Azure CLI or Azure PowerShell to manually remove it.
After deleting the association, verify that the Data Collection Endpoint (DCE) no longer has any associations.
Once the DCE is deleted, you can delete the re-created AMPLS if it is no longer needed.
Ensure that all resources are properly cleaned up to avoid any future issues.
Some Microsoft document links for your reference:
https://learn.microsoft.com/en-us/azure/azure-monitor/logs/private-link-security
https://learn.microsoft.com/en-us/cli/azure/monitor?view=azure-cli-latest
If the above answer helped, please do not forget to "Accept Answer" as this may help other community members to refer the info if facing a similar issue. Your contribution to the Microsoft Q&A community is highly appreciated.