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.
299 questions
Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,325 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,414 questions
{count} votes