Container Apps job cold start: 8 min to 1.8 with Blob
Our GPU job runs in East US, but the container image it needed lived in a registry in Seoul. This post answers a simple question: how do you speed up a Container Apps job that is slow because its registry sits in another region? Our answer wasn't ACR geo-replication. We moved to a small public base image plus same-region Blob Storage, and startup dropped from about 8 minutes to about 1.8.
Why did Advisor suggest geo-replication?
Today I went through all 70 Azure Advisor recommendations one by one. One of them was geo-replication for Azure Container Registry (ACR). Our speech transcription job is a Container Apps serverless GPU job that starts a few times a day in East US. Every start pulled a multi-GB image across from the Seoul registry.
We already ran into big-image cold starts in Day 2. Back then we only batched runs to cut how often it happened. We never questioned where the image lived. And the minutes spent pulling it are billed as GPU job time.
Following Advisor would have been easy. But geo-replication needs the Premium tier, and each replica costs about as much as another registry (roughly $50 a month at public prices).
Replicate, add a registry, or use Blob?
We had three options:
- Replicate ACR to East US: no code changes, but a permanent monthly increase.
- Add a Standard ACR in East US: cheaper, but now there are two build-and-push paths.
- Shrink the image: use a public base image only, and pull packages, model and code from Blob in the same region.
I leaned toward replication at first. Looking again, Advisor had pointed at a symptom, and the cause was our design. If the GPU job runs in East US, its inputs should live in East US too. So we picked option three.
What does the new setup look like?
I handed the restructuring to a Claude Code subagent and checked the result myself.
- Image: the Python 3.11 slim mirror on Microsoft Container Registry (MCR). It's fast inside Azure and avoids Docker Hub's anonymous pull limits.
- Start command: a few-line bootstrap. It uses the job's system-assigned managed identity (an Azure identity that needs no stored key) to get a token, then fetches a boot script from Blob.
- Blob: we only added one container to a storage account that already existed in East US. Same region means no transfer charges.
- Permissions: the job identity gets Storage Blob Data Reader on that one container only. No keys in the image or in environment variables.
- Packages: one tar bundle of about 7 GB, with the date in the file name for versioning.
# Concept of the start command (names generalized)
token = get_managed_identity_token("https://storage.azure.com/")
boot = http_get(f"{BLOB_URL}/code/boot.py", bearer=token)
exec(boot) # boot.py pulls the bundle, model and code, then starts the job
Three test runs finished and wrote their results correctly. We kept the old image and registry for rollback. ACR stays anyway, since our web container still uses it.
There is a trade-off. When everything was baked into one image, it was obvious what version ran. Now we rely on bundle names and boot logs to trace that. Honestly, this setup turned out cleaner than I expected. Shipping code now means uploading to Blob instead of rebuilding a large image, so deploys got faster too.
One setting caught before the first scheduled run
In the evening I had a review agent go over the automation once more. It found something urgent. The Functions app that launches the job still had an app setting pointing at the old image. Our code reads that setting before its own default.
Left alone, tomorrow's first scheduled run would have used the old image with the new bootstrap, a combination we never tested. We confirmed the deployed code was the new version, then deleted that single app setting.
That one rattled me a bit. The code was right and the tests passed, yet an app setting was quietly overriding the code. Now that the work runs on Azure instead of in front of me, this kind of thing is invisible. I won't fully relax until tomorrow morning's report email lands.
Correction: the $41 per day in Day 4 was the total bill for 11-16. We now treat about $33 as a normal day. The earlier number wasn't wrong; it used a different basis.
If you're dragging something heavy across regions, ask whether it really needs to be inside the image before you pay for replication.
Also today
- Azure Communication Services Email: alert mail now goes through ACS first and falls back to our previous mail path on failure. We added 4 DNS records for the domain and saw 202 Accepted from inside a Function.
- Event Grid: a timer that scanned Blob every 2 minutes became a BlobCreated event trigger; the timer stays as an hourly backup.
- Key Vault references: 19 Function app settings now point to Key Vault. The Windows shell mangled
;and parentheses in az CLI arguments, so we patched the settings through the ARM REST API instead.