Azure Notification Hub Billing - azure

I have a question about Azure Notification Hub Billing (Prices here)
If I send a 1 message that fans out to (say) 10 client devices is that billed as 1 message or 10?
This kind of implies that that it would be 10 but it's a little unclear
Pushes include all notifications delivered to the platform
notification services (e.g. Windows Notification Service, Apple Push
Notification Service, Google Cloud Messaging, Microsoft Push
Notification Service). Push allowance is prorated and capped on a
daily basis.
(Hope this is an ok place to ask this, there are a few Azure billing questions and none seem to have been closed so I'm assuming this is accepted)

You would pay a flat fee of $22 (USD) per Unit for that example.
You are charged per "unit" where a unit on "Basic" (for example) includes:
unlimited device registrations
up to 500,000 pushes per month (or 16,667 per day)
If you publish 1 message that fans out to 10 devices you have generated 10 pushes. If you did not exceed the 16,667 messages in a day you'd pay $22 for a single unit.
If you need more than that you would need to scale the number of units (maximum of 9 for Basic / unlimited for Standard) to allow you to meet your demand.

Easiest way to perceive this is by considering total devices that have been reached out to using Notifications Hub; irrespective of the platforms being pushed on.
Example: 5-Android, 2-Windows, 1-iOS = 8 pushes!

Related

Azure Notification hub Free Tier - are 1 million pushes per month?

Azure Notification hub free tier has 1million pushes per subscription.
My question is are 1 million pushes per month?
According to the pricing,
Free - get up to 1 million pushes per subscription a month.
Basic - get 10 million pushes per subscription a month as a baseline, with quota growth options.
Standard - get 10 million pushes per subscription a month as a baseline, with quota increase options, plus rich telemetry capabilties
All of the prices listed on this page are monthly: Notification Hub Pricing
So as of the time of writing you are correct, the 1 million pushes are evaluated monthly by subscription.

Trigger Azure Function from Service Bus topic without consuming Brokered Connections

So, I'm analyzing whether using Functions to consume Service bus messages from a topic is viable.
The Service Bus pricing plan we chose has a limit on the number of 'Brokered connections' (max 1000) per month.
My understanding is that in the typical usage scenario the consumer/listener/subscriber connects to a topic and stays connected persistently, receiving multiple messages during a long period of time (a day, even a week) without breaking the connection, and that this is counted as 1 'brokered connection'. In the end you can receive thousands of messages on a single brokered connection.
How does this work with an Azure function binding? From what I read in the documentation, a function can be idle (ie not running), so it wouldnt be able to maintain this persistent connection.
Is there a separate component for Functions that keeps this connection alive listening for incoming messages? Or are we going to get billed for a new brokered connection each time the function goes idle and then restarts?
I'm including a screenshot of the current plan features:
https://azure.microsoft.com/en-us/pricing/details/service-bus/
Later in the same link:
edit
From Docs:
Service Bus charges for the peak number of concurrent brokered connections that exceed the included quantity (1,000 in the Standard tier). Peaks are measured on an hourly basis, prorated by dividing by 744 hours in a month, and added up over the monthly billing period. The included quantity (1,000 brokered connections per month) is applied at the end of the billing period against the sum of the prorated hourly peaks.
They specifically mention "1,000 brokered connections per month" in the last sentence.
This is an example:
Each of 10,000 devices connects via a single AMQP connection, and receives commands from a Service Bus topic. The devices send telemetry events to an Event Hub. If all devices connect for 12 hours each day, the following connection charges apply (in addition to any other Service Bus topic charges): 10,000 connections * 12 hours * 31 days / 744 = 5,000 brokered connections. After the monthly allowance of 1,000 brokered connections, you would be charged for 4,000 brokered connections, at the rate of $0.03 per brokered connection, for a total of $120.
So I guess all of this is for 10.000 subscribers connecting to the topic at the same time during 12hs, if they connected for 24hs each day then 9,000 brokered connections would be billed (10,000 minus the included 1,000)?
In any case, I'm also trying to validate whether persistent connections are possible with functions (I'm told they are with webjobs).
Azure Functions has a separate component known as the ScaleController that monitors your Service Bus for events 24/7.
Since the underlying SB message receiver in Functions is implemented in WebJobs, there will be a single connection that can retrieve multiple messages throughout the lifetime of the Function instance, although due of its current limitation, it is passing along those messages one at a time to your Function code for processing.
You are only charged when your Function code actually runs. Here's a link that gives you an overview of the ScaleController:https://learn.microsoft.com/en-us/azure/azure-functions/functions-scale#runtime-scaling
If you are anticipating relatively high load, have you considered using Event Hub instead of Service Bus? ServiceBus-Triggers in Azure Functions currently can only process one message at a time, which is not optimal for high load scenarios. Here's a GitHub issue that is opened to track this feature request: https://github.com/Azure/azure-webjobs-sdk/issues/1024
EventHub-Triggers can process messages in batches and that should give your more bang for the buck per Function execution. See https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-event-hubs

