แก้ไข

แชร์ผ่าน


Quickstart: Deploy a Microsoft Foundry resource by using a Bicep file

In this quickstart, you deploy a Microsoft Foundry resource and project by using a Microsoft Bicep template. Bicep helps you create related resources in one coordinated deployment and reuse the same configuration across environments.

Tip

For production-ready Bicep templates that cover common Foundry deployment scenarios, see the infrastructure-setup-bicep folder in the Foundry samples repository. Clone the repository and customize the templates instead of starting from scratch.

Prerequisites

An Azure account with an active subscription. If you don't have one, create a free Azure account, which includes a free trial subscription.

Get the sample files:

git clone https://github.com/Azure-AI-Foundry/foundry-samples
cd foundry-samples/infrastructure/infrastructure-setup-bicep/00-basic

Deploy the Bicep file

Deploy the Bicep file by using either Azure CLI or Azure PowerShell:

az group create --name exampleRG --location eastus
az deployment group create --resource-group exampleRG --template-file main.bicep --parameters aiFoundryName=myai aiProjectName=myai-proj 

Reference: az group create, az deployment group create.

Note

Replace myai with the name of your resource. exampleRG is the name of the resource group, and eastus is the Azure region where resources are deployed.

When the deployment finishes, you see a message indicating the deployment succeeded (output displays: "provisioningState": "Succeeded"). This confirms that your Foundry resource and project have been created.

Review the Bicep file (optional)

Optionally, review the Bicep template to understand the resource definitions.

You can find the Bicep file used in this article at https://github.com/azure-ai-foundry/foundry-samples/tree/main/infrastructure/infrastructure-setup-bicep/00-basic.

This template creates the following resources:

Review deployed resources

Use the Foundry portal to view the created resources. You can also use Azure CLI or Azure PowerShell to list the resources.

az resource list --resource-group exampleRG

Clean up resources

If you plan to continue working with subsequent quickstarts and tutorials, you can keep the resources you created in this quickstart. If you want to remove the resources, use the following command.

az group delete --name exampleRG

Reference: az group delete