Sr. Content Developer at Microsoft, working remotely in PA, TechBash conference organizer, former Microsoft MVP, Husband, Dad and Geek.
165515 stories
·
33 followers

Rotating credentials in Azure API Management

1 Share

Credentials covered by this guidance

  • Subscription keys
  • Named values that contain secrets
  • Backend credentials (headers, query parameters, client certificates)
  • OAuth 2.0 and OpenID Connect client secrets
  • Connection strings (for example, Event Hubs loggers)
  • Credentials written directly into policies

How to rotate safely

Use this order when both credentials can remain valid:

  1. Create a new secret where it is issued.
  2. Update API Management with the new secret.
  3. Test your APIs.
  4. Revoke the old secret.

Important: Rotate each credential where it is issued (for example, the backend service or identity provider), not only in API Management. Updating the value in API Management alone does not invalidate the old credential.

Find your instances and credentials

Step 1: List your API Management instances

In the Azure portal, search for API Management services, or use Azure CLI:

In one subscription:

az apim list --subscription {subscriptionId} --query "[].{name:name, resourceGroup:resourceGroup}" --output table

Across accessible subscriptions (one Azure Resource Graph page):

az graph query -q "resources | where type =~ 'microsoft.apimanagement/service' | project name, resourceGroup, subscriptionId, location"

Step 2: List the credentials in each instance

In the commands, replace {base} with https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{rg}/providers/Microsoft.ApiManagement/service/{apimName}, and the other values in braces with your own. In policies, look for values such as Authorization headers, keys, passwords, tokens or connection strings written out in full instead of referenced as a named value.

Subscription keys are under APIs > Subscriptions in the Azure portal.

az rest --method get --url "{base}/subscriptions?api-version=2024-05-01"

Named values are under APIs > Named values. The Type column shows whether each secret is stored in API Management or in Key Vault.

az apim nv list --resource-group {rg} --service-name {apimName} --output table

Backend credentials are under APIs > Backends > Authorization credentials.

az rest --method get --url "{base}/backends?api-version=2024-05-01"

OAuth 2.0 and OpenID Connect providers are under Developer portal > OAuth 2.0 + OpenID Connect. Developer portal sign-in providers are under Developer portal > Identities.

az rest --method get --url "{base}/authorizationServers?api-version=2024-05-01"
az rest --method get --url "{base}/openidConnectProviders?api-version=2024-05-01"
az rest --method get --url "{base}/identityProviders?api-version=2024-05-01"

List providers under APIs > Credential manager:

az rest --method get --url "{base}/authorizationProviders?api-version=2024-05-01"

Loggers that use connection strings (Event Hubs, Application Insights):

az rest --method get --url "{base}/loggers?api-version=2024-05-01"

Check global, API, and operation policies under Design. For product policies, select Products > the product > Policies.

az rest --method get --url "{base}/policies/policy?format=rawxml&api-version=2024-05-01"
az rest --method get --url "{base}/apis/{apiId}/policies/policy?format=rawxml&api-version=2024-05-01"

Step 3: Read the current secret values

Read each secret to identify which systems use it before you rotate it. This requires permission to read secrets on the instance. Store the output securely and delete it when you are finished.

az rest --method post --url "{base}/subscriptions/{sid}/listSecrets?api-version=2024-05-01"
az apim nv show-secret --resource-group {rg} --service-name {apimName} --named-value-id {namedValueId}
az rest --method post --url "{base}/authorizationServers/{id}/listSecrets?api-version=2024-05-01"
az rest --method post --url "{base}/openidConnectProviders/{id}/listSecrets?api-version=2024-05-01"
az rest --method post --url "{base}/identityProviders/{id}/listSecrets?api-version=2024-05-01"
az rest --method post --url "{base}/tenant/access/listSecrets?api-version=2024-05-01"

Rotate each credential type

The commands below use the same {base} placeholder as in Step 2. Replace the other values in braces with your own.

Subscription keys

Move callers to the secondary key, regenerate the primary key, move callers to the new primary key, then regenerate the secondary key.

az rest --method post --url "{base}/subscriptions/{sid}/regeneratePrimaryKey?api-version=2024-05-01"
az rest --method post --url "{base}/subscriptions/{sid}/regenerateSecondaryKey?api-version=2024-05-01"

For additional details, see Subscriptions in Azure API Management.

Named values

If the named value is backed by Key Vault, store the replacement in Key Vault, point any pinned reference to the new version, and refresh the named value. If the secret is stored in API Management, update the value with a new credential and consider moving it to Key Vault.

