Azure Notification Hub where to specify connection info?

SSB 111 Reputation points
2021-03-20T21:38:53.603+00:00

Hi,

I am following the tutorial in the link below to send push notifications from my WebAPI - they are saying to specify the Notification Hub Name and the Connection string using dotnet user-secrets

Is there anyway i can just set these in the code directly?
or via the appsettings.json file?

I know its not best-practice, but this is a small app right now

dotnet user-secrets init
dotnet user-secrets set "NotificationHub:Name" <value>
dotnet user-secrets set "NotificationHub:ConnectionString" <value>

https://learn.microsoft.com/en-us/azure/developer/mobile-apps/notification-hubs-backend-service-xamarin-forms#create-an-aspnet-core-web-api-backend-application

Azure Notification Hubs
Azure Notification Hubs
An Azure service that is used to send push notifications to all major platforms from the cloud or on-premises environments.
325 questions
Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,362 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,506 questions
{count} votes

Your answer

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