Azure PostgreSQL Migration: Quota Isn't SKU Availability
I assumed that if the quota page showed free cores, the server would get created. Today I tried to create an Azure Database for PostgreSQL server in the Seoul region, and that assumption didn't hold. Quota decides how many cores you may use. SKU availability decides whether the region will give your subscription that tier at all. The two are independent. Moving the data itself ran into three problems: collation, index layout, and one DSQL-only syntax.
Why we moved to managed PostgreSQL
Our search workload used a Postgres-compatible database on AWS Aurora DSQL. Being serverless was convenient, but its SQL differed from standard Postgres in small ways. We also wanted vector search, and DSQL doesn't support pgvector.
Without the milestone period, I probably would have left it alone. Since we had a reason to move, we picked Azure Database for PostgreSQL Flexible Server. We looked at Azure AI Search as a dedicated vector service, but it was too much for a team our size. One Postgres server handling both relational data and vectors fit better.
We chose Burstable B2s (2 vCores, 4 GB RAM). At list price that's about $2 a day, which is plenty for a database we only query now and then.
Three snags getting data out of DSQL
My work PC didn't have pg_dump, so Claude Code and I wrote a small script that copies each table with psycopg's COPY. The whole dataset is a few hundred MB, so copying took about ten minutes. The problems only showed up afterwards.
First, indexes. DSQL attaches all the remaining columns to primary keys and indexes with INCLUDE. On standard Postgres, a column holding long text pushed index rows over the size limit. We dropped the INCLUDE part and kept the key columns, so lookups behave the same.
Second, sort order. Every row count matched, but order by returned rows in a different order. The databases had different default collations. We recreated the database with the C collation, copied again, and the order matched exactly.
Third, code. Three scripts used DSQL's CREATE INDEX ASYNC, so we changed them to a plain CREATE INDEX.
pgvector doesn't work right away on Flexible Server. You first add it to the azure.extensions server parameter allowlist.
-- after adding VECTOR and PG_TRGM to the azure.extensions server parameter
CREATE EXTENSION IF NOT EXISTS vector;
CREATE INDEX ON items USING hnsw (embedding vector_cosine_ops);
We didn't stop at matching row counts. For each table we sorted every row and compared hashes, and found zero differences. Only after that did we delete the old DSQL clusters.
Honestly, getting back to standard Postgres was a relief. Turning on pgvector and pg_trgm (a trigram text-search index) with one allowlist entry was better than I expected.
Why Seoul said no
We first put the server in Spain Central, close to the workers reading the database at the time. It was this subscription's first PostgreSQL server, so we had to register the resource provider first. After that, creation went through right away.
Later that afternoon we confirmed that most queries actually come from Asia, so we tried to move the server to Seoul. Korea Central rejected B2s with SkuNotAvailable in availability zones 1, 2, and 3. Zone 3 showed the server as provisioning for a few minutes, then failed anyway.
Korea South returned "location is restricted." It's Seoul's paired region, so it seems to be closed to new subscriptions by default.
We checked quota through the API, and Burstable in Seoul showed 0 of 40 cores used. So there was plenty of quota, but the tier wasn't being offered to us. Microsoft doesn't say why. My guess is that busy regions hold back cheap tiers for some subscription types, but that's an inference, not something we confirmed.
Without Burstable, the smallest option in Seoul is a 2-vCore General Purpose tier at about $6 a day. Paying three times as much for the same job made no sense. We also looked at the preview HorizonDB, but it costs more and has no SLA.
Where it ended up
We tried the same B2s in Southeast Asia (Singapore), and it was created right away. We gave it the same admin account, read-only account, passwords, and database names as the Spain server. So after the move, the only change anyone needed was the host address.
The second migration went much faster than the first. We used the same script and the same hash check, and again found zero differences. Then we deleted the Spain server.
There was a trade-off. The web app runs in Korea Central and the database in Singapore, so pages that run many queries take a little over a second. Putting both in one region would be better. This time the tier restriction decided for us.
How it felt: on AWS, picking a region was usually the end of it. On Azure, quota, SKU availability, and region access are separate gates, so you often only find out by trying to create the resource. That part still bothers me. The CLI doesn't help either: some PostgreSQL commands take --name and others take --server-name, and I got it wrong several times today.
There's one risk left. Several clients need to connect, so the database firewall is still wide open. The server accepts only SSL connections, and the read-only account can't write, but this setup is temporary. Until we narrow who can connect or move to private access, this server is our weakest point.
Also today
- We tested GPU node allocation across regions with Azure ML low-priority compute. The only region where an 8×H100 node actually came up was eastus2. There was no capacity for 8×A100 80GB in any of the five regions we tried. So eastus2 is now our main GPU region.
- App Service quota in Southeast Asia was zero for every tier, so the app went to Korea Central. ZIP deploy failed with a 503, so we switched to container deploys. The image is now built inside ACR (
az acr build), and the app's managed identity has AcrPull to pull it. - We put Azure Front Door Standard in front of the app. Until the managed certificate reaches the edge, which can take tens of minutes, browsers show a name-mismatch warning. If the domain uses HSTS, the browser won't even let you click through. It's not a misconfiguration, so you just wait.