az rest --method post --url "{base}/namedValues/{namedValueId}/refreshSecret?api-version=2024-05-01"
az apim nv update --resource-group {rg} --service-name {apimName} --named-value-id {namedValueId} --value "{newValue}"

For additional details, see Use named values in Azure API Management policies.

Backend credentials

Stage the replacement at the backend. Update and test API Management before revoking the old credential. Example for a backend with only one credential, using its current ETag:

az rest --method patch --url "{base}/backends/{backendId}?api-version=2024-05-01" --headers 'If-Match={etag}' --body '{"properties":{"credentials":{"header":{"{headerName}":["{newKey}"]}}}}'

For additional details, see Backends in API Management.

OAuth 2.0 and OpenID Connect client secrets

Create the secret at its issuer. Update API Management, republish the portal if used, and test before deleting the old secret. For Microsoft Entra ID:

az ad app credential reset --id {appId} --append --display-name "apim-rotation"
az ad app credential delete --id {appId} --key-id {oldKeyId}

For additional details, see Add and manage application credentials in Microsoft Entra ID.

Connection strings

For Event Hubs, switch the logger to the secondary connection string and test delivery before renewing the namespace rule’s primary key:

az eventhubs namespace authorization-rule keys renew --resource-group {rg} --namespace-name {namespace} --name {ruleName} --key PrimaryKey

For additional details, see How to log events to Azure Event Hubs in Azure API Management.

Credentials in policies

Create the replacement at the source. Reference its Key Vault-backed named value as {{display-name}}. Test the policy before revoking the old credential.

For additional details, see Use named values in Azure API Management policies.

Management API access keys

For legacy Direct Management API keys, switch callers off each key before regenerating it.

az rest --method post --url "{base}/tenant/access/regeneratePrimaryKey?api-version=2024-05-01"
az rest --method post --url "{base}/tenant/access/regenerateSecondaryKey?api-version=2024-05-01"

For additional details, see Tenant Access - Regenerate Primary Key.

Best practices going forward

  • Use managed identities instead of keys and connection strings wherever supported.
  • Store secrets in Azure Key Vault and reference them as named values. Use a secret identifier without a version for automatic refresh.
  • Rotate credentials regularly and automate rotation where possible.
  • Review your configuration for subscriptions, users, policies or backends that you did not create.

Additional documentation

Read the whole story
alvinashcraft
39 minutes ago
reply
Pennsylvania, USA
Share this story
Delete

Database Performance: Counting Rows with EF Core vs. ADO.NET

1 Share
Counting rows may seem simple, but the data-access approach can affect both execution time and memory allocations. This benchmark compares Entity Framework Core, compiled EF Core queries, and direct ADO.NET with SQLite to reveal which approach handles frequently executed count operations most efficiently.
Read the whole story
alvinashcraft
40 minutes ago
reply
Pennsylvania, USA
Share this story
Delete

Typemock Isolator++ 5.4.7: Making C++ Unit Testing More Predictable

1 Share

C++ unit testing is rarely simple, especially when working with large applications, legacy dependencies, and complex runtime behavior. Mocking can help isolate code, but the mocking framework itself must be reliable.

Typemock Isolator++ 5.4.7 focuses on exactly that: predictable behavior, clearer errors, and more reliable test execution.

This release improves handling of Microsoft debugging symbols, fixes unnecessary copying of reference return values, and addresses potential deadlocks involving During filters.

These changes are particularly valuable for teams testing complex C++ applications where subtle runtime behavior can make failures difficult to diagnose.

Clearer Errors When Microsoft PDB Files Are Missing

Typemock Isolator++ uses debugging symbols to support its isolation and mocking capabilities. For some Windows system components, the required PDB files must be downloaded from Microsoft’s symbol servers.

Previously, missing required symbols could allow execution to continue, potentially leading to confusing runtime failures or crashes later in the test.

Version 5.4.7 changes this behavior.

When required Microsoft PDB files cannot be downloaded, Isolator++ now reports an explicit exception rather than continuing execution in a state where essential symbols are unavailable.

This is a breaking behavior change, but an intentional one.

A clear failure explaining that required debugging symbols are missing is far more useful than an unexplained crash several steps later.

For developers debugging complex C++ unit tests or CI pipeline failures, this means faster diagnosis and fewer misleading symptoms.

More Accurate Mocking of Reference Return Values

C++ references are fundamental to many APIs, especially those involving large objects, shared state, and performance-sensitive operations.

When a mocked method returns a reference, preserving the expected C++ semantics is essential.

Isolator++ 5.4.7 fixes unnecessary copying of reference return values in the CallTo API.

This helps ensure that mocking does not introduce unintended copying behavior when working with methods that return references, improving correctness and compatibility with real-world C++ code.

