top of page
13 hours ago
4 min read

Microsoft released mssql-django 2.0 on September 18, 2026, adding mssql-python as an alternative to the existing pyodbc connection path. The backend supports Azure SQL Database and Azure SQL Managed Instance alongside SQL Server and SQL database in Microsoft Fabric. Read Microsoft's release announcement.


For Azure application teams, the useful change is a choice that can be evaluated gradually. My recommendation is to treat upgrading the backend package and changing the selected driver as two separate decisions, each with its own acceptance evidence.


The Default Driver Has Not Changed


Version 2.0 retains pyodbc as the default. To opt one database alias into mssql-python, set python_driver to mssql_python inside that alias's OPTIONS. The Django ENGINE stays mssql, and other aliases can continue using pyodbc. Versioned configuration reference.


My practical starting point would be one non-production alias with a known workload. Preserve its existing configuration and test the package upgrade with the original driver first. Then change the driver selection and repeat the same checks.


This sequence makes failures easier to attribute. If the first stage fails, investigate the package or runtime change. If only the second stage fails, focus on the driver path and the options it accepts. Avoid changing the Python runtime, Django version, application schema, and database driver in a single unexplained deployment.


Installation Compatibility Matters Even Without Opt-In


The release notes make mssql-python 1.15.0 or newer a required dependency, including installations that keep every alias on pyodbc. Version 2.0 therefore needs a platform with a compatible mssql-python distribution. Python 3.8–3.9 and Django 3.2–5.1 are no longer supported; the new matrix covers CPython 3.10–3.14 and Django 5.2, 6.0, and 6.1, with Django 6.x requiring Python 3.12 or later. Release compatibility and breaking changes.


My recommendation is to test installation in the exact deployment image, not just on a developer laptop. Record the operating system, architecture, Python version, resolved dependency versions, and package source. That information should travel with the release artifact.


The project documentation says the mssql-python path automatically installs an ODBC Driver 18 companion package. Private package indexes and installations using --no-deps must provide it separately, and platform prerequisites still apply. Driver installation requirements.


For a locked-down build environment, verify that the complete approved dependency set is available before scheduling application rollout.


Do Not Copy Connection Options Blindly


The new path ignores settings including driver and dsn, has no ODBC Driver 17 fallback, and validates extra_params against an allowlist. For example, Connect Timeout is rejected there; the documented alternative is connection_timeout. Driver-specific configuration rules.


My recommendation is to classify every existing option: still required and supported, driver-specific, or obsolete. Keep security requirements intact while translating configuration. An unfamiliar option should trigger investigation, not removal until the connection happens to succeed.


Test authentication using the same identity model as the deployed application. Include a fresh process, an established connection, and a renewed authentication session where relevant. A successful interactive administrator connection is not a substitute for application-identity evidence.


Large Iterators Need a Memory Test


Microsoft highlights an important behavioral difference: the mssql-python path does not enable Multiple Active Result Sets, or MARS. QuerySet.iterator() buffers the full result before yielding rows so nested queries can reuse the connection. Applications depending on MARS, named DSNs, or Always Encrypted through ColumnEncryption should retain the pyodbc path. Driver differences and migration considerations.


For a reporting job or data export, my recommendation is to measure peak process memory using a realistic result size. A small functional test may never expose the difference that matters inside a constrained container.


Include the largest expected customer dataset, not just the average. Capture execution time, memory, and failure behavior together. If the job exceeds its resource budget, that is an adoption blocker for that workload even if its rows are correct.


Reliability Fixes Deserve Targeted Regression Cases


The release includes fixes for bracket wildcard escaping in expression-based lookups, quoted schema names during introspection, and explicit MARS settings. Timezone handling also moves from pytz to zoneinfo with tzdata. The Fabric Warehouse connection fix does not establish full Warehouse backend support. Official 2.0 release notes.


My recommendation is to add small regression cases around the paths your application uses. For text matching, include punctuation that could be interpreted as pattern syntax. For time-based business rules, choose dates around relevant offset changes and compare expected values explicitly.


Do not infer that an unrelated ORM limitation has disappeared because the backend has a new major version. Keep existing application-specific compatibility tests in the suite.


Practical Cloud Engineer Takeaway


My proposed rollout checklist is:


  • Build the exact target artifact and verify its resolved dependency set.

  • Establish a passing baseline using the current driver choice.

  • Opt in one non-production alias and repeat transaction, query, and authentication tests.

  • Measure realistic iterator workloads against the process memory budget.

  • Review connection options individually and preserve required encryption controls.

  • Keep the previous deployable artifact and configuration available for rollback.


Reverting a driver option and reverting the entire package upgrade are different recovery actions. Rehearse the one that matches the failure you are trying to recover from. These recommendations are not a claim of hands-on testing of a customer application.


Who Should Care?


Django developers, Azure SQL application owners, Python platform teams, and engineers maintaining containerized database-connected services.


Bottom Line


mssql-django 2.0 offers a useful new connection choice. Evaluate it per workload, with installation compatibility, security settings, and memory behavior treated as first-class acceptance criteria.


Sources




Stay radical, stay curious, and keep pushing the boundaries of what is possible in the cloud.


Chriz


Beyond Cloud with Chriz

 
 
 

Comments


bottom of page