I am part of a development team working with an app which uses C# and .NET on the backend. One of the functions is to write file uploads to Azure Blob Storage. All of the other developers have no problem, yet for some reason I receive errors on authentication.
We are connecting with a client secret. My environment variables are correct. I have checked, reset, rechecked them so many times I know that isn't the issue. I am using AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET all with the correct values, yet I am receiving the errors. I have placed debug breakpoints to look at the values for my Environment Variables and they all appear correct. I don't have access to any management capabilities for Azure management so I don't have any information from that.
They are correct after creating defaultAzureCredential in the Program.cs
Since the other 2 devs are not having issue, and our code is the same I am guessing it must be either something in my VS settings or a setup item missed in Azure. (although using a secret I don't know that there would be anything specific to a particular user)
Here are the errors I've captured, I am hoping someone can shed some light on the situation.
{"ClientSecretCredential authentication failed: A configuration issue is preventing authentication - check the error message from the server for details. You can modify the configuration in the application registration portal. See https://aka.ms/msal-net-invalid-client for details. Original exception: AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app
"A configuration issue is preventing authentication - check the error message from the server for details. You can modify the configuration in the application registration portal. See https://aka.ms/msal-net-invalid-client for details. Original exception: AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app
and this is being added to the log file.
[ERR] Error uploading files: 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.