Improved Reliability of During Filters

Complex unit tests often require controlling mocked behavior within specific execution contexts.

Typemock Isolator++ provides During filters to support this kind of isolation.

Version 5.4.7 fixes potential deadlocks associated with these filters, improving reliability when running tests involving more complex interactions.

For developers working with large C++ codebases, avoiding intermittent hangs is especially important. A test that occasionally deadlocks can undermine confidence in the entire test suite.

Reliable C++ Mocking Matters

Mocking is supposed to remove obstacles from unit testing, not introduce new ones.

With version 5.4.7, Typemock Isolator++ continues improving the stability and predictability of C++ isolation. More informative failures, correct reference handling, and fewer potential deadlocks all contribute to a more dependable testing experience.

Whether you’re maintaining legacy C++ code, testing tightly coupled components, or building a reliable automated testing pipeline, these improvements help keep the focus where it belongs: testing your code rather than debugging your test framework.

Download Typemock Isolator++

The post Typemock Isolator++ 5.4.7: Making C++ Unit Testing More Predictable appeared first on Typemock.

Read the whole story
alvinashcraft
40 minutes ago
reply
Pennsylvania, USA
Share this story
Delete

Typemock Isolator 9.5.3 MCP, AI Testing & .NET 11

1 Share

Giving AI Coding Agents the Tools to Test Their Work

AI coding agents are getting better at writing code. They can generate features, refactor applications, and write unit tests in seconds. But one question remains: Who checks whether those tests are actually good?

Typemock Isolator 9.5.3 takes an important step toward answering that question. With new Model Context Protocol (MCP) integration, improved Test Review analysis, and support for .NET 11, this release helps connect AI-assisted development with deterministic testing tools.

The goal isn’t simply to generate more tests. It’s to make those tests more meaningful.

AI-Assisted Unit Testing with MCP Integration

AI coding agents can write a unit test that looks perfectly reasonable and still miss important behaviors. They may test the happy path repeatedly, overlook dependencies, or create several tests that effectively verify the same thing.

With the new Typemock MCP integration, AI coding assistants can work with Typemock’s unit testing capabilities rather than relying entirely on generated code and their own reasoning.

The integration gives agents access to tools for understanding the testing environment, obtaining guidance on the Typemock API, running tests, and reviewing test quality.

This creates a more useful development workflow: the AI writes or improves tests, Typemock executes them, and Test Review provides evidence about what those tests actually verify.

The result is a feedback loop grounded in real test execution.

Better Tests, Not Just More Tests

Traditional code coverage tells you which code ran. It doesn’t necessarily tell you whether your assertions caught meaningful problems.

Typemock Test Review goes further by examining test behavior and identifying tests that may be redundant or ineffective.

In version 9.5.3, duplicate test detection has been improved using branch coverage analysis. This helps distinguish tests that execute similar code but explore different branches from tests that provide substantially overlapping verification.

Consider two tests that execute the same method. One checks the successful payment path, while another checks what happens when payment is declined. Both are valuable, even when their line coverage overlaps.

Now consider five tests that exercise the same branch with slightly different inputs but never test an alternative outcome. Those tests may increase the test count without meaningfully increasing confidence.

Better duplicate detection helps developers focus on what matters: tests that contribute new information about the behavior of the code.

Learn more about Typemock Test Review.

.NET 11 Support

Typemock Isolator 9.5.3 adds support for .NET 11, allowing teams to continue testing as they move to newer versions of the .NET platform.

This release also includes improvements to test execution stability under .NET 11, alongside fixes for native profiler shutdown crashes and P/Invoke instrumentation involving function-pointer return types.

Known limitation: .NET 11 runtime async methods cannot currently be faked. Developers using these APIs should account for this limitation when designing their unit tests.

More Reliable Integration with Modern C# Projects

The release also improves MCP method resolution and support for implicit C# global usings, helping the integration work with modern C# project structures.

Additional fixes address Test Review and Insight warnings involving ambiguous methods or methods that share source locations. The installer has also been improved to address failures caused by Microsoft Defender Attack Surface Reduction (ASR) policies.

These changes are less visible than MCP integration, but they matter in real development environments where reliable test execution is essential.

AI Can Write the Tests. Typemock Helps Verify Them.

AI-assisted development is changing the speed at which software is created. But increasing the speed of code generation should not mean abandoning independent verification.

The stronger approach is to combine AI reasoning with tools that provide deterministic evidence.

Typemock Isolator 9.5.3 brings these capabilities closer together: powerful .NET mocking, AI-assisted unit testing through MCP, and Test Review analysis that helps developers understand whether their tests are doing useful work.

