Share via

Azure Policy to Auto Associate Resources to NSP

Tapasya Sharma 0 Reputation points Microsoft Employee
2026-03-02T18:14:59.0966667+00:00

I have a created an Azure Policy to Auto Associate Resources to NSP in Enforced mode once any new resources are created in my subscription. However, upon assigning this policy to my subscription all my resources are non-compliant, and new resources I create are not compliant by the policy either by auto-associating. I created a remediation task with and without 'ResourceDiscoveryMode' set to 'ReEvaluateCompliance. However, I continue to get this error saying there is no evaluation from the policy. Could you please help identify the issue here and correct it to auto associate any resources in enforced mode?

Expected behaviour:

Is to auto associate any new resources created to PPE NSP in enforced mode and pass compliance with existing resources by remediating.

Existing behaviour:

  1. Unable to auto associate any new resources created
  2. Unable to pass compliance even though existing resource association to NSP exists
  3. Remediation tasks fail even 'ResourceDiscoveryMode' set to 'ReEvaluateCompliance'
  4. NoPolicyEvaluationResult deployment error received

Policy definition:

  <PII Removed>

Deployment error:

User's image

Azure Policy
Azure Policy

An Azure service that is used to implement corporate governance and standards at scale for Azure resources.


1 answer

Sort by: Most helpful
  1. Suchitra Suregaunkar 11,395 Reputation points Microsoft External Staff Moderator
    2026-03-03T01:27:55.79+00:00

    Hello Tapasya Sharma

    Thanks for sharing the screenshot.

    Error code: NoPolicyEvaluationResult

    This error occurs when you try to run Policy Remediation, but Azure Policy has no current compliance evaluation data for the targeted resources.

    Remediation can only run on resources that already have a compliance state. If no evaluation result exists, remediation fails.

    One or more of the following is true for the error that you got:

    1. Policy was recently created, updated, or reassigned

    • Compliance scan hasn’t run yet.

    2. Policy exclusions or scope were changed

    • Old compliance data became invalid.
    1. Resources were created before the policy existed
    • They were never evaluated.
    1. Compliance data was cleared or expired
    • Happens after policy definition/assignment changes.

    As a resolution you must force a policy compliance re‑evaluation first, then rerun remediation.

    Option 1: Re‑evaluate compliance (Portal – Recommended)

    1. Go to Azure Portal
    2. Navigate to Azure Policy
    3. Select Compliance
    4. Click Re-evaluate compliance
    5. Wait until the policy shows a Non-compliant or Compliant state
    6. Retry Remediation

    Option 2: Re‑evaluate compliance using CLI command,

    az policy state trigger-scan
    

    Then rerun the remediation once compliance data appears.

    Option 3: Delete and recreate remediation task

    If re‑evaluation does not help:

    1. Delete the existing remediation task
    2. Ensure the policy assignment still exists and scope is correct
    3. Trigger Re-evaluate compliance
    4. Create a new remediation task

    Remediation cannot create compliance data, Compliance must exist before remediation, Compliance evaluation is not instantaneous. Any change to policy definition, scope, or exclusions invalidates prior results.

    Thanks,
    Suchitra.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.