visual-studio-2022azure-service-fabricdefaultazurecredential

Local Debug for Service Fabric application using DefaultAzureAuthentication in VS throws exception


We are trying to create a local environment for our application based on the guidelines here : https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication/local-development-service-principal?tabs=azure-portal%2Cvisual-studio%2Ccommand-line

In order to authenticate to services , we are trying to use DefaultAzureCredentials() .

Any suggestions on how we can use DefaultAzureAuthentication() correctly or we could be going wrong?


Solution

  • The issue with this was that it was a Local Service fabric application and Service Fabric realm doesnot recognize beyond the SfAppCluster level, hence was not able to pick up the Visual studio credentials

    What we did was to go the service principal route and set our environment variables ( https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication/local-development-service-principal?tabs=azure-portal%2Cwindows%2Ccommand-line )

    And placing the S_+NI cert on the SfAppCluster folder localy