Using Visual Studio Pro with C# .NET to Azure Blob Storage

Wahlroos, David (MNIT) 0 Reputation points
2025-07-31T21:11:34.0933333+00:00

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.
Microsoft Security | Active Directory Federation Services
0 comments No comments

2 answers

Sort by: Oldest
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.

    3 deleted comments

    Comments have been turned off. Learn more

  2. Wahlroos, David (MNIT) 0 Reputation points
    2025-08-11T19:21:31.65+00:00

    I appreciate all of the feedback, Thank you everyone. We found that there was a user variable and system variable, both with the same name for each of the 3 variables. I removed them all, double checked all of the necessary variables and recreated only the user variables. I still had issues. It appears that the AZURE_CLIENT_SECRET variable I was using was from set up documentation that had not been updated with the correct value. That explains why everything seemed correct. When I was able to get some one-one time with one of our Hosting Integration people we were able to better review the problem.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.