Skip to content

Commit d7f3193

Browse files
authored
Merge pull request #269129 from ArchangelSDY/service-tag
Update service tag doc for azure web pubsub
2 parents f46c652 + cc5fcab commit d7f3193

File tree

3 files changed

+66
-9
lines changed

3 files changed

+66
-9
lines changed

articles/azure-web-pubsub/howto-service-tags.md

Lines changed: 66 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,88 @@ ms.author: dayshen
1212

1313
# Use service tags for Azure Web PubSub Service
1414

15-
You can use [Service Tags](../virtual-network/network-security-groups-overview.md#service-tags) for Azure Web PubSub service when configuring [Network Security Group](../virtual-network/network-security-groups-overview.md#network-security-groups). It allows you to define inbound/outbound network security rule for Azure Web PubSub Service endpoints without need to hardcode IP addresses.
15+
You can use [Service Tags](../virtual-network/service-tags-overview.md) to identify Azure Web PubSub Service traffic. A service tag represents a group of IP address prefixes. Azure Web PubSub Service manages a service tag called `AzureWebPubSub` for both inbound and outbound traffic.
1616

17-
Azure Web PubSub service manages these service tags. You can't create your own service tag or modify an existing tag. Microsoft manages the address prefixes that match to the service tag and automatically updates the service tag as addresses change.
17+
A service tag can be used when for configuring **Network Security Group**. Alternatively, you can query the IP address prefixes using [Service Tag Discovery API](../virtual-network/service-tags-overview.md#service-tags-on-premises).
1818

19-
> [!Note]
20-
> Starting from 15 August 2021, Azure Web PubSub service supports bidirectional Service Tag for both inbound and outbound traffic.
19+
## Outbound traffic
20+
21+
Endpoints of Azure Web PubSub Service resources are guaranteed to be within IP ranges of Service Tag `AzureWebPubSub`.
22+
23+
### Access Azure Web PubSub Service from virtual network
24+
25+
You can allow outbound traffic from your network to Azure Web PubSub Service by adding a new outbound network security rule.
26+
27+
#### [Azure portal](#tab/azure-portal)
28+
29+
1. On portal, go to the network security group.
30+
1. Select on the settings menu called **Outbound security rules**.
31+
1. Select the **Add** button.
32+
1. Select **Destination** and choose **Service Tag**.
33+
1. Select **Destination service tag** and choose **AzureWebPubSub**.
34+
1. Enter **443** in **Destination port ranges**.
2135

22-
## Use service tag via Azure CLI
36+
:::image type="content" alt-text="Screenshot showing dialogue to create an outbound security rule." source="media/howto-service-tags/portal-add-outbound-security-rule.png" :::
2337

24-
### Configure outbound traffic
38+
1. Adjust other fields as needed.
39+
1. Select **Add**.
2540

26-
You can allow outbound traffic to Azure Web PubSub service by adding a new outbound network security rule:
41+
#### [Azure CLI](#tab/azure-cli)
2742

2843
```azurecli-interactive
2944
az network nsg rule create -n <rule-name> --nsg-name <nsg-name> -g <resource-group> --priority 100 --direction Outbound --destination-address-prefixes AzureWebPubSub
3045
```
3146

32-
### Configure inbound traffic
47+
-----
48+
49+
## Inbound traffic
50+
51+
In following scenarios, Azure Web PubSub Service can generate network traffic to your resource. The source of traffic is guaranteed to be within IP ranges of Service Tag `AzureWebPubSub`.
52+
53+
* Use [event handlers](howto-develop-eventhandler.md).
54+
* Use [event listeners](howto-develop-event-listener.md)
55+
* Use [Key Vault secret reference](howto-use-managed-identity.md#use-a-managed-identity-for-key-vault-reference) in URL template settings.
56+
* Use [custom certificate](howto-custom-domain.md#add-a-custom-certificate).
57+
58+
### Event handler endpoints in virtual network
59+
60+
You can configure **Network Security Group** to allow inbound traffic to virtual network.
61+
62+
#### [Azure portal](#tab/azure-portal)
3363

34-
If you're using [event handler](concept-service-internals.md#event-handler), you can also allow inbound traffic from Azure Web PubSub service by adding a new inbound network security rule:
64+
1. On portal, go to the network security group.
65+
1. Select **Inbound security rules**.
66+
1. Select the **Add** button.
67+
1. Select **Source** and choose **Service Tag** from the list.
68+
1. Select **Source service tag** and choose **AzureWebPubSub** from the list.
69+
1. Enter \* in **Source port ranges**.
70+
71+
:::image type="content" alt-text="Screenshot showing dialogue to create an inbound security rule." source="media/howto-service-tags/portal-add-inbound-security-rule.png" :::
72+
73+
1. Change other settings as needed.
74+
1. Select **Add**.
75+
76+
#### [Azure CLI](#tab/azure-cli)
3577

3678
```azurecli-interactive
3779
az network nsg rule create -n <rule-name> --nsg-name <nsg-name> -g <resource-group> --priority 100 --direction Inbound --source-address-prefixes AzureWebPubSub
3880
```
3981

82+
-----
83+
84+
> [!Note]
85+
> Azure Web PubSub Service is a shared service. By allowing Service Tag `AzureWebPubSub` or its associated IP address prefixes, you also allow traffic from other resources, even if they belong to other customers. Make sure you implement appropriate authentication on your endpoints.
86+
87+
### Event handler endpoints of Azure Function
88+
89+
You can configure a [service tag-based rule](../app-service/app-service-ip-restrictions.md#set-a-service-tag-based-rule).
90+
91+
Alternatively, you can use [Shared Private Endpoints](howto-secure-shared-private-endpoints.md) for better security. Shared Private Endpoints are dedicated to your resources. No traffic from other resources can access your endpoints.
92+
93+
### Event Hubs and Key Vault access
94+
95+
We recommend [Shared Private Endpoints](howto-secure-shared-private-endpoints-key-vault.md) for best security.
96+
4097
## Next steps
4198

4299
- [Network security groups: service tags](../virtual-network/network-security-groups-overview.md#security-rules)
97.7 KB
Loading
98.2 KB
Loading

0 commit comments

Comments
 (0)