Azure Web PubSub
Azure Web PubSub needs a card for its Free tier of 20 concurrent connections and 20,000 messages a day on one unit, with no SLA, and enforcement of that allowance is not confirmed.
Azure Web PubSub is a managed service that holds WebSocket connections for you and delivers messages between clients and servers, using groups and a publish and subscribe model.
Is it a fit?
Good fit
Use it to try managed WebSockets with groups for a chat or live-update feature, with only a few test clients.
- real-time prototypes
- chat and live notifications
- learning pub/sub over WebSocket
Not a fit
Avoid the Free tier for more than 20 concurrent connections or when you need an SLA.
- you need more than 20 concurrent connections
- you need an SLA
- you need more than 20 connections or 1 unit
You create a resource in the Azure portal or with the Azure CLI. Clients connect to it with a Client Access URL, and your servers use the service SDKs or a REST API. It suits developers who want WebSocket features without running connection servers. Azure sign-up asks for a phone number and a credit or debit card (not prepaid) to verify your identity. It may place a temporary one-dollar hold, and it does not charge you unless you move to pay-as-you-go.
What the free plan gives you
Web PubSub comes in Free, Standard, and Premium tiers, split by concurrent connections, messages, and units. The Free tier gives 20 concurrent connections and 20,000 messages per unit per day. It costs nothing per unit per day and allows 1 unit at most.
The pricing page lists no SLA for Free, while Standard has 99.9% and Premium has 99.95%. Availability zones, auto scaling, custom domain names, and geo-replication are Premium only. The overview says the service also supports Socket.IO on Azure and MQTT clients over WebSocket.
When you hit a limit
The pricing page does not say what happens when you pass 20 connections or 20,000 messages in a day. You cannot add units to a Free resource, because it is capped at 1 unit.
Standard and Premium work differently. Each unit supports 1,000 concurrent connections, and messages are unlimited. The first 1,000,000 messages per unit per day are free, and extra messages are sold per million. Billing counts only outbound messages from the service, and messages over 2 KB count in multiple units, and messages under 2 KB are added together for billing.
Gotchas
- The pricing FAQ says only outbound messages count, and ping messages are ignored. Traffic is counted in bytes.
- Each application server opens five initial connections per hub by default, and each client uses one connection. Client Access URLs contain authentication tokens. The quickstart copies one manually; production apps should obtain them on demand from an application server.
- The .NET quickstart installs the client package with the
--prereleaseflag.
Alternatives in this atlas
- Azure SignalR Service: when your app uses ASP.NET Core and the SignalR protocol.
- Ably: when you want more free connections and are not tied to Azure.
- EMQX Serverless: when your clients speak MQTT.
Questions people ask
Is Azure Web PubSub free?
There is a Free tier with 20 concurrent connections and 20,000 messages per unit per day. It allows 1 unit and has no SLA.
What is the difference between Web PubSub and SignalR Service?
Both have the same Free tier numbers. Web PubSub is the base service with connections, users, groups, and events. SignalR Service targets apps built on the SignalR protocol.
How are Web PubSub connections counted?
Each application server starts with five initial connections per hub by default, and each client has one client connection.
How to get started
- Sign in to the Azure portal with an Azure subscription.
- Create a Web PubSub resource and choose the Free tier. You can also run `az extension add --upgrade --name webpubsub` and then `az webpubsub create` with `--sku Free_F1`.
- Copy a Client Access URL for your hub from the portal. Set the group permissions the client needs.
- Install a client SDK, for example `npm install @azure/web-pubsub-client` or `dotnet add package Azure.Messaging.WebPubSub.Client --prerelease`.
- Create a `WebPubSubClient` with the Client Access URL, call `start()`, join a group with `joinGroup`, and handle the `group-message` event.
Other free messaging options
Same category, safest first.