-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocument-intelligence.bicep
69 lines (64 loc) · 2.56 KB
/
document-intelligence.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
import { roleAssignmentInfo } from '../security/managed-identity.bicep'
@description('Name of the resource.')
param name string
@description('Location to deploy the resource. Defaults to the location of the resource group.')
param location string = resourceGroup().location
@description('Tags for the resource.')
param tags object = {}
@description('Document Intelligence SKU. Defaults to S0.')
param sku object = {
name: 'S0'
}
@description('Whether to enable public network access. Defaults to Enabled.')
@allowed([
'Enabled'
'Disabled'
])
param publicNetworkAccess string = 'Enabled'
@description('Whether to disable local (key-based) authentication. Defaults to true.')
param disableLocalAuth bool = true
@description('Role assignments to create for the Document Intelligence instance.')
param roleAssignments roleAssignmentInfo[] = []
resource documentIntelligence 'Microsoft.CognitiveServices/accounts@2024-04-01-preview' = {
name: name
location: location
tags: tags
kind: 'FormRecognizer'
identity: {
type: 'SystemAssigned'
}
properties: {
customSubDomainName: toLower(name)
disableLocalAuth: disableLocalAuth
publicNetworkAccess: publicNetworkAccess
networkAcls: {
defaultAction: 'Allow'
ipRules: []
virtualNetworkRules: []
}
}
sku: sku
}
resource assignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = [
for roleAssignment in roleAssignments: {
name: guid(documentIntelligence.id, roleAssignment.principalId, roleAssignment.roleDefinitionId)
scope: documentIntelligence
properties: {
principalId: roleAssignment.principalId
roleDefinitionId: roleAssignment.roleDefinitionId
principalType: roleAssignment.principalType
}
}
]
@description('The deployed Document Intelligence resource.')
output resource resource = documentIntelligence
@description('ID for the deployed Document Intelligence resource.')
output id string = documentIntelligence.id
@description('Name for the deployed Document Intelligence resource.')
output name string = documentIntelligence.name
@description('Endpoint for the deployed Document Intelligence resource.')
output endpoint string = documentIntelligence.properties.endpoint
@description('Host for the deployed Document Intelligence resource.')
output host string = split(documentIntelligence.properties.endpoint, '/')[2]
@description('Identity principal ID for the deployed Document Intelligence resource.')
output systemIdentityPrincipalId string = documentIntelligence.identity.principalId