File tree 2 files changed +56
-1
lines changed
2 files changed +56
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ param location string = resourceGroup().location
5
5
6
6
param azureOpenAISku string = 'S0'
7
7
8
+ param openai_deployment_name string = 'b59-gpt35-turbo'
9
+
8
10
var resourceTags = {
9
11
project : 'https://github.com/build5nines/AIChatUI'
10
12
}
@@ -26,3 +28,24 @@ resource azureopenai 'Microsoft.CognitiveServices/accounts@2023-10-01-preview' =
26
28
publicNetworkAccess : 'Enabled'
27
29
}
28
30
}
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
+ }
Original file line number Diff line number Diff line change @@ -5,19 +5,29 @@ terraform {
5
5
source = " hashicorp/azurerm"
6
6
version = " ~>3"
7
7
}
8
+ azapi = {
9
+ source = " azure/azapi"
10
+ }
8
11
}
9
12
}
10
13
11
14
provider "azurerm" {
12
15
features {}
13
16
}
14
17
18
+ provider "azapi" {
19
+
20
+ }
21
+
22
+
15
23
locals {
16
24
resource_prefix = " b59-eus2-aichatui"
17
25
location = " eastus2"
18
26
19
27
openai_sku = " S0"
20
28
29
+ openai_deployment_name = " b59-gpt35-turbo"
30
+
21
31
resourceTags = {
22
32
project = " https://github.com/build5nines/AIChatUI"
23
33
}
@@ -36,4 +46,26 @@ resource azurerm_cognitive_account azureopenai {
36
46
kind = " OpenAI"
37
47
sku_name = local. openai_sku
38
48
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
+ }
You can’t perform that action at this time.
0 commit comments