chore(azure): upgrade azure-mgmt-sql to v3.0.1 and migrate to database_security_alert_policies API #2344
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Upgrade
azure-mgmt-sqlfrom<=1.0.0to>=3.0.1,<4and migrate fromdatabase_threat_detection_policiestodatabase_security_alert_policiesAPI.Why is this change necessary?
API Retirement: Microsoft will retire ALL 2014-04-01 REST APIs on June 30, 2026. The current
database_threat_detection_policiesoperation usesapi-version=2014-04-01. If we don't migrate, Cartography's Azure SQL sync will stop working.Ecosystem Compatibility: The constraint
azure-mgmt-sql<=1.0.0conflicts with projects using modern Azure SDK versions (released in the last 4 years), blocking Cartography adoption in the cloud security ecosystem.New Data Available: The modern API provides
creation_timefield useful for auditing and compliance.Changes:
pyproject.tomlazure-mgmt-sql<=1.0.0→>=3.0.1,<4cartography/intel/azure/sql.pydatabase_threat_detection_policies.get()→database_security_alert_policies.get()cartography/models/azure/sql/databasethreatdetectionpolicy.pylocation,kind,useserverdefault(no longer in Azure API); Addcreationtimetests/data/azure/sql.pydocs/root/modules/azure/schema.mduv.lockNote on removed fields: The fields
location,kind, anduseserverdefaultwere 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
make lint).🙏 Thanks to @AdriiiPRodri for the original contribution!