---
title: "Comment by Kevin L on \"How to use Managed Identity to connect to Azure, Exchange, Graph, Intune,... in Azure Automation Runbook\" | Hashnode"
description: "Great article! Is there any way you can connect with a managed identity locally? I think I&#39;m coming up with an issue you mentioned with Intune where I&#39;m"
url: "https://hashnode.com/posts/how-to-use-managed-identity-to-connect-to-azure-exchange-graph-intune-in-azure-automation-runbook/627d01164903bec29b587161/comment/642e721989c68819f9bab03f"
---

[Discussion](https://hashnode.com/posts/how-to-use-managed-identity-to-connect-to-azure-exchange-graph-intune-in-azure-automation-runbook/627d01164903bec29b587161)

Comment [How to use Managed Identity to connect to Azure, Exchange, Graph, Intune,... in Azure Automation Runbook](https://hashnode.com/posts/how-to-use-managed-identity-to-connect-to-azure-exchange-graph-intune-in-azure-automation-runbook/627d01164903bec29b587161)

[Kevin L](https://hashnode.com/@klpr)

[Apr 6, 2023](https://hashnode.com/posts/how-to-use-managed-identity-to-connect-to-azure-exchange-graph-intune-in-azure-automation-runbook/627d01164903bec29b587161/comment/642e721989c68819f9bab03f)

Great article! Is there any way you can connect with a managed identity locally? I think I'm coming up with an issue you mentioned with Intune where I'm trying to use Get-MgDeviceManagementRoleScopeTag and it's not bringing back anything, (using V2 preview 8) if it was run locally could possibly confirm it didn't like it. Didn't have any luck with the vscode azure automation extension run local to connect-mggraph -identity.

And I've added all the perms to the system management identity.

[Ondrej Sebela](https://hashnode.com/@AndrewZtrhgf)

[Apr 6, 2023](https://hashnode.com/posts/how-to-use-managed-identity-to-connect-to-azure-exchange-graph-intune-in-azure-automation-runbook/627d01164903bec29b587161/comment/642e721989c68819f9bab03f#reply-642e7318eaad3d174f73aaaf)

Not sure what you mean by running it locally?

[Kevin L](https://hashnode.com/@klpr)

[Apr 7, 2023](https://hashnode.com/posts/how-to-use-managed-identity-to-connect-to-azure-exchange-graph-intune-in-azure-automation-runbook/627d01164903bec29b587161/comment/642e721989c68819f9bab03f#reply-642f9ccf21057334de567a73)

[Ondrej Sebela](https://hashnode.com/@AndrewZtrhgf) instead of testing and running the runbook from the portal would it be possible to run locally from vscode or powershell ise? Whilst authenticating with the managed identity.

[Ondrej Sebela](https://hashnode.com/@AndrewZtrhgf)

[Apr 8, 2023](https://hashnode.com/posts/how-to-use-managed-identity-to-connect-to-azure-exchange-graph-intune-in-azure-automation-runbook/627d01164903bec29b587161/comment/642e721989c68819f9bab03f#reply-64317a4194d1164842d99272)

[Kevin L](https://hashnode.com/@klpr) I don't know. Sorry
