Skip to content

Commit 737257f

Browse files
authored
Merge pull request #278492 from JnHs/jh-copilot-terr
terraform scenario
2 parents b90e99b + be8bc85 commit 737257f

File tree

4 files changed

+42
-0
lines changed

4 files changed

+42
-0
lines changed

articles/copilot/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
href: generate-cli-scripts.md
4141
- name: Generate PowerShell scripts
4242
href: generate-powershell-scripts.md
43+
- name: Generate Terraform infrastructure
44+
href: generate-terraform-configurations.md
4345
- name: Author API Management policies
4446
href: author-api-management-policies.md
4547
- name: Work with AKS clusters

articles/copilot/capabilities.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Use Microsoft Copilot in Azure to perform many basic tasks in the Azure portal o
4141
- Write and optimize code:
4242
- [Generate Azure CLI scripts](generate-cli-scripts.md)
4343
- [Generate PowerShell scripts](generate-powershell-scripts.md)
44+
- [Generate Terraform configurations](generate-terraform-configurations.md)
4445
- [Discover performance recommendations with Code Optimizations](optimize-code-application-insights.md)
4546
- [Author API Management policies](author-api-management-policies.md)
4647
- [Create Kubernetes YAML files](generate-kubernetes-yaml.md)
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
title: Generate Terraform configurations using Microsoft Copilot in Azure
3+
description: Learn about scenarios where Microsoft Copilot in Azure can generate Terraform configurations for you to use.
4+
ms.date: 06/17/2024
5+
ms.topic: conceptual
6+
ms.service: copilot-for-azure
7+
ms.author: jenhayes
8+
author: JnHs
9+
---
10+
11+
# Generate Terraform configurations using Microsoft Copilot in Azure
12+
13+
Microsoft Copilot in Azure (preview) can generate Terraform configurations that you can use to create and manage your Azure infrastructure.
14+
15+
When you tell Microsoft Copilot in Azure about some Azure infrastructure that you want to manage through Terraform, it provides a configuration using resources from the [AzureRM provider](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs). In addition to the primary resources, any dependent resources required to accomplish a successful deployment are included in the configuration. You can ask follow-up questions to further customize the configuration. Once you've reviewed the configuration and are happy with it, copy the configuration contents and deploy the configuration using your Terraform deployment method of choice.
16+
17+
The requested Azure infrastructure should be limited to fewer than eight primary resource types. For example, you should see good results when asking for a configuration to manage a resource group that contains Azure Container App, Azure Functions, and Azure Cosmos DB resources. However, requesting configurations to fully address complex architectures may result in inaccurate results and truncated configurations.
18+
19+
[!INCLUDE [scenario-note](includes/scenario-note.md)]
20+
21+
[!INCLUDE [preview-note](includes/preview-note.md)]
22+
23+
## Sample prompts
24+
25+
Here are a few examples of the kinds of prompts you can use to generate Terraform configurations. Modify these prompts based on your real-life scenarios, or try additional prompts to create different kinds of queries.
26+
27+
- "Create a Terraform config for a Cognitive Services instance with name 'mycognitiveservice' and S0 pricing tier. I need it to have the Text Analytics and Face APIs enabled, and I also need the access keys for authentication purposes."
28+
- "Show me a Terraform configuration for a virtual machine with a size of 'Standard_D2s_v3' and an image of 'UbuntuServer 18.04-LTS'. The resource should be placed in the West US location and have a public IP address. Additionally, it should have a managed disk with a size of 50 GB and be part of a virtual network."
29+
- "Create Terraform configuration for a container app resource with name 'myapp' and Linux OS. Specify the Docker image to be pulled from 'myrepository' and use port 80 for networking. Set the CPU and memory limits to 2 and 4GB respectively. Enable automatic scaling based on CPU usage and set the scaling range between 2 to 10 instances. Also, configure environment variables and mount a storage account for persistent data."
30+
- "What is the Terraform code for a Databricks workspace in Azure with name 'myworkspace' and a premium SKU. The workspace should be created in the West US region. I also need to enable workspace-wide access control with Microsoft Entra integration."
31+
- "Use Terraform to create a new Azure SQL database named 'mydatabase' with Basic SKU and 10 DTU. Set the collation to 'SQL_Latin1_General_CP1_CI_AS' and enable Microsoft Entra authentication. Also, enable long-term backup retention and configure geo-replication to a secondary region for high availability."
32+
33+
## Next steps
34+
35+
- Explore [capabilities](capabilities.md) of Microsoft Copilot in Azure.
36+
- Learn more about [Terraform on Azure](/azure/developer/terraform/overview).

articles/copilot/index.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ conceptualContent:
9090
- url: ./generate-powershell-scripts.md
9191
itemType: get-started
9292
text: Generate PowerShell scripts
93+
- url: ./generate-terraform-configurations.md
94+
itemType: get-started
95+
text: Generate Terraform configurations
9396
- url: ./generate-kubernetes-yaml.md
9497
itemType: get-started
9598
text: Generate Kubernetes YAML files

0 commit comments

Comments
 (0)