I'm running on ASP.Net Core Blazor. I have a requirement to utilized the current logged in User's username. I do so using IHttpContextAccessor. It works as expected while debugging, however when I deploy to azure the IHttpContextAccessor object is null. Have no idea why this occurring.
accessor:
[Inject]
private IHttpContextAccessor HttpContextAccessor { get; set; } = default!;
protected override void OnInitialized()
{
username = HttpContextAccessor.HttpContext.User.Identity.Name.ToString();
}