-
Notifications
You must be signed in to change notification settings - Fork 41
/
deployAll.bicep
168 lines (155 loc) · 3.71 KB
/
deployAll.bicep
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
// General params
param location string = resourceGroup().location
// SQL Server params
param serverName string = 'sqlserver-${uniqueString(resourceGroup().id)}'
param databaseName string = 'aworks'
param adminLogin string = 'SqlAdmin'
@secure()
param adminPassword string = 'ChangeYourAdminPassword1'
// Speech Service params
param SpeechServiceName string = 'aispeech-${uniqueString(resourceGroup().id)}'
param speech_location string = 'westeurope'
param vision_location string = 'northeurope'
// OpenAI params
param OpenAIServiceName string = 'openai-${uniqueString(resourceGroup().id)}'
param openai_deployments array = [
{
name: 'text-embedding-ada-002'
model_name: 'text-embedding-ada-002'
version: '2'
raiPolicyName: 'Microsoft.Default'
sku_capacity: 20
sku_name: 'Standard'
}
{
name: 'gpt-35-turbo-16k'
model_name: 'gpt-35-turbo-16k'
version: '0613'
raiPolicyName: 'Microsoft.Default'
sku_capacity: 20
sku_name: 'Standard'
}
{
name: 'gpt-4'
model_name: 'gpt-4'
version: '1106-Preview'
raiPolicyName: 'Microsoft.Default'
sku_capacity: 20
sku_name: 'Standard'
}
{
name: 'gpt-4'
model_name: 'gpt-v'
version: 'vision-preview'
raiPolicyName: 'Microsoft.Default'
sku_capacity: 20
sku_name: 'Standard'
}
{
name: 'dall-e-3'
model_name: 'dall-e-3'
version: '3.0'
raiPolicyName: 'Microsoft.Default'
sku_capacity: 1
sku_name: 'Standard'
}
]
// AI Search params
param aisearch_name string = 'aisearch-${uniqueString(resourceGroup().id)}'
// AI Vision params
param aivision_name string = 'aivision-${uniqueString(resourceGroup().id)}'
resource sqlServer 'Microsoft.Sql/servers@2021-02-01-preview' = {
name: serverName
location: location
identity: {
type: 'SystemAssigned'
}
properties: {
administratorLogin: adminLogin
administratorLoginPassword: adminPassword
}
}
resource sqlServerFirewallRules 'Microsoft.Sql/servers/firewallRules@2020-11-01-preview' = {
parent: sqlServer
name: 'Allow Azure Services'
properties: {
startIpAddress: '0.0.0.0'
endIpAddress: '255.255.255.255'
}
}
resource sqlDatabase 'Microsoft.Sql/servers/databases@2021-02-01-preview' = {
name: databaseName
parent: sqlServer
location: location
properties: {
collation: 'SQL_Latin1_General_CP1_CI_AS'
sampleName: 'AdventureWorksLT'
}
}
resource cognitiveService 'Microsoft.CognitiveServices/accounts@2023-05-01' = {
name: SpeechServiceName
location: speech_location
sku: {
name: 'S0'
}
kind: 'SpeechServices'
properties: {
apiProperties: {
statisticsEnabled: false
}
}
}
resource openai 'Microsoft.CognitiveServices/accounts@2023-05-01' = {
name: OpenAIServiceName
location: location
sku: {
name: 'S0'
}
kind: 'OpenAI'
properties: {
apiProperties: {
statisticsEnabled: false
}
}
}
@batchSize(1)
resource model 'Microsoft.CognitiveServices/accounts/deployments@2023-05-01' = [for deployment in openai_deployments: {
name: deployment.model_name
parent: openai
sku: {
name: deployment.sku_name
capacity: deployment.sku_capacity
}
properties: {
model: {
format: 'OpenAI'
name: deployment.name
version: deployment.version
}
raiPolicyName: deployment.raiPolicyName
}
}]
resource search 'Microsoft.Search/searchServices@2020-08-01' = {
name: aisearch_name
location: location
sku: {
name: 'basic'
}
properties: {
replicaCount: 1
partitionCount: 1
}
}
resource vision 'Microsoft.CognitiveServices/accounts@2023-05-01' = {
name: aivision_name
location: vision_location
sku: {
name: 'S1'
}
kind: 'ComputerVision'
properties: {
apiProperties: {
statisticsEnabled: false
}
}
}