Write code faster. Test with evidence. Refactor with confidence.

Download Typemock Isolator

The post Typemock Isolator 9.5.3 MCP, AI Testing & .NET 11 appeared first on Typemock.

Read the whole story
alvinashcraft
40 minutes ago
reply
Pennsylvania, USA
Share this story
Delete

PostgreSQL Just Got a Serious Upgrade: Meet Azure HorizonDB!

1 Share

Microsoft just changed the PostgreSQL game. But is Azure HorizonDB really better than Azure Database for PostgreSQL? Let’s find out!

Hold On… Didn’t We Already Have PostgreSQL on Azure?

Yes! And it’s actually pretty darn good.

For years, Microsoft has offered Azure Database for PostgreSQL Flexible Server, giving developers and enterprises a powerful, fully managed PostgreSQL platform without the headache of managing virtual machines, backups, patches, and infrastructure.

And with PostgreSQL 18, things have only gotten better.

So imagine my reaction when Microsoft stepped onto the stage at Microsoft Ignite 2026 and announced that Azure HorizonDB is now Generally Available, effective November 17, 2026.

Wait a minute.

Another PostgreSQL service?

Why?

Is Microsoft replacing Flexible Server? Is PostgreSQL 18 suddenly old news? even with the release of PostgreSQL 19 two days ago, still?  Should we all start migrating our databases tomorrow morning?

Not so fast!

The answer is far more interesting than simply introducing another database service.

HorizonDB represents a fundamentally different approach to running PostgreSQL in the cloud. And for certain workloads, especially enterprise SaaS platforms, high-volume transactional applications, and AI-powered systems, the implications could be enormous.

Let’s break it down!

1. The Big Difference: It’s All About Architecture!

Here’s something I frequently emphasize when discussing cloud architecture:

Sometimes the most important innovation isn’t what the technology does. It’s how the technology does it.

Traditional PostgreSQL was designed around a database server that manages compute, memory, transaction processing, and database storage.

Azure PostgreSQL Flexible Server modernizes this experience with managed infrastructure, automated maintenance, backups, high availability, and scaling options.

But its core architecture remains relatively close to traditional PostgreSQL deployments.

HorizonDB takes a different approach.

It separates compute from storage and introduces a distributed, log-based storage architecture.

Think of it this way:

Azure PostgreSQL Flexible Server: The Traditional Approach

Imagine a restaurant where each chef works in a fully equipped kitchen.

Each kitchen has its own equipment, ingredients, and workspace.

Want another kitchen to help prepare more orders?

You need another kitchen, complete with its own equipment and supplies.

That’s somewhat similar to conventional PostgreSQL read replicas, which maintain their own database copies.

Azure HorizonDB: The Cloud-Native Approach

Now imagine several chefs sharing a giant, centralized, highly efficient food preparation infrastructure.

Each chef has the computing resources needed to prepare orders, but they all access the same underlying durable data.

Need more chefs to handle customer requests?

Add more compute resources.

Need more storage?

Expand the storage independently.

You no longer need to duplicate the entire database for every read replica.

That’s the architectural magic behind HorizonDB!

Technically, Microsoft describes HorizonDB as a disaggregated compute and storage architecture using a database-as-a-log design.

Its storage layer separates the write-ahead log (WAL) from the data storage service. Compute nodes write transaction logs into durable shared storage, while storage nodes apply those logs to maintain database pages.

This reduces some traditional PostgreSQL write and checkpoint overhead.

And that matters enormously when workloads start growing.

HorizonDB1

2. Performance: Microsoft Is Making Some Serious Claims!

Let’s get to the numbers, because this is where things get exciting.

Microsoft reports that HorizonDB can deliver up to 8 times faster OLTP performance compared with self-managed PostgreSQL under its published benchmark conditions.

Yes, you read that correctly.

Up to 8×!

Now, before everyone starts rewriting their infrastructure diagrams, we need to understand what that number actually means.

Microsoft’s published test uses a particular HammerDB TPROC-C configuration, comparing systems on comparable hardware with high availability enabled.

It is not a claim that HorizonDB will automatically outperform Azure PostgreSQL 18 Flexible Server by eight times.

Your application’s actual improvement will depend on transaction patterns, indexes, contention, query plans, hardware configurations, and other factors.

But the underlying architectural advantage is real.

HorizonDB reduces database write amplification by sending WAL records to a dedicated storage service rather than relying on conventional database-page writes from compute nodes.

The result is an architecture designed for high transaction throughput and predictable latency.

Microsoft also advertises sub-millisecond transaction commit latency across availability zones in its tested configurations.

