File size: 1,232 Bytes
065fee7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
@description('Ledger Name')
@minLength(3)
@maxLength(24)
param ledgerName string = 'pysdkci-${uniqueString(resourceGroup().id)}'
// resourceGroup().name is too long
// uniqueString is 13 characters long
// https://docs.microsoft.com/en-us/azure/azure-resource-manager/bicep/bicep-functions-string#uniquestring
// Prepend a string to easy identification + ledger name must start with a letter.

@description('The client OID to grant access to test resources.')
param testApplicationOid string

@description('The location of the resource. Currently, not all regions are supported.')
param location string = 'eastus'
// Explicitly set a region due to regional restrictions e.g. ACL is not currently available in westus

var azureConfidentialLedgerUrl = 'https://${ledgerName}.confidential-ledger.azure.com'

resource ledgerName_resource 'Microsoft.ConfidentialLedger/ledgers@2022-05-13' = {
  name: ledgerName
  location: location
  properties: {
    ledgerType: 'Public'
    aadBasedSecurityPrincipals: [
      {
        principalId: testApplicationOid
        ledgerRoleName: 'Administrator'
      }
    ]
  }
}

output CONFIDENTIALLEDGER_ENDPOINT string = azureConfidentialLedgerUrl
output CONFIDENTIALLEDGER_ID string = ledgerName