With the embedding model question settled in part 2, the next step was the actual storage: a Cosmos DB container to hold the vectors. This is where the real debugging started.
Azure Cosmos DB's vector search needs a vector policy defined directly on a container, and that policy is immutable once the container exists, no adding it later, no changing it, only dropping and recreating. So this had to be a brand new container, not a field bolted onto the existing one holding my blog articles.
The first deployment attempt failed:
A Container Vector Policy has been provided, but the capability has
not been enabled on your account.
Fair enough, I'd missed enabling the account-level vector search feature. I turned it on and tried again. Same error. Three times.
The actual problem had nothing to do with the capability, which was in fact already enabled. Cosmos DB's vector search simply isn't supported in a database that has shared throughput provisioned at the database level, and my existing database did, several containers there share one pool of request units. Giving the new container its own dedicated throughput didn't matter, because the restriction is on the database it lives in, not the specific container. The fix was a second, separate database with no throughput of its own, holding just this one container.
Once that deployed cleanly, a second, sharper issue showed up only once I actually tried to query the data. Writes worked. Point-reads worked. Running an actual SELECT query, which is exactly what vector search retrieval depends on, came back with a permissions error:
does not have the required RBAC permissions to perform action
[.../executeQuery]
Turns out reading a single document by ID and running a query are two entirely separate permissions in Cosmos's RBAC model. I'd granted read, but not query execution, an easy thing to miss since nothing about "read access" suggests querying should need something extra.
Both are fixed now, and the container actually does what it's supposed to: store vectors, and let something outside Azure query them by similarity. Next up: proving what gets stored in it is actually useful, which is its own story.