-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
203 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters