(This applies only to WCF relays. Messages aren't a cost for Hybrid Connections.)
In general, billable messages for relays are calculated by using the same method that is used for brokered entities (queues, topics, and subscriptions), described previously. However, there are some notable differences.
Sending a message to Azure Relay is treated as a "full through" send to the relay listener that receives the message. It isn't treated as a send operation to the Azure Relay, followed by a delivery to the relay listener. A request-reply style service invocation (of up to 64 KB) against a relay listener results in two billable messages: one billable message for the request and one billable message for the response (assuming the response is also 64 KB or smaller). This is different than using a queue to mediate between a client and a service. If you use a queue to mediate between a client and a service, the same request-reply pattern requires a request send to the queue, followed by a dequeue/delivery from the queue to the service. This is followed by a response send to another queue, and a dequeue/delivery from that queue to the client. Using the same size assumptions throughout (up to 64 KB), the mediated queue pattern results in 4 billable messages. You'd be billed for twice the number of messages to implement the same pattern that you accomplish by using relay. Of course, there are benefits to using queues to achieve this pattern, such as durability and load leveling. These benefits might justify the additional expense.
Relays that are opened by using the netTCPRelay WCF binding treat messages not as individual messages, but as a stream of data flowing through the system. When you use this binding, only the sender and listener have visibility into the framing of the individual messages sent and received. For relays that use the netTCPRelay binding, all data is treated as a stream for calculating billable messages. In this case, Service Bus calculates the total amount of data sent or received via each individual relay on a 5-minute basis. Then, it divides that total amount of data by 64 KB to determine the number of billable messages for that relay during that time period.
Quotas
Quota nameScopeNotesValue Relay namespaces per Azure subscriptionAzure subscription-1000 Concurrent listeners on a relayEntity (hybrid connection or WCF relay)Subsequent requests for additional connections are rejected and an exception is received by the calling code.25 Concurrent relay connections per all relay endpoints in a service namespaceNamespace-5,000 Relay endpoints per service namespaceNamespace-10,000 Message size for NetOnewayRelayBinding and NetEventRelayBinding relaysNamespaceIncoming messages that exceed these quotas are rejected and an exception is received by the calling code.64 KB Message size for HttpRelayTransportBindingElement and NetTcpRelayBinding relaysNamespaceNo limit on message size.Unlimited