Azure notification hub connection error

Islam, Mohmmad 0 Reputation points
2023-03-19T10:45:05.8766667+00:00

Problem statement -

My working app stopped suddenly.

I am invoking a notification hub from NodeJS azure function that was working earlier but now it throws this error

{"errno":"ENOTFOUND","code":"ENOTFOUND","syscall":"getaddrinfo","hostname":"myhub.servicebus.windows.net"}

using npm azure-sb - https://www.npmjs.com/package/azure-sb

var conString = "my hub connection string";
var notificationHubService = notHub.createNotificationHubService(
      "myhub",
      conString
    );
    var payload = {
      data: {
        message: 'Hello',
      },
    };
    notificationHubService.gcm.send(null, payload, function (error) {
      if (!error) {
        console.log('notification sent');
      }
      else
      {
        console.log('Error while sending ! '+ JSON.stringify(error));
      }
    });
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.
383 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.