Rrgarding accesssing the workflow history using managed identity in C#

Rajesh Konduru Sekhar 0 Reputation points
2024-06-14T06:01:13.11+00:00

I am trying to access workflow history using managed identity authentication in C#

But failing to fetch the logic app workflow details in the below code in the while loop


static async Task GetLogicApps()
        {
            // Authenticate and create the ArmClient instance.
            var credential = new DefaultAzureCredential();
            var armClient = new ArmClient(credential);
            var subscription = await armClient.GetDefaultSubscriptionAsync();

            // Get all LogicApps.
            var logicAppsEnumerator = subscription.GetLogicWorkflowsAsync().GetAsyncEnumerator();

            try
            {
                while (await logicAppsEnumerator.MoveNextAsync())
                {
                    // For the current LogicApp, retrieve its run history.
                    var logicApp = logicAppsEnumerator.Current;
                    Console.WriteLine(logicApp.Data.Name);

                    var logicAppRuns = logicApp.GetLogicWorkflowRuns();

                    foreach (var logicAppRun in logicAppRuns)
                    {
                        Console.WriteLine($"... Start DateTime = {logicAppRun.Data.StartOn}, End DateTime = {logicAppRun.Data.EndOn}, Status = {logicAppRun.Data.Status}");
                    }
                }
            }
            finally
            {
                await logicAppsEnumerator.DisposeAsync();
            }

            Console.Read();
        }

In while loop unable to fetch the logic app workflow/workflow history details

is there a way to fetch the workflow history details using managed identities authentication?

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,985 questions
{count} votes