@Inbal Silis , Please note that the deployment to new resource being created, does not happen through "remediation task". Remediation task is only used to remediate existing resources or such resources for which deployment could not be done through DeployIfNotExists effect, after they were marked non-compliant.
The deployment through Azure Policy's DeployIfNotExists
depends on EvaluationDelay property. It is optional and in the absence of this property a delay of 10 minutes is considered for evaluation and deployment. One of the reasons for the deployment to not have taken in effect is that you are checking the resource right after creation. In the absence of EvaluationDelay property, it will take atleast 10 minutes (default) for the deployment to start.
Another case could be that the policy was saved/assigned at Management Group scope. In such a case, the identity associated with the deployment template does not get the correct permission associated with it OR that the permission could not be granted when the policy was being assigned (due to lack of permission of the policy assigner). The evaluation works but it would put the resources in non-compliant state and a manual remediation task is required to remedy them.
Please check if the scenario falls under either of the 2 criteria.
If the answer did not help, please add more context/follow-up question for it, and we will help you out, else please click Accept answer so that it can help others in the community looking for help on similar topics.