azure-mgmt-policyinsights
Microsoft Azure Policyinsights Management Client Library for Python
What it is and what it does
azure-mgmt-policyinsights is the official Microsoft Azure SDK client library for querying and managing Azure Policy Insights. It exposes operations to retrieve policy compliance data, policy events, and policy restrictions across your Azure infrastructure. The library handles authentication via Azure Active Directory and provides a Pythonic interface to the Azure Policy Insights REST API.
The package is built on azure-mgmt-core and integrates with the broader Azure SDK ecosystem. It requires Python 3.9 or later and depends on isodate for date handling and typing-extensions for type hints. The library is actively maintained as part of the official Azure SDK for Python, with support for current Python versions.
Use it for:
- Query policy compliance states and summaries across subscriptions, resource groups, or individual resources.
- Retrieve policy events to audit when and why resources were evaluated against Azure policies.
- Check policy restrictions to determine what actions are allowed on resources before attempting them.
- Integrate policy insights into compliance dashboards or automated governance workflows.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides programmatic access to Azure Policy Insights, allowing you to query policy compliance states, events, and restrictions across your Azure resources.
Yes. This is the official Azure SDK client for policy insights, actively maintained with no known vulnerabilities, low install friction, and broad Python version support. Install it if you need to programmatically query Azure policy compliance, events, or restrictions. The only caveat is that license treatment is unclear in the metadata.
Install
azure-mgmt-policyinsights on PyPI
pip
pip install azure-mgmt-policyinsightsuv
uv add azure-mgmt-policyinsightspoetry
poetry add azure-mgmt-policyinsightsInstalling azure-mgmt-policyinsights
Before you install
Low friction: pure Python wheel with only three lightweight runtime dependencies (isodate, azure-mgmt-core, typing-extensions). Active maintenance with a recent release 87 days ago.
Quickstart
pip install azure-mgmt-policyinsights
from azure.mgmt.policyinsights import PolicyInsightsClient
from azure.identity import DefaultAzureCredential
import os
sub_id = os.getenv("AZURE_SUBSCRIPTION_ID")
client = PolicyInsightsClient(credential=DefaultAzureCredential(), subscription_id=sub_id)
Requires Python 3.9+. Requires Azure subscription and environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET, AZURE_SUBSCRIPTION_ID.
Verify before relying
- Whether additional Azure SDK components are required for full functionality in production scenarios.
- Performance characteristics when querying large numbers of policy compliance records or events.
- Actual license terms, as license treatment is marked unclear in metadata.
Package facts
| License | not declared (unclear) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — isodate, azure-mgmt-core, typing-extensions |
| Maintenance | actively maintained — 87 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 6,908,048/month — #1,815 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: azure_mgmt_policyinsights-1.0.1-py3-none-any.whl
Keywords: azure, azure sdk
Tags
More Monitoring packages
Wraps any iterable to display a real-time…
copyleft · top 100 on PyPI
opentelemetry-semantic-conventionsProvides generated Python code for…
permissive · top 100 on PyPI
opentelemetry-sdkProvides the reference implementation of the…
permissive · top 100 on PyPI
opentelemetry-apiProvides the abstract API and interfaces for…
permissive · top 100 on PyPI
opentelemetry-exporter-otlp-proto-httpExports OpenTelemetry observability data to an…
permissive · top 1,000 on PyPI
opentelemetry-instrumentationProvides automatic instrumentation commands and…
permissive · top 1,000 on PyPI
azure-mgmt-applicationinsightsManages Azure Application Insights…
permissive · top 5,000 on PyPI
azure-mgmt-monitorProvides programmatic access to Azure Monitor…
permissive · top 5,000 on PyPI
azure-mgmt-managementpartnerProvides a Python client library for managing…
unclear · top 5,000 on PyPI
azure-mgmt-msiManages Azure Managed Service Identities…
permissive · top 5,000 on PyPI
azure-mgmt-iothubprovisioningservicesManages Azure IoT Hub Provisioning Services…
permissive · top 5,000 on PyPI
azure-mgmt-resourcegraphProvides a Python client library to query and…
unclear · top 5,000 on PyPI
azure-mgmt-managedservicesProvides Python client library for managing…
unclear · top 15,000 on PyPI
azure-mgmt-commerceProvides a Python client library for managing…
unclear · top 5,000 on PyPI
azure-mgmt-advisorProvides Python bindings to interact with Azure…
unclear · top 5,000 on PyPI
azure-applicationinsightsProvides a Python client library for querying…
permissive · top 5,000 on PyPI