Azure setup
Azure AI Foundry
Create the Azure OpenAI resource in Foundry, deploy a structured-output model, and verify the deployment in the playground.
By the end of this stage you have a deployed language model on Azure and you know its endpoint, deployment name, and key. The build wires these into the backend later; for now the goal is a working deployment you have tested yourself.
Provisioning comes before application code on purpose. Region, quota, tier, and model availability should fail independently, not in the middle of building a feature.
daveebbelaar/invoice-review0:37:14What Foundry is
Azure AI Foundry is Microsoft's platform for working with models on Azure, including the Azure OpenAI models this project uses. The portal at ai.azure.com is where you browse the model catalog, create deployments, and try models in a playground. Under the hood, a Foundry project is backed by an ordinary Azure resource in your subscription, which is why it shows up in your resource group and your bill like everything else.
One vocabulary point saves a lot of confusion. On Azure you do not call "the GPT API". You create a resource, then create a deployment of a specific model inside it, and your code addresses that deployment by name. Same model, your own endpoint, your own quota.
Create the resource and deployment
In the Foundry portal:
- Create a new project, and when asked for the underlying resource, create one in
rg-invoice-reviewso it shares the project's lifecycle - Open the model catalog and pick a model that supports structured outputs. Dave uses
gpt-5.6-terraas a Global Standard deployment in Sweden Central - Deploy it and keep the deployment name, you will reference it from the backend configuration later
Model availability differs per region. If your chosen region does not offer the model, deploy in a region that does. The model deployment does not have to live in the same region as the rest of the resource group; that costs you nothing but a little latency.
Verify the deployment from the CLI, so the state is explicit:
az cognitiveservices account deployment show \
--name <your-foundry-resource-name> \
--resource-group rg-invoice-review \
--deployment-name gpt-5.6-terra \
--query '{state:properties.provisioningState,model:properties.model,sku:sku}' \
--output json
# "state": "Succeeded"Test it in the playground
Open the playground in the Foundry portal, select your deployment, and send it a prompt. A response proves the deployment is live and your quota works before any code depends on it.
Then collect the three values the backend will need during the build:
- The endpoint, on the resource's overview page
- The deployment name you chose
- An API key, under the resource's keys section
You do not have to store them anywhere special. Both the portal and the CLI can show them again whenever the build reaches environment configuration.
What this costs
Azure OpenAI is token metered, and you pay per deployment usage rather than a subscription fee. This project sends short documents and receives structured JSON back, a few thousand tokens per call. The complete build stays well under a dollar of token spend, far inside the free credit.
Checkpoint
- The Foundry deployment reports
Succeeded - The playground returns a response from your deployment
- You know where to find the endpoint, deployment name, and key