An Azure service that is used to implement corporate governance and standards at scale for Azure resources.
Hello D-J, You are trying to update or delete Azure Policy attestations after they have expired. The same PowerShell commands and REST calls work correctly for non‑expired attestations, but once an attestation is expired:
-
Set-AzPolicyAttestationreturns BadRequest -
Remove-AzPolicyAttestationshows no error, but the attestation remains -
Invoke-AzRestMethod -Method DELETEreturns 200 OK, but the attestation is not removed
Look like you want to clean up expired attestations, but none of the supported methods actually remove them.
Once an attestation reaches its expiresOn date, Azure Policy treats it as immutable historical evidence:
- Expiry affects policy compliance evaluation only
- The attestation resource itself becomes read‑only
- Any attempt to:
- Change
ComplianceState - Extend
ExpiresOn - Delete the attestation is rejected or silently ignored by the backend
- Change
This explains why updates return 400 BadRequest and deletes return success, but do nothing
This behavior is different from Policy Exemptions, which can be deleted after expiry.
Expired attestations no longer affect compliance. You can safely filter them out in scripts and reports:
Get-AzPolicyAttestation |
Where-Object { $_.ExpiresOn -gt (Get-Date) }
If you delete the policy assignment itself:
- All related attestations (expired or not) are automatically removed
This is currently the only guaranteed cleanup method.
Create a new attestation instead of updating, If a new attestation is required:
- Create a new attestation with a new name
- Leave the expired one as historical record
This aligns with current service behavior.
Hope this helps! If you have any question, please reach out to us. Thanks.