canonical: https://jentic.com/apis/azure.com/azure-policy-tracked-resources

# Microsoft Azure PolicyTrackedResourcesClient

Jentic publishes the only available OpenAPI specification for PolicyTrackedResourcesClient, keeping it validated and agent-ready. The Azure Policy Insights tracked resources API exposes 4 query endpoints under Microsoft.PolicyInsights for retrieving the inventory of resources that deployIfNotExists and modify policy effects have created or altered. Use it to verify that remediation actions actually ran, list the resources spawned by an initiative, or audit which deployments are owned by policy rather than direct user action - at management group, subscription, resource group, or individual resource scope.

## For AI agents

Query the inventory of resources created or modified by deployIfNotExists and modify Azure Policy effects through 4 OData query endpoints under Microsoft.PolicyInsights.

## Scope

Does not author policies, evaluate compliance, or return audit-effect resources - use for querying resources created or modified by deployIfNotExists and modify policy effects only.

## Capabilities

- List resources created by deployIfNotExists policy effects within a subscription
- Inspect resources modified by modify-effect policies for tag, location, or property changes
- Filter tracked resources by the policy assignment that produced them
- Verify that an initiative's remediation actions actually deployed expected resources
- Walk tracked resources at management group scope for cross-subscription remediation audit
- Identify policy-owned resources before any manual cleanup or migration
- Trace a tracked resource back to its originating policy assignment and definition

## Use cases

### Remediation Audit

Verify that deployIfNotExists and modify policy effects ran as expected. Querying tracked resources at the relevant scope returns every resource that policy created or altered, with a back-pointer to the policy assignment that owns it. This closes the loop between policy assignment and remediation outcome - instead of trusting that an effect fired, the agent checks the inventory of what the effect actually produced.

Example prompt: Query tracked resources for the production subscription filtered to policyAssignmentId='/subscriptions/{id}/providers/Microsoft.Authorization/policyAssignments/diagnostics-deploy' and report the resource count

### Modify-Effect Tag Drift Audit

When a modify-effect policy auto-applies tags (for example to backfill 'cost-center' or 'environment'), this API lists every resource the policy touched. The result is the audit trail of automated tag changes - useful when a downstream system that depends on tag values needs to reconcile drift, or when a finance team asks which resources had tags applied by automation rather than the original deployer.

Example prompt: Query tracked resources at subscription scope filtered to the modify-tag policy assignment, return the list of resources touched, and group by resource type

### Policy-Owned Resource Cleanup

Before deleting a resource group or a workload, identify which contained resources were created by policy rather than by the team that owns the workload. Listing tracked resources at resource group scope surfaces policy-owned items so the cleanup plan can either keep them in place (if the policy will recreate them) or explicitly disable the relevant assignment first. Without this step, manual deletions are silently re-created, leading to confusion.

Example prompt: List tracked resources for resource group 'app-prod', return their IDs and the originating policy assignment, and produce a cleanup plan

### AI Agent Remediation Verifier

An AI agent supporting a security or governance team can verify policy remediation through Jentic. The agent searches by intent ('list azure policy tracked resources'), Jentic returns the queryResults operation with its OData filter schema, and the agent executes the call with managed Azure credentials. The same flow handles cross-subscription audit at management group scope.

Example prompt: Search Jentic for 'list Azure policy tracked resources', load the queryResults schema, and execute it for the production subscription with a 7-day filter

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyTrackedResources/{policyTrackedResourcesResource}/queryResults | Query tracked resources at subscription scope |
| POST | /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyTrackedResources/{policyTrackedResourcesResource}/queryResults | Query tracked resources at resource group scope |
| POST | /providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyTrackedResources/{policyTrackedResourcesResource}/queryResults | Query tracked resources at management group scope |
| POST | /{resourceId}/providers/Microsoft.PolicyInsights/policyTrackedResources/{policyTrackedResourcesResource}/queryResults | Query tracked resources for a specific resource |

## Key resources

- **PolicyTrackedResources** — Query resources created or modified by Azure Policy effects

## Why Jentic

- **Setup:** Wiring the PolicyTrackedResourcesClient by hand means getting an Azure AD token from login.microsoftonline.com, sending every request to management.azure.com with the right preview api-version, and choosing among the subscription, resource group, resource, and management group queryResults paths yourself. Through Jentic you install once, import PolicyTrackedResourcesClient from the API Directory, store the Azure AD credential once, and your agent calls it.
- **Permission scoping:** This API puts the scope in the URL path (subscription, resource group, resource, or management group) while the query filters travel in the request body, so limit the agent to the operations it needs, such as querying tracked resources at a resource group scope. You choose those operations, so a subscription-wide query is not included unless you add it.
- **Credential handling:** Your Azure AD credential is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'list Azure policy tracked resources', and Jentic returns the matching scope-specific queryResults operation with its input schema so the agent does not pick between the scope variants by hand.

## Related APIs

- **Azure Policy States** — Query current compliance state for the policies whose remediations this API tracks.
- **Azure Policy Events** — Query historical evaluation events alongside the resources those evaluations remediated.
- **Azure Policy** — Author and assign the deployIfNotExists and modify policies whose outputs this API lists.

## FAQ

### Why is there no official OpenAPI spec for PolicyTrackedResourcesClient?

Microsoft Azure does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call PolicyTrackedResourcesClient via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the Azure Policy Tracked Resources API use?

It uses Azure Active Directory OAuth 2.0 against https://management.azure.com/ with the user_impersonation scope. The caller needs Reader on Microsoft.PolicyInsights at the queried scope. Jentic stores service principal credentials encrypted and issues short-lived bearer tokens at execution time.

### Can I see which resources were created by a specific deployIfNotExists assignment?

Yes. POST to /subscriptions/{id}/providers/Microsoft.PolicyInsights/policyTrackedResources/default/queryResults with $filter=policyAssignmentId eq '{assignmentId}' in the OData query. The response lists each resource created or modified by that assignment along with the originating evaluation timestamp.

### What are the rate limits for the Policy Tracked Resources API?

Azure Resource Manager applies subscription-level throttling at roughly 1,200 reads per hour. Tracked resource queries can return large result sets; use $top and $skiptoken pagination for environments with hundreds of remediations.

### How do I audit policy remediations through Jentic?

Run pip install jentic and search for 'list Azure policy tracked resources'. Jentic returns the queryResults operation; load its schema and execute it at the desired scope with optional $filter on policyAssignmentId or timestamp.

### Does this API include resources affected by audit-effect policies?

No. Tracked resources covers deployIfNotExists and modify effects, which create or change resources. Audit, deny, and append effects are not in scope here. For audit-effect compliance state use PolicyStatesClient; for evaluation history use PolicyEventsClient.

### Can I limit what my agent is allowed to do with the Azure Policy Tracked Resources API?

Yes. Because you self-host Jentic One, your own rules decide which of the four queryResults operations the agent may call, and this API carries its scope in the URL path, so you can grant only the operation you need, such as querying tracked resources at a resource group scope. A subscription-wide or management group query is not available to the agent unless you explicitly add that operation. Jentic One injects your Azure AD credential at execution time under those same rules, so the agent can read tracked resources only at the scopes you allow.
