- Notifications
You must be signed in to change notification settings - Fork 3k
/
Copy pathperf-resources.bicep
74 lines (62 loc) · 2.67 KB
/
perf-resources.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
70
71
72
73
74
parambaseNamestring = resourceGroup().name
paramlocationstring = resourceGroup().location
paramstorageEndpointSuffixstring = 'core.windows.net'
paramtestApplicationOidstring
resourcestorageAccount'Microsoft.Storage/storageAccounts@2019-06-01' = {
name: '${baseName}storage'
location: location
kind: 'StorageV2'
sku: {
name: 'Standard_RAGRS'
}
}
resourcestorageAccountBlobServices'Microsoft.Storage/storageAccounts/blobServices@2021-09-01' = {
name: 'default'
parent: storageAccount
}
resourcetestContainer'Microsoft.Storage/storageAccounts/blobServices/containers@2021-09-01' = {
name: 'testcontainer'
parent: storageAccountBlobServices
}
@description('This is the Blob owner role.')
resourceblobOwnerRoleDefinition'Microsoft.Authorization/roleDefinitions@2018-01-01-preview'existing = {
scope: resourceGroup()
name: 'b7e6dc6d-f1e8-4753-8033-0f276bb0955b'
}
resourceblobRoleAssignment'Microsoft.Authorization/roleAssignments@2022-04-01' = {
name: guid(resourceGroup().id, testApplicationOid, blobOwnerRoleDefinition.id)
properties: {
roleDefinitionId: blobOwnerRoleDefinition.id
principalId: testApplicationOid
principalType: 'ServicePrincipal'
}
}
resourcetableServices'Microsoft.Storage/storageAccounts/tableServices@2022-09-01' = {
name: 'default'
parent: storageAccount
}
resourcetables'Microsoft.Storage/storageAccounts/tableServices/tables@2022-09-01' = {
name: 'default'
parent: tableServices
}
@description('This is the Blob owner role.')
resourcetableOwnerRoleDefinition'Microsoft.Authorization/roleDefinitions@2018-01-01-preview'existing = {
scope: resourceGroup()
name: '0a9a7e1f-b9d0-4cc4-a60d-0319b160aaa3'
}
resourcetableRoleAssignment'Microsoft.Authorization/roleAssignments@2022-04-01' = {
name: guid(resourceGroup().id, testApplicationOid, tableOwnerRoleDefinition.id)
properties: {
roleDefinitionId: tableOwnerRoleDefinition.id
principalId: testApplicationOid
principalType: 'ServicePrincipal'
}
}
varstorageAccountKey = storageAccount.listKeys('2021-09-01').keys[0].value
outputAZURE_STORAGE_ACCOUNT_NAMEstring = storageAccount.name
outputAZURE_STORAGE_BLOBS_ENDPOINTstring = storageAccount.properties.primaryEndpoints.blob
outputAZURE_STORAGE_ACCOUNT_KEYstring = storageAccountKey
outputAZURE_STORAGE_CONN_STRstring = 'DefaultEndpointsProtocol=https;AccountName=${storageAccount.name};AccountKey=${storageAccountKey};EndpointSuffix=${storageEndpointSuffix}'
outputAZURE_STORAGE_CONTAINER_NAMEstring = testContainer.name
outputAZURE_STORAGE_TABLE_NAMEstring = tables.name
outputAZURE_STORAGE_TABLES_ENDPOINTstring = 'https://${storageAccount.name}.table.${storageEndpointSuffix}/'