Skip to content
This repository has been archived by the owner on Oct 5, 2023. It is now read-only.

Missing Policy Definition for Management Monitor #193

Closed
benoitmonnier opened this issue Jul 4, 2023 · 3 comments · Fixed by #190
Closed

Missing Policy Definition for Management Monitor #193

benoitmonnier opened this issue Jul 4, 2023 · 3 comments · Fixed by #190

Comments

@benoitmonnier
Copy link

benoitmonnier commented Jul 4, 2023

Hello,

When I deploy policy initiatives from the json file, ALZ-MonitorManagement.json , I get the following errors:

New-AzManagementGroupDeployment : 14:10:52 - Deployment 'ALZ-MonitorManagement' failed with error(s). Displaying 1 of 1 error(s).
Status message: The 'Alerting-Management' policy set definition request is invalid. The following policy definition could not be found:
'/providers/Microsoft.Management/managementGroups/mg/providers/Microsoft.Authorization/policyDefinitions/Deploy_RecoveryVault_BackupHealth_Alert'. (Code:PolicyDefinitionNotFound)
CorrelationId: 76150c09-5594-4e2b-b82d-f072d4e9fcb1

For the other json , everything works fine

Thanks for your help

@paulgrimley
Copy link
Contributor

Hi @benoitmonnier, thank you for raising this, let me speak with one of the team to look into this and come back to you @Alboroni @arjenhuitema @jfaurskov

@jfaurskov
Copy link
Collaborator

Hi @benoitmonnier thank you for raising the issue. We are fixing this in #190, @paulgrimley FYI

@benoitmonnier benoitmonnier changed the title Mission Policy Definition for Management Monitor Missing Policy Definition for Management Monitor Jul 5, 2023
@jfaurskov jfaurskov linked a pull request Jul 5, 2023 that will close this issue
@antoniodurans
Copy link

antoniodurans commented Jul 6, 2023

I have the same error; I have the impression that it is related to the name.

alz-monitor-main> az deployment mg create --template-file ./src/resources/Microsoft.Authorization/policySetDefinitions/ALZ-MonitorManagement.json --location $location --management-group-id $pseudoRootManagementGroup

{"status":"Failed","error":{"code":"DeploymentFailed","target":"/providers/Microsoft.Management/managementGroups/ALZ/providers/Microsoft.Resources/deployments/ALZ-MonitorManagement","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"PolicyDefinitionNotFound","message":"The policy set definition 'Alerting-Management' request is invalid. The following policy definition could not be found: '/providers/Microsoft.Management/managementGroups/ALZ/providers/Microsoft.Authorization/policyDefinitions/Deploy_RecoveryVault_BackupHealth_Alert'."}]}}

image

From Portal
Definition ID: /providers/Microsoft.Management/managementGroups/ALZ/providers/Microsoft.Authorization/policyDefinitions/Deploy_RecoveryVault_BackupHealthMonitor_Alert

From ALZ-MonitorManagement.json File
"policyDefinitionId": "[concat('/providers/Microsoft.Management/managementGroups/',managementGroup().name, '/providers/Microsoft.Authorization/policyDefinitions/Deploy_RecoveryVault_BackupHealth_Alert')]",

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants