Registry /
security / azure-mgmt-securityinsight
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
SecurityInsights
✓ from azure.mgmt.securityinsight import SecurityInsights
✗ from azure.mgmt.securityinsight import SecurityInsight
Class name is plural; singular 'SecurityInsight' does not exist.
SecurityInsightsClient
✓ from azure.mgmt.securityinsight import SecurityInsightsClient
Authenticate using DefaultAzureCredential and list alert rules.
import os
from azure.identity import DefaultAzureCredential
from azure.mgmt.securityinsight import SecurityInsights
subscription_id = os.environ.get('AZURE_SUBSCRIPTION_ID', '')
resource_group = 'myResourceGroup'
workspace_name = 'myWorkspace'
client = SecurityInsights(credential=DefaultAzureCredential(), subscription_id=subscription_id)
alert_rules = client.alert_rules.list(resource_group_name=resource_group, workspace_name=workspace_name)
for rule in alert_rules:
print(rule.name)
Errors
Common errors & fixes
ImportError: cannot import name 'SecurityInsights' from 'azure.mgmt.securityinsight'
Installed an older version (<1.0.0) where the class was named SecurityInsightsClient.
fixUpgrade to v1.0.0: pip install --upgrade azure-mgmt-securityinsight
AttributeError: 'SecurityInsights' object has no attribute 'alert_rules'
Using an older API version or incorrect client initialization.
fixEnsure you are using the correct client class (SecurityInsights) and that the package is up-to-date.
Upgrade
Version history
1.0.0latest on PyPI · released Jul 26, 2022
Audit
Dependencies
azure-identityrequiredAuthentication (DefaultAzureCredential)
azure-mgmt-resourceoptionalResource management helper