Imagine what that could mean for:

  • Financial transaction processing

  • Enterprise SaaS applications

  • High-volume e-commerce platforms

  • Customer relationship management systems

  • Real-time operational systems

  • AI applications making frequent database queries

Suddenly, PostgreSQL isn’t simply a database you deploy in Azure.

It’s becoming a much more cloud-native transactional platform.

That’s a big deal!

3. Read Scalability: Give Me More Readers!

Let’s talk about one of the most frustrating challenges in database architecture.

Your application becomes successful.

Congratulations!

More users arrive. More dashboards are opened. More API requests come in. More reports need to run.

And guess what?

Your database starts sweating.

With traditional PostgreSQL, you can add read replicas to distribute read workloads.

Flexible Server already supports this capability.

But conventional replicas maintain their own database copies, requiring additional storage and replication management.

HorizonDB changes that relationship.

It supports up to 15 reader nodes sharing the same underlying durable data layer.

These readers can be added to scale read operations without creating separate full physical copies of the database.

HorizonDB also provides a dedicated read-only endpoint that can distribute connections across available readers.

Think about the possibilities.

An enterprise application might have thousands of users simultaneously requesting reports, searching records, viewing dashboards, and interacting with AI-powered assistants.

Instead of forcing all those requests through the primary database node, you distribute the reads across multiple compute nodes.

And because storage is shared, scaling readers becomes more efficient.

One important detail: HorizonDB still uses a single writable primary per cluster.

This is read scaling, not unlimited horizontal write scaling.

If your application needs distributed writes across multiple database shards, you should evaluate alternative architectures, including PostgreSQL elastic clusters.

Nevertheless, for read-intensive applications, this could be one of HorizonDB’s most compelling advantages.

HorizonDB2

4. AI and Vector Search: Now Things Get REALLY Interesting!

If you’ve followed my work at The Training Boss, you already know how excited I am about AI agents, Microsoft Foundry, Microsoft Agent Framework, and intelligent applications.

Well, this is where HorizonDB really caught my attention.

For years, PostgreSQL has steadily evolved beyond traditional relational data processing.

With extensions such as pgvector, developers can store embeddings and perform semantic similarity searches directly inside PostgreSQL.

That’s incredibly useful for Retrieval-Augmented Generation (RAG), recommendation engines, and AI-powered applications.

But as vector datasets grow, search performance, index sizes, and memory consumption become increasingly important.

Enter DiskANN!

HorizonDB includes support for DiskANN-based vector indexing alongside pgvector.

DiskANN is designed to perform efficient approximate nearest-neighbor searches while making effective use of disk-based storage.

Microsoft reports that its DiskANN indexing can provide up to 1.5× higher throughput than HNSW at comparable recall, with indexes up to five times smaller in its tested scenarios.

That can be extremely valuable when managing millions of vector embeddings.

And HorizonDB doesn’t stop with vector search.

It also supports capabilities such as:

Hybrid search: Combine semantic vector similarity with keyword search using techniques such as Reciprocal Rank Fusion (RRF).

BM25 ranking: Retrieve documents using relevance-ranked lexical search through the pg_textsearch extension.

Graph queries: Explore relationships between entities through Apache AGE.

AI functions: Invoke AI models for tasks such as embedding generation and data extraction.

AI pipelines: Build workflows that enrich and process data asynchronously.

Some of these AI capabilities, including AI Model Management and Knowledge Graphs, remain in preview even though the core HorizonDB service is GA. Always verify individual feature readiness before adopting them for production.

Why should AI developers care?

Imagine building an intelligent customer service agent using Microsoft Agent Framework.

Your agent needs to answer questions using:

  • Customer records stored in relational tables

  • Semantic knowledge retrieved through vector search

  • Exact product identifiers found through keyword search

  • Historical relationships discovered through graph queries

Traditionally, you might assemble several specialized technologies to support these capabilities.

HorizonDB creates an opportunity to consolidate more of that functionality into a PostgreSQL-compatible data platform.

Does that mean you should immediately eliminate Azure AI Search, Cosmos DB, or every dedicated vector database?

Absolutely not!

Those technologies have their own strengths.

But HorizonDB gives architects another powerful option, particularly when the application’s operational data already lives in PostgreSQL.

And I love having more architectural options!

HorizonDB3 

5. High Availability: What Happens When Things Go Wrong?

Let’s face it.

Nobody gets excited about database failover.

Until the database fails.

Then suddenly it’s the most important topic in the building!

HorizonDB’s shared durable storage architecture provides advantages for high availability.

Because the storage layer manages durable WAL and data independently from compute, a replacement compute node doesn’t have to rebuild its entire database storage from a separate replica.

