Skip to content

Commit 37ed641

Browse files
committed
Add gpt-35-turbo model deployment to v1 Bicep and Terraform
1 parent 1a55d37 commit 37ed641

File tree

2 files changed

+56
-1
lines changed

2 files changed

+56
-1
lines changed

IaC/Bicep/v1/deploy.bicep

+23
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ param location string = resourceGroup().location
55

66
param azureOpenAISku string = 'S0'
77

8+
param openai_deployment_name string = 'b59-gpt35-turbo'
9+
810
var resourceTags = {
911
project: 'https://github.com/build5nines/AIChatUI'
1012
}
@@ -26,3 +28,24 @@ resource azureopenai 'Microsoft.CognitiveServices/accounts@2023-10-01-preview' =
2628
publicNetworkAccess: 'Enabled'
2729
}
2830
}
31+
32+
resource azureopenaideployment 'Microsoft.CognitiveServices/accounts/deployments@2023-05-01' = {
33+
name: openai_deployment_name
34+
sku: {
35+
capacity: 120
36+
name: 'Standard'
37+
}
38+
parent: azureopenai
39+
properties: {
40+
model: {
41+
format: 'OpenAI'
42+
name: 'gpt-35-turbo'
43+
version: '0613'
44+
}
45+
raiPolicyName: 'Microsoft.Default'
46+
versionUpgradeOption: 'OnceCurrentVersionExpired'
47+
scaleSettings: {
48+
capacity: 120
49+
}
50+
}
51+
}

IaC/Terraform/v1/main.tf

+33-1
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,29 @@ terraform {
55
source = "hashicorp/azurerm"
66
version = "~>3"
77
}
8+
azapi = {
9+
source = "azure/azapi"
10+
}
811
}
912
}
1013

1114
provider "azurerm" {
1215
features {}
1316
}
1417

18+
provider "azapi" {
19+
20+
}
21+
22+
1523
locals {
1624
resource_prefix = "b59-eus2-aichatui"
1725
location = "eastus2"
1826

1927
openai_sku = "S0"
2028

29+
openai_deployment_name = "b59-gpt35-turbo"
30+
2131
resourceTags = {
2232
project = "https://github.com/build5nines/AIChatUI"
2333
}
@@ -36,4 +46,26 @@ resource azurerm_cognitive_account azureopenai {
3646
kind = "OpenAI"
3747
sku_name = local.openai_sku
3848
tags = local.resourceTags
39-
}
49+
}
50+
51+
# https://learn.microsoft.com/en-us/azure/templates/microsoft.cognitiveservices/accounts/deployments?pivots=deployment-language-terraform
52+
resource "azapi_resource" azureopenaideployment {
53+
type = "Microsoft.CognitiveServices/accounts/deployments@2023-05-01"
54+
name = local.openai_deployment_name
55+
parent_id = azurerm_cognitive_account.azureopenai.id
56+
body = jsonencode({
57+
properties = {
58+
model = {
59+
format = "OpenAI"
60+
name = "gpt-35-turbo"
61+
version = "0613"
62+
}
63+
versionUpgradeOption = "OnceCurrentVersionExpired"
64+
raiPolicyName = "Microsoft.Default"
65+
}
66+
sku = {
67+
capacity = 120
68+
name = "Standard"
69+
}
70+
})
71+
}

0 commit comments

Comments
 (0)