Prerequisites
To complete this article, you need the following:- An Azure subscription.
- A Foundry project. This project type is managed under a Foundry resource. If you don’t have a Foundry project, see Create a project for Microsoft Foundry.
- Azure role-based access control (RBAC) permissions to create and manage deployments. You need the Cognitive Services Contributor role or equivalent permissions for the Foundry resource.
- Foundry Models from partners and community require access to Azure Marketplace. Ensure you have the permissions required to subscribe to model offerings. Foundry Models sold by Azure don’t have this requirement.
-
Install the Azure CLI (version 2.60 or later). The
az cognitiveservicescommands used in this article are part of the core CLI, so no extra extension is required. -
Some commands in this tutorial use the
jqtool, which might not be installed on your system. For installation instructions, see Downloadjq. -
Identify the following information:
- Your Azure subscription ID
- Your Foundry resource name
- The resource group where you deployed the Foundry resource
-
The model name, provider, version, and SKU you want to deploy. Use the Foundry portal or the Azure CLI to find this information. In this example, you deploy the following model:
- Model name:
Phi-4-mini-instruct - Provider:
Microsoft - Version:
1 - Deployment type: Global standard
- Model name:
Permissions required to subscribe to Models from partners and community
Foundry Models from partners and community available for deployment (for example, Cohere models) require Azure Marketplace. Model providers define the license terms and set the price for use of their models using Azure Marketplace. When deploying third-party models, ensure you have the following permissions in your account:- On the Azure subscription:
Microsoft.MarketplaceOrdering/agreements/offers/plans/readMicrosoft.MarketplaceOrdering/agreements/offers/plans/sign/actionMicrosoft.MarketplaceOrdering/offerTypes/publishers/offers/plans/agreements/readMicrosoft.Marketplace/offerTypes/publishers/offers/plans/agreements/readMicrosoft.SaaS/register/action- On the resource group—to create and use the SaaS resource:
Microsoft.SaaS/resources/readMicrosoft.SaaS/resources/writeThe Owner and Contributor built-in roles on the Azure subscription include these permissions. If you don’t have the required permissions, ask your subscription administrator to assign you the Contributor role, or create a custom role that includes the listed actions.
The remaining sections in this article are identical for both the CLI and Bicep approaches.
Use the model
You can consume deployed models using the Endpoints for Foundry Models for the resource. When you construct your request, specify the parametermodel and insert the model deployment name you created. You can programmatically get the URI for the inference endpoint by using the following code:
Inference endpoint
/openai/v1/ route on the endpoint URL, https://<resource-name>.openai.azure.com/openai/v1/ 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.
See the Azure OpenAI v1 API reference for all supported operations.
Inference keys
Manage deployments
Use the CLI to view all available deployments:-
Run the following command to see all the active deployments:
Reference: az cognitiveservices account deployment list
-
Run the following command to see the details of a given deployment:
Reference: az cognitiveservices account deployment show
-
Run the following command to delete a given deployment:
Reference: az cognitiveservices account deployment delete
Troubleshooting
Related content
- Elevated-role tasks in Microsoft Foundry — role requirements for model deployment and quota management.
- Generate text responses with Foundry Models
- Deployment types in Foundry Models
- Instant access to models in Microsoft Foundry (preview)
- Deploy Foundry Models to managed compute
- Quotas and limits for Foundry Models