Azure Confidential Ledger ARM template re-deployment infinite loop calls to Ledger_ListBySubscription

Dev S 71 Reputation points
2025-01-29T18:25:51.2633333+00:00

When using an ARM template to deploy an Azure Confidential ledger, resource of type Microsoft.ConfidentialLedger/ledgers, we see that the initial deployment of the Ledger runs fine, however, upon rerunning the ARM template, the deployment gets stuck with multiple calls to Ledger_ListBySubscription recorded in the Activity Log. There seems to be no end to the deployment and calls to Ledger_ListBySubscription keep getting logged every minute. The deployment gets stuck even when re-running the ARM template with 0 changes to the initial deployment.

Azure Cost Management
Azure Cost Management
A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.
3,114 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Madugula Jahnavi 0 Reputation points Microsoft External Staff
    2025-02-05T07:36:14.38+00:00

    Hello Dev S,

    Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.

    Here is the complete ARM template I've tried to deploy confidential ledgers with "aad security principal's" ledger role as administrator and was able to perform the operation successfully.

    {
        "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
        "contentVersion": "1.0.0.0",
        "parameters": {
            "ledger": {
                "type": "string"
            },
            "principalId": {
                "type": "string"
            },
            "location": {
                "type": "string",
                "defaultValue": "[resourceGroup().location]"
            }
        },
        "functions": [],
        "variables": {},
        "resources": [{
            "name": "[parameters('ledger')]",
            "type": "Microsoft.ConfidentialLedger/ledgers",
            "apiVersion": "2020-12-01-preview",
            "location": "[parameters('location')]",
            "properties": {
                "ledgerType": "Public",
                "aadBasedSecurityPrincipals": [{
                    "principalId": "[parameters('principalId')]",
                    "ledgerRoleName": "Administrator"
                }]
            }
        }]
    }
    

    Portal view ledger >> properties:

    aad

    And mainly if you are looking to update the AAD security principals exclusively through an ARM template, I found it is not exactly possible with ARM after exploring on it. To update them, you can use "az confidentialledger update --aad-based-security-principals" Az CLI command along with the ledger name and relevant arguments.

    Reference MS Doc: https://learn.microsoft.com/en-us/cli/azure/confidentialledger?view=azure-cli-latest#az-confidentialledger-update

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.