I’m running an inline C# script in an Azure Logic Apps workflows to get the blob details using DefaultAzureCredential(). I have given 'Storage Blob Data Contributor' to Azure Logic App in Storage Account as well. Its throwing below error message when I am adding managed identity related code in inline C# script:
Error message: "The function 'execute_csharp_script_code.csx' failed with the error 'Exception binding parameter 'context'' when executing. Please verify function code is valid."

Its working fine if I am removing managed identity related code from inline script. But from security point of view, we want to use managed identity to get data from storage account.
Can anyone please let us know if its possible to use managed identity in the inline C# script of Azure Logic App? Or any other ways to achieve without compromising security?
Note: We don't want to use Azure Function App
HTTPaction. - Follow the steps here: - Authenticate with managed identity in Logic Apps - Call Azure Storage using REST with managed identity