Base solution for your next web application
Open Closed

Azure - Storing settings for Authentication [Facebook, Google, Twitter, Microsoft] #6326


User avatar
0
rcatiller created

Hello -

I apologize for the novice nature of my question. I'm using ASP.NET Core MVC / JQuery and have published to Azure. When it comes to the Authentication section of appsettings.json, is there a document that explains how to properly create these settings within Azure so I don't have to keep them in appsettings.json?

I have attempted to create these settings in Azure, but the app will not start. An example of the settings I have created for Facebook.AppId is in Azure, I create an Application Setting called: Authentication:Facebook:AppId and for the value I entered the AppId from the Facebook Developer portal for the app I provisioned.

I then removed the settings from appsettings.json, but as previously stated the application doesn't start. If I place the settings back into appsettings.json, the app starts successfully.

Thanks for your time.


4 Answer(s)
  • User Avatar
    0
    ryancyq created
    Support Team

    Hi, can you share the log for the application not being able to start?

    By default Azure configuration is loaded by calling .AddEnvironmentVariables() at https://github.com/aspnetzero/aspnet-zero-core/blob/f72d4bf9ced778e06265f1c415a8553b10cbaf3d/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Core/Configuration/AppConfigurations.cs#L37

    See https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/azure-apps/

  • User Avatar
    0
    rcatiller created

    Thanks for your reply. Apparently I didn't have diagnostics logging enabled and I have since published the app with all Authentication items in appsettings.json, so the app is actually working, but I'm concerned about the credentials that are in appsettings.json for the social login providers.

    My question is: how to provide the credentials for each social login provider (Facebook, Twitter, Google, Microsoft) without keeping them in appsettings.json?

    After reading through the links you provided, I'm still not clear on how to provide those credentials without using appsettings.json.

    Thanks again for your time.

  • User Avatar
    0
    ismcagdas created
    Support Team
  • User Avatar
    0
    rcatiller created

    Thank you for the helpful information.