Track the usage and bill in Azure api-management

Each customer will have a web api application. Is there a way to bill customer as per the usage by deploying it to api-management?
I have gone through the following article but we are not expecting each customer to have such data requirement to choose Standard/Premium.
https://azure.microsoft.com/en-in/pricing/details/api-management/
Also, I am confused what the unit means and how pay as you go will work if there are limitations such as ~1 TB/month data transfer. Does ~1 TB denote the maximum usage in this package?
1) if by "bill customer as per usage" you are expecting to capture the number of total backend api invocations through APIM and bill customer based on counts from APIM - yes it is possible. Also you can on-board multiple API's (backend) on a single instance of APIM or onboard the same backend api as 2 api's on APIM and share two different URL's and track usage separately.
2) yes per unit in standard 1 TB is the max. Pay as you go is by the units consumed (and not the number of api calls going through APIM) and a unit has upper ceiling in-terms of no. of calls and data transfer. so yes in short if you choose standard with 1 unit you need to pay 699/month if there are 100 api calls or 1 million (upto max 7 mil per day) going through APIM but you have the flexibility to choose number of units based on volume you need and pay only for that.

Azure Notification Hub quota limits

The notification hub REST API documentation mentions a quota for notification hubs in a given namespace. I couldn't find on the documentation nor the pricing page what are the boundaries for the quota for each plan.
Empirically, i now know that on the free/basic tier the limit is 100 notification hubs per namespace.
The maximum number of resources of type NotificationHub has been reached or exceeded. Actual: 100, Max allowed: 100.
Can the quotas be raised? What are the costs?
My current system uses hubs for multitenancy and before jumping to refactor the architecture are there any limits not mentioned on the pricing page?
Do service bus have quotas on the number of namespaces?
Do registrations (devices) have quotas/rate limit for each notification hub?
Send operations:
To increase quotas and start using some advanced features you could
go https://manage.windowsazure.com, then pick any your Notification
Hub and set Basic or Standard pricing tire on the Scale tab. Basic is
$10 per month, Standard - $200. Note that pricing tire is actually
changed on namespace level and all quotas are enforced against
namespace.
Also if you try to call Send operations in parallel from several
senders then you would see that bandwidth is wider because requests
are very likely to be routed to different nodes.
Also if you are going to send a really big volume of notifications
and each notification is targeted to 1 or very few devices, then
write to support asking to enable Inbox for your namespace.
Other quotas:
At most 100 (by my best knowledge) namespaces per regular subscription, you can upgrade it to premium with no limit by writing to support.
At most 100 hubs per namespace, you can increase it by writing to support.
Number of devices is not actually limited, even for Free tire '500 active devices' limitation is not enforced... for now :)
Registration rate is limited, quotas start from 2000 per namespace per minute and depends on pricing tire.
Also:
Some official pricing details: http://azure.microsoft.com/en-us/pricing/details/notification-hubs/

Cost of Azure Notification Hubs vs Amazon SNS

I've been evaluating options for sending mobile push notifications and looked at pricing of Microsoft's vs Amazon's hub offerings. I think I must have miss-calculated since the Microsoft offer is coming out 20 times the cost! Can someone please point out where I went wrong?
The Microsoft pricing is based on a 12 month plan, giving a unit cost of £3.29 per day. Each unit can sent 166,667 messages and I need to send 1.8m per day (roughly 54m per month).
I'll say upfront that I am inherently biased, since I work on Azure.
But these are significantly different services.
Amazon SNS primary scenario is push to individual devices, or small groups of devices. You need to maintain the endpoints, and pre-create topics. You can do multicast with topics, but a topic afaik cannot have more than 10K devices, so you can only multicast to 10K users at a time.
Notification Hubs offers you segmented/personalized push engagement for millions of users. You can broadcast to unlimited # of devices with a single API call, you can manage segments/target arbitrary segment expressions, personalize/localize your pushes using templates, etc.
If you don't need any of the extra features Notification Hubs offers, and just need a simple push to individual devices, Azure pricing page advises contacting mobileservices#microsoft.com for low price offering for high volume individual push scenarios.
Quick update to my previous answer. Starting September, Azure Notification Hubs offers more flexible (and much cheaper) pricing with three tiers:
1) Free tier - up to 1M push notifications monthly for free
2) Basic tier - basic push notifications at $1 per million pushes.
3) Standard tier - rich push notification capabilities (large scale instant broadcasts, dynamic segments, rich telemetry, etc) at $2.5 - $20 per million pushes depending on the volume.
http://azure.microsoft.com/en-us/pricing/details/notification-hubs/

Resources