Skip to content

Commit

Permalink
adding compute vision
Browse files Browse the repository at this point in the history
  • Loading branch information
krnese committed Feb 6, 2024
1 parent 52e49bf commit 9ec61b2
Show file tree
Hide file tree
Showing 2 changed files with 203 additions and 0 deletions.
202 changes: 202 additions & 0 deletions fsi/solutions/generativeAi/azureComputerVision.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
{
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"rgName": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Provide the name of the resource group where the Azure Open AI instance that will be created"
}
},
"location": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Select the location for the Azure Open AI instance that will be created"
}
},
"prefix": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Provide name for the Azure Open AI instance that will be created"
}
},
"visionSubnetId": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Provide the subnet id where the Azure Open AI instance that will be connected"
}
},
"visionSystemIdentity": {
"type": "string",
"defaultValue": "No",
"allowedValues": [
"Yes",
"No"
]
},
"visionNwLocation": {
"type": "string",
"defaultValue": "[parameters('location')]"
},
"visionDisableNetworkAccess": {
"type": "string",
"defaultValue": "No",
"allowedValues": [
"Yes",
"No"
]
},
"visionRbacAuthz": {
"type": "string",
"defaultValue": "No",
"allowedValues": [
"Yes",
"No"
]
},
"visionRestrictOutboundNetworkAccess": {
"type": "string",
"defaultValue": "No",
"allowedValues": [
"Yes",
"No"
]
},
"visionMonCreation": {
"type": "string",
"defaultValue": "No",
"allowedValues": [
"Yes",
"No"
]
}
},
"variables": {
"name-compliant-azureComputerVision": "[concat(parameters('prefix'), '-', parameters('location'), '-aivision')]",
"name-compliant-vision-pe": "[concat(parameters('prefix'), '-AzVision-pe')]",
"name-compliant-vision-asg": "[concat(parameters('prefix'), '-AzVision-asg')]",
"name-compliant-storage": "[toLower(take(concat(replace(replace(parameters('prefix'), '-', ''), '_', ''), parameters('location'), uniqueString(deployment().name)), 23))]",
"name-compliant-azMon": "[concat(parameters('prefix'), '-', parameters('location'), '-azmon')]",
"visionIdentity": {
"type": "SystemAssigned"
},
"denyFwAcl": {
"defaultAction": "Deny",
"bypass": "AzureServices",
"ipRules": [],
"virtualNetworkRules": []
}
},
"resources": [
{
"type": "Microsoft.Resources/resourceGroups",
"apiVersion": "2022-09-01",
"name": "[parameters('rgName')]",
"location": "[parameters('location')]"
},
{
"type": "Microsoft.Resources/deployments",
"apiVersion": "2022-09-01",
"name": "azureOpenAi",
"resourceGroup": "[parameters('rgName')]",
"dependsOn": [
"[resourceId('Microsoft.Resources/resourceGroups/', parameters('rgName'))]"
],
"properties": {
"mode": "Incremental",
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"resources": [
{
"type": "Microsoft.CognitiveServices/accounts",
"apiVersion": "2022-03-01",
"name": "[variables('name-compliant-azureComputerVision')]",
"location": "[parameters('location')]",
"identity": "[if(equals(parameters('visionSystemIdentity'), 'Yes'), variables('visionIdentity'), json('null'))]",
"sku": {
"name": "S1"
},
"kind": "ComputerVision",
"properties": {
"customSubDomainName": "[toLower(variables('name-compliant-azureComputerVision'))]",
"publicNetworkAccess": "[if(equals(parameters('visionDisableNetworkAccess'), 'Yes'), 'Disabled', 'Enabled')]",
"disableLocalAuth": "[if(equals(parameters('visionRbacAuthz'), 'Yes'), bool('true'), bool('false'))]",
"restrictOutboundNetworkAccess": "[if(equals(parameters('visionRestrictOutboundNetworkAccess'), 'Yes'), bool('true'), bool('false'))]",
"networkAcls": "[if(equals(parameters('visionDisableNetworkAccess'), 'Yes'), variables('denyFwAcl'), json('null'))]"
}
},
{
"condition": "[equals(parameters('visionMonCreation'), 'Yes')]",
"type": "Microsoft.CognitiveServices/accounts/providers/diagnosticSettings",
"apiVersion": "2021-05-01-preview",
"name": "[concat(variables('name-compliant-azureComputerVision'), '/', 'Microsoft.Insights/diag')]",
"location": "[parameters('location')]",
"dependsOn": [
"[concat('Microsoft.CognitiveServices/accounts/', variables('name-compliant-azureComputerVision'))]"
],
"properties": {
"workspaceId": "[concat(subscription().id, '/resourceGroups/', parameters('rgName'), '/providers/Microsoft.OperationalInsights/workspaces/', variables('name-compliant-azMon'))]",
"logs": [
{
"categoryGroup": "allLogs",
"enabled": true
}
]
}
},
{
"condition": "[and(equals(parameters('visionDisableNetworkAccess'), 'Yes'), not(empty(parameters('visionSubnetId'))))]",
"type": "Microsoft.Network/applicationSecurityGroups",
"apiVersion": "2023-04-01",
"name": "[variables('name-compliant-vision-asg')]",
"location": "[parameters('visionNwLocation')]",
"dependsOn": [
"[concat('Microsoft.CognitiveServices/accounts/', variables('name-compliant-azureComputerVision'))]"
],
"properties": {}
},
{
"condition": "[and(equals(parameters('visionDisableNetworkAccess'), 'Yes'), not(empty(parameters('visionSubnetId'))))]",
"type": "Microsoft.Network/privateEndpoints",
"apiVersion": "2021-03-01",
"name": "[variables('name-compliant-vision-pe')]",
"location": "[parameters('visionNwLocation')]",
"dependsOn": [
"[concat('Microsoft.CognitiveServices/accounts/', variables('name-compliant-azureComputerVision'))]",
"[concat('Microsoft.Network/applicationSecurityGroups/', variables('name-compliant-vision-asg'))]"
],
"properties": {
"privateLinkServiceConnections": [
{
"name": "[variables('name-compliant-azureComputerVision')]",
"properties": {
"privateLinkServiceId": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', parameters('rgName'), '/providers/Microsoft.CognitiveServices/accounts/', variables('name-compliant-azureComputerVision'))]",
"groupIds": [
"account"
]
}
}
],
"subnet": {
"id": "[parameters('visionSubnetId')]"
},
"applicationSecurityGroups": [
{
"id": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', parameters('rgName'), '/providers/Microsoft.Network/applicationSecurityGroups/', variables('name-compliant-vision-asg'))]"
}
]
}
}
]
}
}
}
],
"outputs": {}
}
1 change: 1 addition & 0 deletions fsi/solutions/generativeAi/azureOpenAi.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
},
"aiSubnetId": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Provide the subnet id where the Azure Open AI instance that will be connected"
}
Expand Down

0 comments on commit 9ec61b2

Please sign in to comment.