You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-web-pubsub/howto-custom-domain.md
+57-34Lines changed: 57 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,33 +4,48 @@ titleSuffix: Azure Web PubSub Service
4
4
description: How to configure a custom domain for Azure Web PubSub Service
5
5
author: ArchangelSDY
6
6
ms.service: azure-web-pubsub
7
-
ms.topic: article
8
-
ms.date: 07/07/2022
7
+
ms.topic: how-to
8
+
ms.date: 03/30/2023
9
9
ms.author: dayshen
10
10
---
11
11
12
12
# Configure a custom domain for Azure Web PubSub Service
13
13
14
-
In addition to the default domain provided Azure Web PubSub Service, you can also add custom domains.
14
+
In addition to the default domain provided by the Azure Web PubSub Service, you can also add a custom domain. A custom domain is a domain name that you own and manage. You can use a custom domain to access your Azure Web PubSub Service resource. For example, you can use `contoso.example.com` instead of `contoso.webpubsub.azure.com` to access your Azure Web PubSub Service resource.
15
15
16
16
## Prerequisites
17
17
18
-
* Resource must be Premium tier
19
-
* A custom certificate matching custom domain is stored in Azure Key Vault
18
+
* An Azure account with an active subscription. If you don't have an Azure account, you can [create an account for free](https://azure.microsoft.com/free/).
19
+
* An Azure Web PubSub service (must be Premium tier).
20
+
* An Azure Key Vault resource.
21
+
* A custom certificate matching custom domain that is stored in Azure Key Vault.
20
22
21
23
## Add a custom certificate
22
24
23
-
Before you can add a custom domain, you need add a matching custom certificate first. A custom certificate is a sub resource of your Azure Web PubSub Service. It references a certificate in your Azure Key Vault. For security and compliance reasons, Azure Web PubSub Service doesn't permanently store your certificate. Instead it fetches it from your Key Vault on the fly and keeps it in memory.
25
+
Before you can add a custom domain, you need to add a matching custom certificate first. A custom certificate is a resource of your Azure Web PubSub Service. It references a certificate in your Azure Key Vault. For security and compliance reasons, Azure Web PubSub Service doesn't permanently store your certificate. Instead it fetches it from your Key Vault on the fly and keeps it in memory.
24
26
25
27
### Step 1: Grant your Azure Web PubSub Service resource access to Key Vault
26
28
27
29
Azure Web PubSub Service uses Managed Identity to access your Key Vault. In order to authorize, it needs to be granted permissions.
28
30
29
31
1. In the Azure portal, go to your Azure Web PubSub Service resource.
30
32
1. In the menu pane, select **Identity**.
31
-
1. Turn on either **System assigned** or **User assigned** identity. Click **Save**.
33
+
1. You can select **System assigned** or **User assigned** identity. If you want to use **User assigned** identity, you need to create one first.
34
+
1. To add a System assigned identity
35
+
1. Select **On**.
36
+
1. Select **Yes** to confirm.
37
+
1. Select **Save**.
32
38
33
-
:::image type="content" alt-text="Screenshot of enabling managed identity." source="media\howto-custom-domain\portal-identity.png" :::
39
+
:::image type="content" alt-text="Screenshot of enabling system assigned managed identity." source="media\howto-custom-domain\portal-identity.png" :::
40
+
41
+
1. To add a User assigned identity;
42
+
1. Select **Add user assigned managed identity**.
43
+
1. Select an existing identity.
44
+
1. Select **Add**.
45
+
46
+
:::image type="content" alt-text="Screenshot of enabling user assigned managed identity." source="media\howto-custom-domain\portal-user-assigned-identity.png" :::
47
+
48
+
1. Select **Save**.
34
49
35
50
Depending on how you configure your Key Vault permission model, you may need to grant permissions at different places.
36
51
@@ -41,17 +56,23 @@ If you're using Key Vault built-in access policy as Key Vault permission model:
41
56
:::image type="content" alt-text="Screenshot of built-in access policy selected as Key Vault permission model." source="media\howto-custom-domain\portal-key-vault-perm-model-access-policy.png" :::
42
57
43
58
1. Go to your Key Vault resource.
44
-
1. In the menu pane, select **Access configuration**. Click **Go to access policies**.
45
-
1. Click **Create**. Select **Secret Get** permission and **Certificate Get** permission. Click **Next**.
59
+
1. In the menu pane, select **Access configuration**.
60
+
1. Select **Vault access policy**.
61
+
1. Select **Go to access policies**.
62
+
1. Select **Create**.
63
+
1. Select **Secret Get** permission.
64
+
1. Select **Certificate Get** permission.
65
+
1. Select **Next**.
46
66
47
67
:::image type="content" alt-text="Screenshot of permissions selection in Key Vault." source="media\howto-custom-domain\portal-key-vault-permissions.png" :::
48
68
49
-
1. Search for the Azure Web PubSub Service resource name or the user assigned identity name. Click **Next**.
69
+
1. Search for the Azure Web PubSub Service resource name.
70
+
1. Select **Next**.
50
71
51
72
:::image type="content" alt-text="Screenshot of principal selection in Key Vault." source="media\howto-custom-domain\portal-key-vault-principal.png" :::
@@ -60,39 +81,41 @@ If you're using Azure role-based access control as Key Vault permission model:
60
81
:::image type="content" alt-text="Screenshot of Azure RBAC selected as Key Vault permission model." source="media\howto-custom-domain\portal-key-vault-perm-model-rbac.png" :::
61
82
62
83
1. Go to your Key Vault resource.
63
-
1.In the menu pane, select **Access control (IAM)**.
64
-
1.Click**Add**. Select **Add role assignment**.
84
+
1.Select **Go to access control (IAM)** from the menu.
85
+
1.Select**Add**, then select **Add role assignment** fro the drop-down.
65
86
66
87
:::image type="content" alt-text="Screenshot of Key Vault IAM." source="media\howto-custom-domain\portal-key-vault-iam.png" :::
67
88
68
-
1. Under the **Role** tab, select **Key Vault Secrets User**. Click**Next**.
89
+
1. Under the **Role** tab, select **Key Vault Secrets User**. Select**Next**.
69
90
70
91
:::image type="content" alt-text="Screenshot of role tab when adding role assignment to Key Vault." source="media\howto-custom-domain\portal-key-vault-role.png" :::
71
92
72
-
1. Under the **Members** tab, select **Managed identity**. 1. Search for the Azure Web PubSub Service resource name or the user assigned identity name. Click **Next**.
93
+
1. Under the **Members** tab, select **Managed identity**.
94
+
1. Search for and **Select** the Azure Web PubSub Service resource name or the user assigned identity name.
73
95
74
96
:::image type="content" alt-text="Screenshot of members tab when adding role assignment to Key Vault." source="media\howto-custom-domain\portal-key-vault-members.png" :::
75
97
76
-
1. Click **Review + assign**.
98
+
1. Select **Next**.
99
+
1. Select **Review + assign**.
77
100
78
101
-----
79
102
80
103
### Step 2: Create a custom certificate
81
104
82
105
1. In the Azure portal, go to your Azure Web PubSub Service resource.
83
106
1. In the menu pane, select **Custom domain**.
84
-
1.Under **Custom certificate**, click**Add**.
107
+
1.In the **Custom certificate** section, select**Add**.
85
108
86
109
:::image type="content" alt-text="Screenshot of custom certificate management." source="media\howto-custom-domain\portal-custom-certificate-management.png" :::
87
110
88
111
1. Fill in a name for the custom certificate.
89
-
1.Click**Select from your Key Vault** to choose a Key Vault certificate. After selection the following **Key Vault Base URI**, **Key Vault Secret Name**should be automatically filled. Alternatively you can also fill in these fields manually.
112
+
1.Select**Select from your Key Vault** to choose a Key Vault certificate. After selection the following **Key Vault Base URI**, the **Key Vault Secret Name**will be automatically filled in. Alternatively you can also fill in these fields manually.
90
113
1. Optionally, you can specify a **Key Vault Secret Version** if you want to pin the certificate to a specific version.
91
-
1.Click**Add**.
114
+
1.Select**Add**.
92
115
93
116
:::image type="content" alt-text="Screenshot of adding a custom certificate." source="media\howto-custom-domain\portal-custom-certificate-add.png" :::
94
117
95
-
Azure Web PubSub Service will then fetch the certificate and validate its content. If everything is good, the **Provisioning State** will be **Succeeded**.
118
+
Azure Web PubSub Service fetches the certificate and validates its contents. When it succeeds, the certificate's**Provisioning State** will be **Succeeded**.
96
119
97
120
:::image type="content" alt-text="Screenshot of an added custom certificate." source="media\howto-custom-domain\portal-custom-certificate-added.png" :::
98
121
@@ -102,11 +125,11 @@ To validate the ownership of your custom domain, you need to create a CNAME reco
102
125
103
126
For example, if your default domain is `contoso.webpubsub.azure.com`, and your custom domain is `contoso.example.com`, you need to create a CNAME record on `example.com` like:
104
127
105
-
```
128
+
```plaintext
106
129
contoso.example.com. 0 IN CNAME contoso.webpubsub.azure.com.
107
130
```
108
131
109
-
If you're using Azure DNS Zone, see [manage DNS records](../dns/dns-operations-recordsets-portal.md)for how to add a CNAME record.
132
+
If you're using Azure DNS Zone, see [manage DNS records](../dns/dns-operations-recordsets-portal.md)to learn how to add a CNAME record.
110
133
111
134
:::image type="content" alt-text="Screenshot of adding a CNAME record in Azure DNS Zone." source="media\howto-custom-domain\portal-dns-cname.png" :::
112
135
@@ -118,14 +141,14 @@ A custom domain is another sub resource of your Azure Web PubSub Service. It con
118
141
119
142
1. In the Azure portal, go to your Azure Web PubSub Service resource.
120
143
1. In the menu pane, select **Custom domain**.
121
-
1. Under **Custom domain**, click**Add**.
144
+
1. Under **Custom domain**, select**Add**.
122
145
123
146
:::image type="content" alt-text="Screenshot of custom domain management." source="media\howto-custom-domain\portal-custom-domain-management.png" :::
124
147
125
-
1.Fill in a name for the custom domain. It's the sub resource name.
126
-
1.Fill in the domain name. It's the full domain name of your custom domain, for example, `contoso.com`.
148
+
1.Enter a name for the custom domain. It's the sub resource name.
149
+
1.Enter the domain name. It's the full domain name of your custom domain, for example, `contoso.com`.
127
150
1. Select a custom certificate that applies to this custom domain.
128
-
1.Click**Add**.
151
+
1.Select**Add**.
129
152
130
153
:::image type="content" alt-text="Screenshot of adding a custom domain." source="media\howto-custom-domain\portal-custom-domain-add.png" :::
It should return `200` status code without any certificate error.
190
+
The health API should return `200` status code without any certificate error.
168
191
169
192
## Key Vault in private network
170
193
171
-
If you have configured [Private Endpoint](../private-link/private-endpoint-overview.md) to your Key Vault, Azure Web PubSub Service cannot access the Key Vault via public network. You need to set up a [Shared Private Endpoint](./howto-secure-shared-private-endpoints-key-vault.md) to let Azure Web PubSub Service access your Key Vault via private network.
194
+
If you've configured a [Private Endpoint](../private-link/private-endpoint-overview.md) to your Key Vault, Azure Web PubSub Service can't access the Key Vault via public network. You need to set up a [shared private endpoint](./howto-secure-shared-private-endpoints-key-vault.md) to let Azure Web PubSub Service access your Key Vault via private network.
172
195
173
-
After you create a Shared Private Endpoint, you can create a custom certificate as usual. **You don't have to change the domain in Key Vault URI**. For example, if your Key Vault base URI is `https://contoso.vault.azure.net`, you still use this URI to configure custom certificate.
196
+
After you create a shared private endpoint, you can create a custom certificate as usual. **You don't have to change the domain in Key Vault URI**. For example, if your Key Vault base URI is `https://contoso.vault.azure.net`, you still use this URI to configure custom certificate.
174
197
175
198
You don't have to explicitly allow Azure Web PubSub Service IPs in Key Vault firewall settings. For more info, see [Key Vault private link diagnostics](../key-vault/general/private-link-diagnostics.md).
176
199
177
200
## Next steps
178
201
179
-
+[How to enable managed identity for Azure Web PubSub Service](howto-use-managed-identity.md)
180
-
+[Get started with Key Vault certificates](../key-vault/certificates/certificate-scenarios.md)
181
-
+[What is Azure DNS](../dns/dns-overview.md)
202
+
*[How to enable managed identity for Azure Web PubSub Service](howto-use-managed-identity.md)
203
+
*[Get started with Key Vault certificates](../key-vault/certificates/certificate-scenarios.md)
0 commit comments