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-use-managed-identity.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,14 +10,14 @@ ms.author: lianwei
10
10
11
11
# Use a managed identity
12
12
13
-
This article shows you how to create and use a managed identity for Azure Web PubSub.
13
+
This article shows you how to create and use a managed identity in Azure Web PubSub.
14
14
15
15
> [!IMPORTANT]
16
16
> Azure Web PubSub can support only one managed identity. You can add *either* a system-assigned identity or a user-assigned identity.
17
17
18
18
## Add a system-assigned identity
19
19
20
-
To set up a managed identity in the Azure portal, create an Azure Web PubSub instance, and then enable the feature.
20
+
To set up a managed identity in the Azure portal, create an Azure Web PubSub instance, and then turn on the feature.
21
21
22
22
1. In the Azure portal, create a Web PubSub resource. Go to the resource in the portal.
23
23
@@ -41,13 +41,13 @@ To create a Web PubSub resource by using a user-assigned identity, create the id
41
41
42
42
1. Search for the identity that you created and select it. Select **Add**.
43
43
44
-
:::image type="content" source="media/howto-use-managed-identity/user-identity-portal.png" alt-text="Screenshot that shows adding a user-assigned identity in the Azure portal":::
44
+
:::image type="content" source="media/howto-use-managed-identity/user-identity-portal.png" alt-text="Screenshot that shows adding a user-assigned identity in the Azure portal.":::
45
45
46
46
## Use a managed identity in client events scenarios
47
47
48
-
Azure Web PubSub is a fully managed service, so you can't use a managed identity to manually get tokens. Instead, when Web PubSub sends events to an event handler, it uses the managed identity to get an access token. The service then sets the access token in the `Authorization` header in the HTTP request.
48
+
Azure Web PubSub is a fully managed service, so you can't use a managed identity to manually get tokens. Instead, when Web PubSub sends events to an event handler, it uses the managed identity to get an access token. The service then sets the access token in the `Authorization` header of the HTTP request.
49
49
50
-
### Managed identity authentication in event handler settings
50
+
### Set up managed identity authentication for an event handler
51
51
52
52
1. Add a system-assigned identity or a user-assigned identity.
53
53
@@ -63,11 +63,11 @@ Azure Web PubSub is a fully managed service, so you can't use a managed identity
63
63
- Use the Application ID URI of the service principal.
64
64
65
65
> [!IMPORTANT]
66
-
> Using an empty resource actually acquires a token target for Microsoft Graph. Currently, Microsoft Graph enables token encryption, so it's not supported for an application to authenticate the token other than with Microsoft Graph. You should always create a service principal to represent your upstream target. Set **Application ID** or **Application ID URI** for the service principal you created.
66
+
> Using an empty resource actually acquires a token target for Microsoft Graph. Currently, Microsoft Graph enables token encryption, so it's not supported for an application to authenticate the token other than with Microsoft Graph. You should always create a service principal to represent your upstream target. Set the **Application ID** or **Application ID URI** value for the service principal you created.
67
67
68
68
#### Authentication in an Azure Functions app
69
69
70
-
You can easily set access validation for a Functions app without code changes.
70
+
You can easily set access validation for a Functions app without making code changes.
71
71
72
72
1. In the Azure portal, go to the Functions app.
73
73
1. On the left menu, select **Authentication**.
@@ -89,11 +89,11 @@ If you're not using the Web Apps feature of Azure App Service or Azure Functions
89
89
90
90
The token in the `Authorization` header is a [Microsoft identity platform access token](../active-directory/develop/access-tokens.md).
91
91
92
-
To validate access tokens, your app should also validate the audience and the signing tokens. Signing tokens must be validated against the values in the OpenID discovery document. For example, see the [tenant-independent version of the document](https://login.microsoftonline.com/common/.well-known/openid-configuration).
92
+
To validate an access token, your app should also validate the audience and the signing token. Signing tokens must be validated against the values in the OpenID discovery document. For an example, see the [tenant-independent version of the document](https://login.microsoftonline.com/common/.well-known/openid-configuration).
93
93
94
-
The Microsoft Entra middleware has built-in capabilities for validating access tokens. You can browse our [samples](../active-directory/develop/sample-v2-code.md) to find one in the language that you want to use.
94
+
Microsoft Entra middleware has built-in capabilities for validating access tokens. You can browse our [samples](../active-directory/develop/sample-v2-code.md) to find one that's written in the language you want to use.
95
95
96
-
We provide libraries and code samples that show you how to handle token validation. There are also several open-source partner libraries available for JSON Web Token (JWT) validation. There's at least one option for almost every platform and language. For more information about Microsoft Entra authorization libraries and code samples, see [Microsoft identity platform authentication libraries](../active-directory/develop/reference-v2-libraries.md).
96
+
We provide libraries and code samples that show you how to handle token validation. Several open-source partner libraries also are available for JSON Web Token (JWT) validation. There's at least one option for almost every platform and language. For more information about Microsoft Entra authorization libraries and code samples, see [Microsoft identity platform authentication libraries](../active-directory/develop/reference-v2-libraries.md).
97
97
98
98
If the event handler hosts in Azure Functions or Web Apps, an easy way is to [configure Microsoft Entra sign-in](../app-service/configure-authentication-provider-aad.md).
99
99
@@ -103,7 +103,7 @@ Web PubSub can access a key vault to get a secret by using a managed identity.
103
103
104
104
1. Add a system-assigned identity or a user-assigned identity for Azure Web PubSub.
105
105
106
-
1. In the key vault, grant secret read permissions for the managed identity via access policies. For more information, see [Assign a key vault access policy by using the Azure portal](/azure/key-vault/general/assign-access-policy-portal).
106
+
1. In the key vault, grant secret read permissions for the managed identity by using access policies. For more information, see [Assign a key vault access policy in the Azure portal](/azure/key-vault/general/assign-access-policy-portal).
107
107
108
108
Currently, this feature can be used in the following scenario:
0 commit comments