forked from Azure-Samples/nodejs-appsvc-cosmosdb-bottleneck
-
Notifications
You must be signed in to change notification settings - Fork 1
/
cosmosRustic.bicep
54 lines (49 loc) · 1.58 KB
/
cosmosRustic.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
param databaseAccountId string
param databaseAccountLocation string =resourceGroup().location
resource databaseAccountId_sampledatabase 'Microsoft.DocumentDB/databaseAccounts/mongodbDatabases@2020-06-01-preview' = {
parent: databaseAccountId_resource
name: 'sampledatabase'
properties: {
resource: {
id: 'sampledatabase'
}
options: {}
}
}
resource databaseAccountId_sampledatabase_samplecollection 'Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections@2020-06-01-preview' = {
parent: databaseAccountId_sampledatabase
name: 'samplecollection'
properties: {
resource: {
id: 'samplecollection'
indexes: []
}
options: {}
}
}
resource databaseAccountId_sampledatabase_samplecollection_default 'Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections/throughputSettings@2020-06-01-preview' = {
parent: databaseAccountId_sampledatabase_samplecollection
name: 'default'
properties: {
resource: {
throughput: 400
}
}
}
resource databaseAccountId_resource 'Microsoft.DocumentDb/databaseAccounts@2015-04-08' = {
kind: 'MongoDB'
name: databaseAccountId
location: databaseAccountLocation
properties: {
databaseAccountOfferType: 'Standard'
locations: [
{
locationName: '${resourceGroup().location}'
failoverPriority:0
isZoneRedundant: false
}
]
}
}
output accountId string = databaseAccountId_resource.id
output connstr string = first(listConnectionStrings('Microsoft.DocumentDb/databaseAccounts/${databaseAccountId}', '2015-04-08').connectionStrings).connectionString