Share via

404 error with tutorial MAUI push notifications

Ganesh Gebhard 366 Reputation points
2026-02-27T16:05:58.94+00:00

Hello,

I followed the tutorial on how to enable and use push notifications in MAUI with Azure (https://learn.microsoft.com/en-us/dotnet/maui/data-cloud/push-notifications?view=net-maui-10.0).

The app runs without issues and as far as I can see the backend on Azure works as expected as well:

User's image

The URL inside the MAUI app looks correct as well:

User's image

(of course I removed the API key for this picture only).

When I enter the app and press "Register", a 404 error is returned (404 (NotFound)).

Knowing that I use the Azure environment as backend and its is running, something else should be wrong. Maybe someone is able to pinpoint the issue here.

Best,

Azure App Service
Azure App Service

Azure App Service is a service used to create and deploy scalable, mission-critical web apps.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Shree Hima Bindu Maganti 7,420 Reputation points Microsoft External Staff Moderator
    2026-03-02T02:20:36.78+00:00

    Hi @Ganesh Gebhard
    It looks like your MAUI app is getting a “not found” error on the registrations endpoint in your deployed API. Usually, this happens when the app isn’t targeting the right route or the API app hasn’t been set up or restarted with the correct settings.

    Confirm your endpoint and HTTP method

    • The default controller route is: PUT https://.azurewebsites.net/api/notifications/installations
    • Your MAUI HttpClient call should look like: await httpClient.PutAsync("api/notifications/installations", content);
    • Check that your BaseAddress ends with a slash and your relative path doesn’t start with one.

    Test with a REST client (Postman, curl, HTTP REPL)

    • Send a simple PUT request to the same URL (with minimal or no body)
    • You should get a 400 (bad request) or a 401/403 if the apikey header is missing, but not a 404.
    • If you still get a 404, the route isn’t exposed by the service.

    Review your App Service settings and restart

    • Go to the Azure portal, select your App Service, and check Configuration → Application settings
    • Ensure these keys are set: • Authentication:ApiKey = your API key • NotificationHubsConnection = your Notification Hubs connection string • NotificationHubName = your hub name
    • Save and manually restart the App Service for the changes to take effect.

    Check your controller routing

    • Open your Web API project and verify the attribute routing is correct: [Route("api/notifications/[controller]")]
    • The controller should be named InstallationsController ([controller] becomes “installations”).

    Look out for front-door or gateway rewrites

    • If you’re using Application Gateway, API Management, or custom rewrite rules, make sure they aren’t removing /api/notifications/ from the route.

    If you still get a 404 after these steps, please share:

    Was this answer helpful?

    0 comments No comments

  2. Jerald Felix 11,555 Reputation points Volunteer Moderator
    2026-03-02T00:31:11.67+00:00

    Hello Ganesh Gebhard,

    Thanks for raising this question in Azure Q&A forum.

    The 404 (Not Found) error when pressing "Register" in the .NET MAUI push notifications tutorial is almost certainly caused by FCM v1 protocol misconfiguration on your Azure Notification Hub. This is a common issue since Google deprecated FCM Legacy HTTP on June 20, 2024, and the tutorial requires specific Azure configuration to work with .NET MAUI + Firebase Cloud Messaging v1.

    Root Cause

    The tutorial's registration endpoint (POST /api/notifications/installations/{installationId}) is failing because your Azure Notification Hub is still configured for the deprecated FCM Legacy protocol instead of FCM v1. When MAUI's DeviceInstallationService tries to register the device installation, Azure NH rejects it with 404 because the Firebase credentials are incompatible with the legacy endpoint.

    Step-by-Step Fix

    1. Configure Firebase Cloud Messaging v1 in Azure Notification Hub

    Go to Azure Portal → your Notification Hub → Google (FCM v1):

    text
    1. Under Settings → Google (FCM v1), click "Configure"
    2. **Server key**: Leave blank (not used in v1)
    3. **Project ID**: Copy from Firebase Console → Project Settings → General → Project ID
    4. **Client Email**: Copy from Firebase Console → Project Settings → Service Accounts → Firebase Admin SDK → Email
    5. **Private Key**: Copy the full JSON private key from Firebase Console → Project Settings → Service Accounts → Generate New Private Key → save as .json
    6. Upload the **Private Key JSON file** directly in the Azure portal
    

    2. Verify Notification Hub Access Policy

    In Notification Hub → Access Policies, ensure your DefaultFullSharedAccessSignature connection string is correctly copied to your backend API (appsettings.json). The registration requires Full permissions (not just Send).​

    3. Update your backend API to use the correct connection string

    In your ASP.NET Core backend (NotificationHubService.cs), ensure you're using the DefaultFullSharedAccessSignature endpoint:​

    csharp
    // In appsettings.json
    

    4. Rebuild and redeploy your backend API

    After updating the FCM v1 configuration:

    text
    1. Clean & rebuild your backend API
    2. Redeploy to Azure App Service or your hosting platform
    3. Test the registration endpoint directly via Postman first:
       POST https://your-api.azurewebsites.net/api/notifications/installations/test-install-id
       Headers: apikey: your-api-key
       Body: raw JSON with your FCM token
    

    5. Test device registration in MAUI app

    Once the backend returns 200 OK for registration, test the MAUI app's "Register" button again.​

    Additional Common Gotchas

    Firebase Project ID mismatch — ensure the Firebase Project ID in Azure NH exactly matches your MAUI app's Firebase project

    DefaultFullSharedAccessSignature vs DefaultListenSharedAccessSignature — registration requires Full permissions​

    Installation ID format — must be a valid GUID (use Guid.NewGuid().ToString() in MAUI)​

    FCM token validity — ensure your MAUI app's FCM token is fresh (test with Firebase Console → Cloud Messaging → Send Test Message)​

    Verification Commands

    Test your Notification Hub configuration with PowerShell:​

    powershell
    # Test registration endpoint directly
    

    If it helps kindly accept the answer.

    Best Regards,

    Jerald Felix

    Was this answer helpful?

    0 comments No comments

Your answer

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