Skip to content

Conversation

@jychp
Copy link
Collaborator

@jychp jychp commented Feb 4, 2026

Summary

Note: This PR continues the work from #2154 by @AdriiiPRodri. The original author's commits are preserved with full attribution.

Upgrade azure-mgmt-sql from <=1.0.0 to >=3.0.1,<4 and migrate from database_threat_detection_policies to database_security_alert_policies API.

Why is this change necessary?

  1. API Retirement: Microsoft will retire ALL 2014-04-01 REST APIs on June 30, 2026. The current database_threat_detection_policies operation uses api-version=2014-04-01. If we don't migrate, Cartography's Azure SQL sync will stop working.

    Source: Microsoft API Retirement Notice

  2. Ecosystem Compatibility: The constraint azure-mgmt-sql<=1.0.0 conflicts with projects using modern Azure SDK versions (released in the last 4 years), blocking Cartography adoption in the cloud security ecosystem.

  3. New Data Available: The modern API provides creation_time field useful for auditing and compliance.

Changes:

File Change
pyproject.toml azure-mgmt-sql<=1.0.0>=3.0.1,<4
cartography/intel/azure/sql.py database_threat_detection_policies.get()database_security_alert_policies.get()
cartography/models/azure/sql/databasethreatdetectionpolicy.py Remove location, kind, useserverdefault (no longer in Azure API); Add creationtime
tests/data/azure/sql.py Update mock data to match new API response format
docs/root/modules/azure/schema.md Update schema documentation
uv.lock Auto-generated lockfile update

Note on removed fields: The fields location, kind, and useserverdefault were removed by Microsoft from the Azure SQL API in 2021. Existing nodes in Neo4j will retain their old values, only new nodes will lack these fields.

Related issues or links

Checklist

  • Update/add unit or integration tests.
  • The linter passes locally (make lint).
  • Updated the schema documentation.

🙏 Thanks to @AdriiiPRodri for the original contribution!

…_security_alert_policies API

Signed-off-by: Adrián Jesús Peña Rodríguez <adrianjpr@gmail.com>
…in v4

Signed-off-by: Adrián Jesús Peña Rodríguez <adrianjpr@gmail.com>
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

@jychp jychp changed the title feat(azure): upgrade azure-mgmt-sql to v3.0.1 and migrate to database_security_alert_policies API chore(azure): upgrade azure-mgmt-sql to v3.0.1 and migrate to database_security_alert_policies API Feb 4, 2026
@jychp jychp merged commit d1f21b6 into master Feb 5, 2026
5 of 8 checks passed
@jychp jychp deleted the azure-mgmt-sql-upgrade branch February 5, 2026 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants