NetPad
NetPad copied to clipboard
Azure.Identity (azure cli / homebrew) support on Mac OS
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
Thanks for the report. If possible, can you attach a script file that I can use to reproduce the issue?
sure Script 2.netpad.zip
sry did not want to close