Prepstellar
Get it on Google Play

AI-103 · Setting Up and Deploying in Foundry

17 cards

Configuring Model Deployments

Swipe, scroll or use ← →
  1. What a model deployment is

    A model in the catalog is a description. A deployment is the running thing your code calls, with its own name, type and quota.

    You deploy a Foundry Model in a Foundry resource to make it available for inference, and the deployment is then available when you specify the deployment name in your requests. By default, the deployment uses the model name, and you can modify this name before deploying. During inference, the deployment name is used in the model parameter to route requests to that particular deployment.

    A request names a deployment in its model field, so the shared endpoint routes it to chat-prod even though chat-test runs the same model.requestmatchskipClient appmodel: chat-prod/openai/v1/Foundry resourcechat-testgpt-4o-minichat-prodgpt-4o-mini
    Both deployments serve gpt-4o-mini behind one endpoint. Only the deployment name in the request decides which one answers.
    1 / 17
  2. What a model deployment is

    Because the name is the address, one model can sit behind several addresses. You can deploy the same model multiple times as long as you give each deployment a different deployment name. This is useful when you want to test different configurations for a given model, including content filters.

    A practical pattern: keep chat-prod with your production content filter, and create chat-test from the same model with a stricter filter. Your test harness sends the same prompts to both names and compares the results.

    2 / 17
  3. Quick check

    Two deployments in one resource both run gpt-4o-mini. What lets a request reach the right one?

    1. AThe model version sent along with the prompt

      Both deployments run the same model, so a version cannot tell them apart. Requests name the deployment itself.

    2. BThe deployment name placed in the model parameter

      Right. The deployment name is used in the model parameter to route requests to that particular deployment, which is what keeps chat-prod and chat-test apart.

    3. CThe catalog model name placed in the model parameter

      The catalog name is shared by both deployments here. It only works by accident when a deployment keeps its default name and is the only one for that model.

    3 / 17

  4. Permissions and Azure Marketplace

    Two separate permission questions come up before the first deployment: can you create deployments at all, and may you buy the model you picked?

    To create and manage deployments, you need the Cognitive Services Contributor role or equivalent permissions on the Foundry resource. Without it, deployment fails with an authorization error, and the resolution is to assign that role on the Foundry resource.

    Foundry Models from partners and community, such as Llama-4-Scout-17B-16E-Instruct, require that you subscribe to Azure Marketplace before deployment. Foundry Models sold by Azure, such as Azure OpenAI in Foundry Models, don't have this requirement.

    4 / 17
  5. Permissions and Azure Marketplace

    The Marketplace subscription has its own permissions, separate from the Foundry resource role. Subscribing needs Marketplace permissions on the Azure subscription, and the Owner and Contributor built-in roles on the subscription include them; otherwise you need a custom role with the listed actions. Creating and using the SaaS resource also needs Microsoft.SaaS/resources/read and Microsoft.SaaS/resources/write on the resource group. The Microsoft.SaaS/register/action permission is a one-time registration of the SaaS resource provider on the subscription, so it doesn't need to be repeated for each deployment.

    Question Where the permission lives What grants it
    May I create deployments? The Foundry resource Cognitive Services Contributor
    May I subscribe to a partner model? The Azure subscription and resource group Owner or Contributor on the subscription, or a custom role with both sets of actions
    5 / 17
  6. Quick check

    A principal can deploy Phi models but fails on a Cohere model with a Marketplace error. Where is the missing permission?

    1. AOn the Foundry resource, as a stronger deployment role

      The principal already creates deployments successfully, so its role on the Foundry resource is fine. The failure is about buying the partner model.

    2. BOn the Foundry project, as the Foundry User role

      Foundry User governs work inside a project, such as building agents. Marketplace subscriptions are not granted at project scope.

    3. COn the Azure subscription, for Marketplace actions

      Right. Partner and community models such as Cohere need an Azure Marketplace subscription, and the permissions for it sit on the Azure subscription, where Owner or Contributor include them.

    6 / 17

  7. Deploy in the Foundry portal

    The portal path is the quickest way to get one deployment running and see it answer.

    In the portal, you select Discover and then Models, open a model card, and choose Deploy, either with Custom settings to customize the deployment or with Default settings. For a partner model, you read the terms of use and select Agree and Proceed. When the deployment completes, you land in the playground, and you verify that the deployment status shows Succeeded. Your project and resource must be in one of the supported regions of deployment for the model.

    7 / 17
  8. Deploy in the Foundry portal

    After the first deployment, you manage them from a different place. To manage deployments, you select Build and then Models to see the list of deployments in the resource. From a deployment's detail page, you can view endpoint details and keys, adjust deployment settings, or delete a deployment that you no longer need. In the playground, the Code tab shows how to access the deployment programmatically.

    Remember the two entry points: Discover is where you find and deploy a model, and Build is where you manage what you already deployed.

    8 / 17
  9. Quick check

    A developer wants to check the keys of an existing deployment and then delete an old one. Where in the portal?

    1. ABuild, then Models, then the deployment's detail page

      Right. Build and Models list the deployments in the resource, and a deployment's detail page shows endpoint details and keys and lets you delete it.

    2. BDiscover, then Models, then the model card

      Discover is where you browse the catalog and start a new deployment from a model card, not where existing deployments are managed.

    3. CThe playground's Code tab for that deployment

      The Code tab shows how to call the deployment from code. It does not manage keys or delete deployments.

    9 / 17

  10. Keep your progress in the app

    That’s 3 of 6 quick checks. In the app they stay answered, and every lesson remembers where you left off.

    Get it on Google Play Keep reading here
  11. Deploy with Azure CLI and Bicep

    Scripts and templates make deployments repeatable across environments, which the portal cannot do.

    The az cognitiveservices commands are part of the core Azure CLI, version 2.60 or later, so no extra extension is required. az cognitiveservices account list-models lists the model definitions available to you and under which SKU. Each deployment type is represented by a SKU code in the CLI and ARM. To deploy, you need the model's name, format, version, and sku, where format indicates the provider offering the model; depending on the type of deployment, you might also need capacity.

    10 / 17
  12. Deploy with Azure CLI and Bicep

    az cognitiveservices account deployment create adds the deployment, with --deployment-name, --model-name, --model-version, --model-format, --sku-capacity, and --sku-name (for example, GlobalStandard). az cognitiveservices account deployment show confirms that the provisioningState is Succeeded, and the list and delete subcommands view and remove deployments. With Bicep, you describe the deployment in a template and run it with az deployment group create.

    Flag What it sets
    --deployment-name The name requests will use
    --model-name, --model-version Which model and version
    --model-format The provider offering the model
    --sku-name The deployment type, such as GlobalStandard
    --sku-capacity How much capacity

    If a command isn't recognized, your Azure CLI is out of date: update to version 2.60 or later with az upgrade.

    11 / 17
  13. Quick check

    A build agent fails on az cognitiveservices account deployment create with a command not recognized error. What is the fix?

    1. AInstall the cognitiveservices CLI extension on the build agent

      No extension is needed: the az cognitiveservices commands are part of the core Azure CLI. Installing one would not address an outdated CLI.

    2. BAssign Cognitive Services Contributor to the build agent's identity

      A missing role produces an authorization error, not an unrecognized command. The CLI never got far enough to check permissions.

    3. CUpdate the Azure CLI to version 2.60 or later with az upgrade

      Right. An unrecognized command means the Azure CLI is out of date, and az upgrade brings it to 2.60 or later, where the commands are built in.

    12 / 17

  14. Call the deployment from code

    Once the deployment shows Succeeded, your code needs two things: the route and the name.

    To make requests with the OpenAI v1 API, call the /openai/v1/ route on the endpoint URL and pass the deployment name in the model field of your request. The /openai/v1/ route uses implicit versioning, so you don't pass an api-version.

    So switching an application from one deployment to another in the same resource changes a single value. The base URL and the authentication stay the same, and only the deployment name in the model field moves from, say, chat-prod to chat-v2.

    13 / 17
  15. Quick check

    An app on the /openai/v1/ route must move from deployment chat-prod to chat-v2 in the same resource. What changes?

    1. AOnly the deployment name in the model field

      Right. Every deployment in the resource sits behind the same route, and the deployment name in the model field picks the target.

    2. BThe base URL, which must include chat-v2

      The base URL is shared by the deployments in the resource; the deployment is chosen in the request body, not in this URL.

    3. CAn api-version parameter must be added for chat-v2

      The /openai/v1/ route uses implicit versioning, so you don't pass an api-version for any deployment.

    14 / 17

  16. Quota for deployments

    Every deployment draws from a shared pool, and when the pool is empty, new deployments stop.

    Deploying and running inference consume quota that Azure assigns to your subscription on a per-region, per-model basis, in units of tokens per minute (TPM). You assign TPM to each deployment as you create it, which reduces the available quota for that model.

    When you reach your quota limit, you can only create new deployments of that model if you request more quota by submitting a quota increase form, or adjust the allocated quota on other model deployments to free up tokens for new deployments.

    15 / 17
  17. Quota for deployments

    Picture the pool as belonging to the subscription, the region and the model together. A new deployment name, a second resource or a new project in the same subscription and region all draw from that same pool. Only two moves create room:

    Move Effect
    Request more quota The pool for that model and region grows
    Lower TPM on other deployments Tokens return to the pool for the new deployment
    16 / 17
  18. Quick check

    Quota for a model in one region is fully allocated, and a low-traffic test deployment holds a large share. A new production deployment is needed now, without any quota increase. What works?

    1. ALower the TPM allocated to the test deployment, then deploy

      Right. Adjusting the allocated quota on other deployments frees tokens, and that is the move left when more quota cannot be requested.

    2. BCreate a second Foundry resource in the same region

      Quota is assigned to the subscription per region and per model, so a second resource in the same region shares the exhausted pool.

    3. CGive the production deployment a different deployment name

      A deployment name only routes requests. Every deployment of that model in that region still draws from the same pool.

    17 / 17

  19. 6 quick checks · then the test

    In the app, finishing the quick checks opens this lesson’s 10-question test, and the ones you miss come back exactly when you’re about to forget them.

← Previous Get it on Google Play Next card →

The whole course, on your phone

Lessons you can read, audio you can listen to on the way to work, and practice that remembers what you got wrong.

Get it on Google Play

“This app is the ‘One Lake’ for preparing the certification exams. Really worth it.”

Abdelhak Y. Google Play review