Skip to content

Commit

Permalink
complete fabric-e2e-rag workshop
Browse files Browse the repository at this point in the history
  • Loading branch information
Jcardif committed Jan 24, 2024
1 parent 4559e6b commit 7909be8
Show file tree
Hide file tree
Showing 3 changed files with 726 additions and 0 deletions.
104 changes: 104 additions & 0 deletions workshops/fabric-e2e-rag/assets/main.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
param openailocation string = 'canadaeast'
param location string = resourceGroup().location
param cognitiveSearchName string = substring('rag-cogsearch${uniqueString(resourceGroup().id)}', 0, 24)
param azureOpenAiServiceName string = substring('rag-azureoai${uniqueString(resourceGroup().id)}', 0, 24)
param azureAiServiceName string = substring('rag-aiservices${uniqueString(resourceGroup().id)}', 0, 24)

resource cognitiveSearch_resource 'Microsoft.Search/searchServices@2023-11-01' ={
name: cognitiveSearchName
location: location
sku: {
name: 'free'
}
properties: {
replicaCount: 1
partitionCount: 1
hostingMode: 'default'
publicNetworkAccess: 'enabled'
networkRuleSet: {
ipRules: []
}
encryptionWithCmk: {
enforcement: 'Unspecified'
}
disableLocalAuth: false
authOptions: {
apiKeyOnly: {}
}
}
}

resource azureOpenAiService_resource 'Microsoft.CognitiveServices/accounts@2023-10-01-preview' = {
name: azureOpenAiServiceName
location: openailocation
sku: {
name: 'S0'
}
kind: 'OpenAI'
properties: {
customSubDomainName: azureOpenAiServiceName
networkAcls: {
defaultAction: 'Allow'
virtualNetworkRules: []
ipRules: []
}
publicNetworkAccess: 'Enabled'
}
}

resource gpt4_deployment 'Microsoft.CognitiveServices/accounts/deployments@2023-10-01-preview' = {
parent: azureOpenAiService_resource
name: 'gpt-4'
sku: {
name: 'Standard'
capacity: 10
}
properties: {
model: {
format: 'OpenAI'
name: 'gpt-4'
version: '0613'
}
versionUpgradeOption: 'OnceNewDefaultVersionAvailable'
currentCapacity: 10
raiPolicyName: 'Microsoft.Default'
}
}

resource adaTextEmbeddingResource 'Microsoft.CognitiveServices/accounts/deployments@2023-10-01-preview' = {
parent: azureOpenAiService_resource
name: 'text-embedding-ada-002'
sku: {
name: 'Standard'
capacity: 120
}
properties: {
model: {
format: 'OpenAI'
name: 'text-embedding-ada-002'
version: '2'
}
versionUpgradeOption: 'OnceNewDefaultVersionAvailable'
currentCapacity: 120
raiPolicyName: 'Microsoft.Default'
}
}


resource azureAiService_resource 'Microsoft.CognitiveServices/accounts@2023-10-01-preview' = {
name: azureAiServiceName
location: location
sku: {
name: 'S0'
}
kind: 'CognitiveServices'
properties: {
customSubDomainName: azureAiServiceName
networkAcls: {
defaultAction: 'Allow'
virtualNetworkRules: []
ipRules: []
}
publicNetworkAccess: 'Enabled'
}
}
142 changes: 142 additions & 0 deletions workshops/fabric-e2e-rag/assets/main.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.24.24.22086",
"templateHash": "5933124861243764197"
}
},
"parameters": {
"openailocation": {
"type": "string",
"defaultValue": "canadaeast"
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]"
},
"cognitiveSearchName": {
"type": "string",
"defaultValue": "[substring(format('rag-cogsearch{0}', uniqueString(resourceGroup().id)), 0, 24)]"
},
"azureOpenAiServiceName": {
"type": "string",
"defaultValue": "[substring(format('rag-azureoai{0}', uniqueString(resourceGroup().id)), 0, 24)]"
},
"azureAiServiceName": {
"type": "string",
"defaultValue": "[substring(format('rag-aiservices{0}', uniqueString(resourceGroup().id)), 0, 24)]"
}
},
"resources": [
{
"type": "Microsoft.Search/searchServices",
"apiVersion": "2023-11-01",
"name": "[parameters('cognitiveSearchName')]",
"location": "[parameters('location')]",
"sku": {
"name": "free"
},
"properties": {
"replicaCount": 1,
"partitionCount": 1,
"hostingMode": "default",
"publicNetworkAccess": "enabled",
"networkRuleSet": {
"ipRules": []
},
"encryptionWithCmk": {
"enforcement": "Unspecified"
},
"disableLocalAuth": false,
"authOptions": {
"apiKeyOnly": {}
}
}
},
{
"type": "Microsoft.CognitiveServices/accounts",
"apiVersion": "2023-10-01-preview",
"name": "[parameters('azureOpenAiServiceName')]",
"location": "[parameters('openailocation')]",
"sku": {
"name": "S0"
},
"kind": "OpenAI",
"properties": {
"customSubDomainName": "[parameters('azureOpenAiServiceName')]",
"networkAcls": {
"defaultAction": "Allow",
"virtualNetworkRules": [],
"ipRules": []
},
"publicNetworkAccess": "Enabled"
}
},
{
"type": "Microsoft.CognitiveServices/accounts/deployments",
"apiVersion": "2023-10-01-preview",
"name": "[format('{0}/{1}', parameters('azureOpenAiServiceName'), 'gpt-4')]",
"sku": {
"name": "Standard",
"capacity": 10
},
"properties": {
"model": {
"format": "OpenAI",
"name": "gpt-4",
"version": "0613"
},
"versionUpgradeOption": "OnceNewDefaultVersionAvailable",
"currentCapacity": 10,
"raiPolicyName": "Microsoft.Default"
},
"dependsOn": [
"[resourceId('Microsoft.CognitiveServices/accounts', parameters('azureOpenAiServiceName'))]"
]
},
{
"type": "Microsoft.CognitiveServices/accounts/deployments",
"apiVersion": "2023-10-01-preview",
"name": "[format('{0}/{1}', parameters('azureOpenAiServiceName'), 'text-embedding-ada-002')]",
"sku": {
"name": "Standard",
"capacity": 120
},
"properties": {
"model": {
"format": "OpenAI",
"name": "text-embedding-ada-002",
"version": "2"
},
"versionUpgradeOption": "OnceNewDefaultVersionAvailable",
"currentCapacity": 120,
"raiPolicyName": "Microsoft.Default"
},
"dependsOn": [
"[resourceId('Microsoft.CognitiveServices/accounts', parameters('azureOpenAiServiceName'))]"
]
},
{
"type": "Microsoft.CognitiveServices/accounts",
"apiVersion": "2023-10-01-preview",
"name": "[parameters('azureAiServiceName')]",
"location": "[parameters('location')]",
"sku": {
"name": "S0"
},
"kind": "CognitiveServices",
"properties": {
"customSubDomainName": "[parameters('azureAiServiceName')]",
"networkAcls": {
"defaultAction": "Allow",
"virtualNetworkRules": [],
"ipRules": []
},
"publicNetworkAccess": "Enabled"
}
}
]
}
Loading

0 comments on commit 7909be8

Please sign in to comment.