Microsoft advertises failover in under five seconds in its published scenarios.

That’s impressive!

But remember that failover times depend on configuration, workload, client behavior, and the particular failure.

HorizonDB also provides zone-resilient storage by default.

However, zone-resilient storage does not automatically mean your compute layer has redundant failover capacity.

A highly available compute deployment requires an appropriate multi-node configuration.

For mission-critical applications, I would test actual failover behavior, transaction recovery, and application reconnection rather than simply relying on a published performance number.

The lesson?

High availability isn’t just a checkbox.

It’s an architectural decision that needs to be validated.

6. Storage: How Does 128 TB Sound?

Here’s another interesting number.

HorizonDB supports databases up to 128 TB, according to Microsoft’s GA announcement.

But capacity alone isn’t what makes the architecture exciting.

The bigger benefit is that storage can expand independently of compute.

In traditional database architectures, scaling storage and compute often involves more coordination around server sizing, disk configuration, and provisioning.

HorizonDB’s distributed storage automatically grows as database data increases.

Need additional database space?

You don’t necessarily have to resize the compute layer.

Need more CPU or memory?

You don’t have to redesign the storage architecture.

For rapidly growing enterprise applications, that separation can simplify capacity planning considerably.

Of course, you still pay for provisioned compute and consumed storage.

And while architecture can improve efficiency, more scalable does not automatically mean less expensive.

Always compare the actual monthly costs!

7. Let’s Talk About Microsoft Fabric and AI Agents

The Microsoft data ecosystem is becoming increasingly interesting.

We have Azure SQL, PostgreSQL, Cosmos DB, Microsoft Fabric, Microsoft Foundry, and now HorizonDB.

At first glance, that might seem like an overwhelming number of technologies.

But there’s an important strategic direction emerging.

Microsoft is making it easier for developers to connect transactional data, analytical data, and AI-powered applications.

Azure HorizonDB supports integration scenarios involving Microsoft Fabric and OneLake, allowing transactional information to contribute to broader analytical workloads.

But there’s another important announcement to understand.

Azure HorizonDB vs. Microsoft Fabric HorizonDB

Yes, Microsoft now uses the HorizonDB name for two related but distinct offerings.

Azure HorizonDB is the fully managed PostgreSQL-compatible database service designed for enterprise transactional and AI workloads.

Microsoft Fabric HorizonDB, introduced in public preview at Ignite 2026, is a serverless PostgreSQL database offering integrated into the Fabric environment.

Fabric HorizonDB introduces capabilities such as usage-based consumption, automatic compute pause and resume, and deep integration with OneLake.

These are not identical services.

In particular, don’t assume that the Azure HorizonDB GA service automatically includes the same serverless pause-and-resume behavior available in the Fabric offering.

For AI developers, this distinction is important when selecting the right service for your application.

8. Is It Time to Say Goodbye to PostgreSQL Flexible Server?

Not so fast, my friends!

This is where we need to put our architect hats on.

Flexible Server is a mature, production-proven service.

It already offers excellent PostgreSQL functionality, flexible compute choices, backup and recovery features, read replicas, high availability, supported extensions, and established operational tooling.

HorizonDB might be the newer and more ambitious architecture, but that doesn’t mean it is automatically the better choice.

Consider this comparison:

CapabilityPostgreSQL 18 Flexible ServerAzure HorizonDB
Core architectureManaged PostgreSQL server architectureDisaggregated compute and distributed storage
Compute scalingVertical scaling and specialized elastic-cluster optionsIndependent compute scaling and read scale-out
Read replicasConventional replicated database copiesShared-storage reader nodes
Read scalabilityEstablished replica capabilitiesUp to 15 reader nodes
Storage growthManaged, provisioned storageAutomatically scaling shared storage
Vector searchpgvector and supported extensionspgvector and DiskANN indexing
AI integrationAzure AI ecosystem integrationsAdditional integrated AI and search capabilities
High availabilityMature HA optionsShared-storage architecture designed for fast failover
Service maturityEstablishedNewly GA
Ideal workloadGeneral-purpose PostgreSQL applicationsHigh-scale transactional and AI-intensive applications

Both can be great choices.

The right one depends on your workload.

9. The Fine Print: What HorizonDB Still Needs to Improve

Every shiny new technology comes with a few trade-offs.

And HorizonDB is no exception.

According to Microsoft’s service documentation, customers should carefully validate capabilities such as cross-region read replication, integrated PgBouncer connection pooling, configurable backup retention, long-term retention, networking options, and extension compatibility.

