Skip to content

Commit ed67a5e

Browse files
Merge pull request #7585 from deeikele/terraform-samples
add azurerm samples
2 parents 936b062 + 75e7e97 commit ed67a5e

File tree

1 file changed

+36
-16
lines changed

1 file changed

+36
-16
lines changed

articles/ai-foundry/how-to/create-resource-terraform.md

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,23 @@ ai-usage: ai-assisted
1515
#customer intent: As a Terraform user, I want to see how to configure Azure AI Foundry using Terraform, so I can automate my setup.
1616
---
1717

18-
# Use Terraform to create Azure AI Foundry resource
18+
# Use Terraform to manage Azure AI Foundry resources
1919

20-
In this article, you use Terraform to create an [Azure AI Foundry](https://ai.azure.com/?cid=learnDocs) resource. You learn how to use Terraform to create AI Foundry management configurations including projects, deployments, and connections.
20+
In this article, you use Terraform to manage an [Azure AI Foundry](https://ai.azure.com/?cid=learnDocs) resource. You learn how to use Terraform to manage AI Foundry management configurations including projects, deployments, and connections.
2121

22-
The examples used in article use the [AzAPI](/azure/developer/terraform/overview-azapi-provider) Terraform provider. Similar [AzureRM](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/ai_services) provider support is available via the classic `AzureRM_AIServices` module (using the `aiservices` kind as its value), but is limited in functionality to resource and deployment creation.
22+
You can use either the Terraform [AzAPI Provider](/azure/developer/terraform/overview-azapi-provider) or [AzureRM Provider](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/cognitive_account) to manage Azure AI Foundry resources. While the AzAPI provider lets you access all Foundry control plane configurations including preview features, the AzureRM variant is limited to core management capabilities:
23+
24+
|Action|AzAPI Provider|AzureRM Provider|
25+
| --- | --- | --- |
26+
| Create a resource group |||
27+
| Create an AI Foundry resource |||
28+
| Configure deployments |||
29+
| Configure projects || - |
30+
| Configure a connection to knowledge and tools || - |
31+
| Configure a capability host (for advanced tool configurations like [Agent standard setup](../agents/concepts/capability-hosts.md)) || - |
2332

24-
[!INCLUDE [About Terraform](~/azure-dev-docs-pr/articles/terraform/includes/abstract.md)]
2533

26-
> [!div class="checklist"]
27-
> * Create a resource group
28-
> * Create an AI Foundry resource.
29-
> * Configure projects.
30-
> * Configure deployments.
31-
> * Configure a connection to other resources.
32-
> * Configure capability host to bring your own storage with Agent service.
34+
[!INCLUDE [About Terraform](~/azure-dev-docs-pr/articles/terraform/includes/abstract.md)]
3335

3436
## Prerequisites
3537

@@ -39,10 +41,7 @@ The examples used in article use the [AzAPI](/azure/developer/terraform/overview
3941

4042
## Implement a basic AI Foundry configuration using Terraform code
4143

42-
> [!NOTE]
43-
> The sample code for this article is located in the [Azure Terraform GitHub repo](https://github.com/Azure/terraform/tree/master/quickstart/101-azure-ai-foundry). You can view the log file containing the [test results from current and previous versions of Terraform](https://github.com/Azure/terraform/tree/master/quickstart/101-azure-ai-foundry/TestRecord.md). You may need to update the resource provider versions used in the template to use the latest available versions.
44-
>
45-
> See more [articles and sample code showing how to use Terraform to manage Azure resources](/azure/terraform)
44+
# [AzAPI Provider](#tab/azapi)
4645

4746
1. Create a directory in which to test and run the sample Terraform code and make it the current directory.
4847

@@ -58,6 +57,24 @@ The examples used in article use the [AzAPI](/azure/developer/terraform/overview
5857

5958
:::code language="Terraform" source="~/foundry-samples-main/samples/microsoft/infrastructure-setup-terraform/00-basic/code/variables.tf":::
6059

60+
# [AzureRM Provider](#tab/azurerm)
61+
62+
1. Create a directory in which to test and run the sample Terraform code and make it the current directory.
63+
64+
1. Create a file named `providers.tf` and insert the following code.
65+
66+
:::code language="Terraform" source="~/foundry-samples-main/samples/microsoft/infrastructure-setup-terraform/00-basic-azurerm/code/providers.tf":::
67+
68+
1. Create a file named `main.tf` and insert the following code.
69+
70+
:::code language="Terraform" source="~/foundry-samples-main/samples/microsoft/infrastructure-setup-terraform/00-basic-azurerm/code/main.tf":::
71+
72+
1. Create a file named `variables.tf` and insert the following code.
73+
74+
:::code language="Terraform" source="~/foundry-samples-main/samples/microsoft/infrastructure-setup-terraform/00-basic-azurerm/code/variables.tf":::
75+
76+
---
77+
6178
## Initialize Terraform
6279

6380
[!INCLUDE [terraform-init.md](~/azure-dev-docs-pr/articles/terraform/includes/terraform-init.md)]
@@ -87,5 +104,8 @@ See the [Azure AI Foundry Samples](https://github.com/azure-ai-foundry/foundry-s
87104
## Next steps
88105

89106
> [!div class="nextstepaction"]
90-
> [See more articles about Azure AI Foundry hub](/search/?terms=Azure%20ai%20hub%20and%20terraform)
107+
> [See AzureRM reference docs for Azure AI Foundry](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/cognitive_account)
108+
> [Terraform Azure Verified Module sample](https://github.com/Azure/terraform-azurerm-avm-res-cognitiveservices-account)
109+
> [Learn more about AzAPI provider](/azure/developer/terraform/overview-azapi-provider)
110+
91111

0 commit comments

Comments
 (0)