Issue with Azure Confidential Ledger Authentication in Azure DevOps Pipeline

Ronak Patel 0 Reputation points
2024-09-26T11:18:28.4833333+00:00

I am encountering an issue with authentication while integrating Azure Confidential Ledger in my Azure DevOps pipeline using the @azure/identity package. In my local development environment, I am able to authenticate successfully by logging in via Azure CLI using the az login command, and everything works as expected. However, when I deploy the code to the Azure DevOps pipeline, I receive an error indicating that environment variables such as AZURE_CLIENT_ID, AZURE_TENANT_ID, and AZURE_CLIENT_SECRET are not set.

In my local environment, I have not explicitly set these environment variables. I believe authentication is working locally because I have logged in via the Azure CLI. Here is the relevant portion of my code:

const ledgerIdentity = await getLedgerIdentity("xxxxxxxx-confidential-ledger");

const credential = new DefaultAzureCredential();

const confidentialLedger = ConfidentialLedger(

"https://xxxxxxx-confidential-ledger.confidential-ledger.azure.com",

ledgerIdentity.ledgerIdentityCertificate,

credential

);

const ledgerEntries = await confidentialLedger.path("/app/enclaveQuotes").get();

Could you please advise on how I can resolve this issue in the Azure DevOps environment? Specifically, I would like to understand the appropriate way to authenticate in the pipeline without setting these environment variables manually, similar to how Azure CLI login works locally.

Any guidance or documentation references would be greatly appreciated.

Thank you for your support.

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
39,272 questions
{count} votes

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.