Some documentation pages have not yet been fully synchronized with the GA announcements. For example, Microsoft’s GA announcement references customer-managed encryption keys, while older limitations documentation still lists them as unavailable.

Similarly, maintenance-window capabilities may differ from older documentation.

The practical advice is simple:

Before migrating, validate the specific functionality available in your Azure region and service configuration.

For an enterprise database, I would pay particular attention to disaster recovery, recovery-point and recovery-time objectives, backup retention, networking, compliance, connection pooling, and extension support.

A database can be incredibly fast and still be the wrong choice if it cannot meet your business continuity requirements.

10. Who Should Seriously Consider Moving to HorizonDB?

Here’s how I would approach this with customers.

Scenario 1: A Rapidly Growing SaaS Platform

You have hundreds or thousands of customers.

Your transaction volume is increasing.

Your application is becoming increasingly read-heavy.

You are constantly investigating database bottlenecks.

HorizonDB deserves serious consideration.

Independent compute scaling and shared-storage replicas could provide meaningful architectural benefits.

Scenario 2: An AI-Powered Enterprise Application

Your application combines relational data, vector embeddings, semantic retrieval, and AI agents.

You are already using PostgreSQL with pgvector, but your vector indexes are growing and your retrieval workloads are becoming demanding.

HorizonDB could be a very attractive option.

DiskANN, hybrid search, and AI integrations could simplify portions of your architecture.

Scenario 3: A Mission-Critical Transaction Processing System

Your application requires very high transaction throughput, predictable latency, and rapid recovery from failures.

You are pushing traditional PostgreSQL infrastructure toward its practical limits.

This is exactly the kind of workload HorizonDB was designed to address.

Benchmark it carefully.

Scenario 4: A Small Business Application

Your PostgreSQL database has 20 GB of data.

You run a few hundred queries per minute.

Everything performs beautifully.

Your Azure bill is reasonable.

Should you migrate?

Probably not!

There is absolutely nothing wrong with keeping an architecture that already meets your requirements.

Newer doesn’t automatically mean better.

And complexity without business value is never a good investment.

11. How Would I Evaluate a Migration?

If I were advising a customer considering HorizonDB, I wouldn’t start by asking how quickly we could migrate.

I would start with a different question:

What problem are we actually trying to solve?

Then I would establish a baseline of the existing PostgreSQL environment.

Here’s what I’d measure:

  1. Transaction performance: Compare throughput, p95/p99 query latency, and behavior under peak load.

  2. Read scalability: Determine how efficiently additional read nodes handle concurrent users and API traffic.

  3. Vector search: Compare pgvector HNSW and IVFFlat configurations against HorizonDB DiskANN, measuring search latency, recall, index size, and resource consumption.

  4. Availability: Test failover, application reconnection, and recovery behavior.

  5. Compatibility: Check PostgreSQL extensions, stored procedures, drivers, SQL functionality, and operational tooling.

  6. Total cost: Compare compute, storage, backup, networking, replicas, and administration costs.

The interesting news is that Microsoft also announced guided migration capabilities for supported PostgreSQL sources, including Flexible Server and several other managed or self-hosted environments.

These migration workflows can make testing and evaluating HorizonDB more approachable, although individual migration features may still be in preview.

I would start with a representative proof of concept, not an immediate production cutover.

12. The Bigger Picture: PostgreSQL Is Becoming an AI-Native Data Platform

This is what excites me most about HorizonDB.

For decades, relational databases were primarily the place where applications stored and queried structured business data.

They were the foundation of transaction processing.

Then came the rise of NoSQL databases, distributed data platforms, vector databases, semantic search engines, and now AI agents.

Suddenly, architects were being asked to connect an ever-growing collection of technologies just to build one intelligent application.

HorizonDB represents an interesting evolution.

Microsoft is bringing transactional processing, vector search, full-text search, graph capabilities, and AI integration closer together.

Not every application will need all those features.

And not every workload belongs in one database.

But the opportunity to reduce unnecessary data movement and architectural complexity is compelling.

Think about an AI agent interacting with customer data.

It may need to understand a customer’s purchase history, search for related products, find semantically relevant conversations, identify connected business entities, and update operational records.

Wouldn’t it be interesting if more of that work could happen within one PostgreSQL-compatible data platform?

That’s the opportunity HorizonDB is trying to address.

And for developers building with Microsoft Foundry and Microsoft Agent Framework, this is definitely a technology worth exploring.

Final Thoughts: Should You Move to HorizonDB?

Here’s my take.

Azure HorizonDB is one of Microsoft’s most interesting PostgreSQL announcements in years.

Not because PostgreSQL 18 suddenly became obsolete.

Not because everyone needs another database service.

