NetPad icon indicating copy to clipboard operation
NetPad copied to clipboard

Azure.Identity (azure cli / homebrew) support on Mac OS

Open DPapst opened this issue 1 year ago • 3 comments

When trying to use Azure.Identity it fails to use azure cli

Unhandled exception. Azure.Identity.CredentialUnavailableException: DefaultAzureCredential failed to retrieve a token from the included credentials. See the troubleshooting guide for more information. https://aka.ms/azsdk/net/identity/defaultazurecredential/troubleshoot

  • EnvironmentCredential authentication unavailable. Environment variables are not fully configured. See the troubleshooting guide for more information. https://aka.ms/azsdk/net/identity/environmentcredential/troubleshoot
  • WorkloadIdentityCredential authentication unavailable. The workload options are not fully configured. See the troubleshooting guide for more information. https://aka.ms/azsdk/net/identity/workloadidentitycredential/troubleshoot
  • ManagedIdentityCredential authentication unavailable. Multiple attempts failed to obtain a token from the managed identity endpoint.
  • Visual Studio Token provider can't be accessed at /Users//.IdentityService/AzureServiceAuth/tokenprovider.json
  • Azure CLI not installed
  • PowerShell is not installed.
  • Azure Developer CLI could not be found.

short fix include homebrew bin and sbin in PATH: Environment.SetEnvironmentVariable("PATH", $"/opt/homebrew/bin:/opt/homebrew/sbin:{Environment.GetEnvironmentVariable("PATH")}");

Maybe add option to Settings to add Homebrew or Azure Cli folder path

DPapst avatar Jul 29 '23 08:07 DPapst

Thanks for the report. If possible, can you attach a script file that I can use to reproduce the issue?

tareqimbasher avatar Jul 29 '23 09:07 tareqimbasher

sure Script 2.netpad.zip

DPapst avatar Jul 29 '23 11:07 DPapst

sry did not want to close

DPapst avatar Jul 29 '23 11:07 DPapst