I created two policies to work over the new SQL Feature to enforce AD Authentication on Azure SQL Servers.
One of them, using AuditIfNotExists effect, works fine. The other one, using DeployIfNotExists, doesn't.
I imagine the biggest challenge is to use the correct role permission, considering the DeployIfNotExists effect requires a role permission in order to create the managed identity to execute the deployment.
I chose the SQL Security Manager role, /providers/Microsoft.Authorization/roleDefinitions/056cd41c-7e88-42e1-933e-88ba6a50c9c3 . It was correctly identified on the role assignment.
I can also see the role assignment on the resource group RBAC access control.
However, the deployment requested on the effect never happens. The policy identifies the resource is not compliant, but the deployment never happens to change the property as it should.
I'm not sure what I may be missing and maybe one of the main questions is: How could I track the effect execution to identify what's wrong with this policy?