Skip to content

Commit

Permalink
Added azure open ai module
Browse files Browse the repository at this point in the history
  • Loading branch information
crlsocro committed Sep 19, 2024
1 parent a6d44d0 commit 83de5d8
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 11 deletions.
12 changes: 12 additions & 0 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ param keyVaultName string = 'bds-test-kv'
@description('The location for the registry.')
param location string = 'norwayeast'

@description('OpenAi location for the AI Services.')
param openAiLocation string = 'swedencentral'

@description('The name of the SQL Server.')
param serverName string = 'bds-test-sqlserver'

Expand Down Expand Up @@ -48,3 +51,12 @@ module sqlServer 'modules/sqlServer.bicep' = {
administratorLoginPassword: sqlServerPassword
}
}

module openAi 'modules/openAi.bicep' = {
name: 'bds-test-openai'
params: {
aiServicesName: 'bds-test-openai'
location: openAiLocation
deploymentName: 'gpt-4o-mini'
}
}
43 changes: 43 additions & 0 deletions infra/modules/openAi.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@


@description('Azure AI Services module name')
param aiServicesName string

@description('The location for the AI Services.')
param location string

@description('The deployment name of the AI Services.')
param deploymentName string

@description('The SKU name of the AI Services.')
param sku string = 'S0'

@description('The capacity of the AI Services.')
param capacity int = 30

resource openai 'Microsoft.CognitiveServices/accounts@2023-05-01' = {
name: aiServicesName
location: location
sku: {
name: sku
}
kind: 'OpenAI'
}

resource openaideployment 'Microsoft.CognitiveServices/accounts/deployments@2023-05-01' = {
name: deploymentName
sku: {
name: 'Standard'
capacity: capacity
}
parent: openai
properties: {
model: {
name: 'gpt-4o-mini'
format: 'OpenAI'
version: '2024-07-18'
}
raiPolicyName: 'Microsoft.Default'
versionUpgradeOption: 'OnceCurrentVersionExpired'
}
}
9 changes: 0 additions & 9 deletions infra/modules/resourceGroup.bicep

This file was deleted.

8 changes: 6 additions & 2 deletions infra/modules/storageAccount.bicep
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
param storageName string = 'bouvetdevsurveystorageaccount'

@description('The name of the storage account.')
param storageName string

@description('The SKU name of the storage account.')
@allowed([
'Standard_LRS'
'Standard_GRS'
Expand All @@ -12,7 +15,8 @@ param storageName string = 'bouvetdevsurveystorageaccount'
])
param storageSKU string = 'Standard_LRS'

param location string = 'norwayeast'
@description('The location for the storage account.')
param location string


resource stg 'Microsoft.Storage/storageAccounts@2023-04-01' = {
Expand Down

0 comments on commit 83de5d8

Please sign in to comment.