Get subscriptions list from Azure hub notification

David Bittencourt Pires 0 Reputation points
2023-10-31T14:38:23.7966667+00:00

I'm testing free Azure services to validate some solutions, what's my goal:

I want to get the list of Azure Hub Notification push adherents, generate a file and copy this file to a folder

in nfs filesystem (It could be an Azure Windows Server VM for example). I want this to be done once a week and be done incrementally.

I tried Azure Automation by creating a Runbook to run a script in PowerShell in Hybrid Worker correclty configured, but it always gives errors in the Az modules:

The specified module 'Az.NotificationHubs' was not loaded because no valid module file was found in any module directory.
The specified module 'Az.Resources' was not loaded because no valid module file was found in any module directory.
Error authenticating with Managed Identity.

I tried Azure Data Factory but I don't know how to capture the list of Azure Hub Notification subscribers within the data factory

When trying Azure Functions with script in .NET it gives an error in the Azure libraries.

I don't want to use blobstorage, because in the real scenario there are millions of subscribers and it will be very expensive to move that volume of data.

what is the best solution?

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.
325 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,865 questions
Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,261 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. brtrach-MSFT 16,586 Reputation points Microsoft Employee
    2023-11-08T02:33:41.8233333+00:00

    @David Bittencourt Pires Based on your requirements, Azure Notification Hubs is the best solution for you. You can use the Azure Notification Hubs REST API to get the list of registrations and then generate a file and copy it to a folder in your NFS filesystem.

    Here are the steps you can follow:

    1. Use the Azure Notification Hubs REST API to get the list of registrations. You can use the following API endpoint to get the list of registrations:
    GET https://{namespace}.servicebus.windows.net/{notificationHub}/registrations/?api-version=2015-01
    
    
    

    You will need to authenticate your request using a Shared Access Signature (SAS) token. You can create a SAS token using the Azure portal or Azure CLI.

    1. Once you have the list of registrations, you can generate a file and copy it to a folder in your NFS filesystem. You can use any scripting language of your choice to generate the file and copy it to the folder.
    2. To schedule this task to run once a week, you can use Azure Logic Apps. You can create a Logic App that triggers on a weekly basis and calls the Azure Notification Hubs REST API to get the list of registrations. You can then use the "Create file" action in Logic Apps to generate the file and the "Copy file" action to copy the file to the folder in your NFS filesystem.
    1 person found this answer helpful.
    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.