And certainly not because an exciting performance benchmark should dictate your architecture.

It’s interesting because Microsoft has redesigned the underlying architecture to address challenges that become increasingly important as applications scale.

Higher transaction throughput.

More efficient read scaling.

Independent compute and storage.

Advanced vector indexing.

Faster failover.

And an expanding set of capabilities for AI-powered applications.

Those are meaningful architectural improvements.

But as architects, our responsibility isn’t to chase every new technology.

Our responsibility is to select technologies that solve real problems and deliver measurable business value.

So my advice is simple:

If your PostgreSQL application is running beautifully, enjoy it!

If you’re fighting performance bottlenecks, scaling challenges, or increasingly complex AI data requirements, it’s time to take HorizonDB for a test drive.

And most importantly:

Don’t migrate because HorizonDB is new. Migrate because HorizonDB makes your application better.

Now that’s an architectural decision worth celebrating!


References and Further Reading

What do you think? Is HorizonDB compelling enough to make you reconsider your current PostgreSQL architecture? Are you planning to evaluate it for your next enterprise or AI-powered application? I’d love to hear your thoughts!

The post PostgreSQL Just Got a Serious Upgrade: Meet Azure HorizonDB! appeared first on The Training Boss.

Read the whole story
alvinashcraft
40 minutes ago
reply
Pennsylvania, USA
Share this story
Delete

To code well, avoid blunders

1 Share

The secret to writing good code1 is to avoid catastrophic mistakes. Many engineers think about programming as if the goal is to have brilliant insights, but they’re wrong. If you don’t blunder, you will win.

Many other domains are like this. If you can play chess without ever hanging pieces, you will win against almost any2 opponent. If you are very good at returning tennis balls, you will beat most players even if you never hit a winner. People are really bad at internalizing this. They think that being good at chess means finding brilliant tactical combinations, or that being good at tennis means crushing balls into the corner of the court, or that being a good programmer means discovering beautiful new abstractions. Not so! All of those things are valuable, but they are not the main thing. The main thing is to avoid catastrophic mistakes.

The reason programming is like this is that it is impossible to build a durable winning advantage. In basketball, if you are up 99-1, the worst consequence of a blunder is still being up 99-4. However, in programming, one blunder can turn an elegant codebase into a janky one. For instance, consider these blunders:

  • Introducing a parallel system to perform the same task
  • Introducing a second source of truth for some key piece of data
  • Turning a safe sync operation into a delicate async one
  • Adding new subtle points of failure
  • Complicating a key interface

The cardinal sins here are inconsistency and introducing unnecessary requirements3. Even a little bit of inconsistency is dangerous because it breaks trust: instead of assuming your code works the sensible way, engineers must now go looking for surprises.

Unnecessary requirements are dangerous for two reasons. First, they’re sticky. When you’re implementing a new requirement, you have the context to decide whether it’s necessary or not. If you see one in the codebase, you must assume it’s necessary unless you’re willing to spend a bunch of time researching. So requirements tend to remain in codebases long after they could be removed. Second, they often interrelate in dangerous ways: if your codebase supports X, then you must consider how each new feature will interact with X. This combinatorial explosion is what makes working in large codebases so hard4.

When you’re writing code, you must at all costs try to:

  1. Identify where your task could fit most normally into the current codebase
  2. Trim your task down into the smallest set of requirements that you can

In fact, you should be so focused on this — on avoiding blunders — that you don’t really have mental energy to be worrying about cool tricks or “extra credit” features. As with shipping projects, if you find yourself thinking things like “oh, I could implement it with this clever pattern”, this is a warning sign: you are likely becoming distracted from the main thing, and you risk blundering.

You don’t have to be clever to do great programming work. In fact, sometimes cleverness can be a disadvantage. What you need is attention to detail and a laser focus on what actually matters: avoiding blunders by maintaining consistency and skipping unnecessary requirements.


  1. As usual on this blog, I am primarily talking about working on large commercial codebases with big teams: “impure engineering” in my terminology. This advice may not apply if you’re doing other kinds of work. Of course all of this applies whether you’re writing code by hand or driving an AI agent.

    ↩
  2. My guess (it’s surprisingly hard to research) is that not ever blundering would get you around a 1600 or 1700 chess rating: strong enough to win almost every game against casual players.

    ↩
  3. Current coding agents are pretty good at consistency — about as good as humans — but are far worse at avoiding unnecessary requirements, unfortunately.

    ↩
  4. I wrote about this in depth in Wicked features.

    ↩
Read the whole story
alvinashcraft
41 minutes ago
reply
Pennsylvania, USA
Share this story
Delete
Next Page of Stories