Azure Notifcation Hub CreateOrUpdateInstallationAsync - Installation not being created - No Exception

Pat Long 46 Reputation points
2022-01-05T12:54:55.707+00:00

I have an ASP.NET Web Api that is registering Android and iOS installations in our Azure Notification Hub. It creates a HubClient using a connection string

this.azureHub = NotificationHubClient.CreateClientFromConnectionString(
    "Endpoint=sb://OUR-HUB-NS.servicebus.windows.net/;SharedAccessKeyName=DefaultFullSharedAccessSignature;SharedAccessKey=tK/SEXXXXXXXXXXX/7LUtvRoNt+HjToFmP+T++yW5g=",
    "OUR-HUB");

We then creating an installation using this code

try
{
    await azureHub.CreateOrUpdateInstallationAsync(installation, cancellationToken);
}
catch(Exception e)
{
    this.logger.LogError(e, "CreateOrUpdateInstallationAsync failed with" + e.Message);
    return false;
}

return true;

That code does not throw an exception but from what I can tell the installation is not being created

  1. If I use the "Test Send" in Azure Portal I get "Message was successfully sent, but there were no matching targets." for either Apple or Android platform
  2. azureHub.GetAllRegistrationsAsync(0) returns an empty list
  3. azureHub.GetInstallationAsync(installation.InstallationId) fails becauise the installaiton is not available even if it try and get it in a retry loop

Any suggestions on how I diagnose what is happening to my installations?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,761 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. sadomovalex 3,631 Reputation points
    2022-01-05T14:36:15.91+00:00

    can you try sync version CreateOrUpdateInstallation - will it throw any exception?


  2. SnehaAgrawal-MSFT 21,506 Reputation points
    2022-01-13T15:58:42.827+00:00

    Apologize for late response. Came across the query created by you on Stack Overflow. Thanks for sharing the solution that works for you.
    Adding it here for community benefits: Azure Notifcation Hub CreateOrUpdateInstallationAsync not failing but Installation not being created

    Let us know if you have further query on this.

    0 comments No comments

  3. Perera, Gayan 0 Reputation points
    2023-09-26T01:16:32.0066667+00:00

    Please ignore this.

    0 comments No comments

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.