Skip to content

Commit 40192ad

Browse files
committed
Add DisableLocalAuth docs for SignalR/Web PubSub
1 parent a6d4c75 commit 40192ad

24 files changed

+224
-16
lines changed
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
---
2+
title: Disable local (access key) authentication with Azure SignalR Service
3+
description: This article provides information about how to disable access key authentication and use only Azure AD authentication.
4+
author: terencefan
5+
6+
ms.author: tefa
7+
ms.date: 03/31/2023
8+
ms.service: signalr
9+
ms.topic: conceptual
10+
---
11+
12+
# Disable local (access key) authentication with Azure SignalR Service
13+
14+
There are two ways to authenticate to Azure SignalR Service resources: Azure Active Directory (Azure AD) and Access Key. Azure AD provides superior security and ease of use over access key. With Azure AD, there’s no need to store the tokens in your code and risk potential security vulnerabilities. We recommend that you use Azure AD with your Azure SignalR Service resources when possible.
15+
16+
## Use Azure Portal
17+
18+
In this section, you will learn how to use the Azure portal to disable local authentication.
19+
20+
1. Navigate to your SignalR Service resource in the [Azure portal](https://portal.azure.com).
21+
22+
2. in the **Settings** section of the menu sidebar, select **Keys** blade.
23+
24+
3. Select **Disabled** for local authentication.
25+
26+
4. Click **Save** button.
27+
28+
![Screenshot of disabling local auth](./media/howto-azure-active-directory/disable-local-auth.png)
29+
30+
## Use Azure Resource Manager template
31+
32+
You can disable local authentication by setting `disableLocalAuth` property to true as shown in the following Azure Resource Manager template.
33+
34+
```json
35+
{
36+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
37+
"contentVersion": "1.0.0.0",
38+
"parameters": {
39+
"resource_name": {
40+
"defaultValue": "test-for-disable-aad",
41+
"type": "String"
42+
}
43+
},
44+
"variables": {},
45+
"resources": [
46+
{
47+
"type": "Microsoft.SignalRService/SignalR",
48+
"apiVersion": "2022-08-01-preview",
49+
"name": "[parameters('resource_name')]",
50+
"location": "eastus",
51+
"sku": {
52+
"name": "Premium_P1",
53+
"tier": "Premium",
54+
"size": "P1",
55+
"capacity": 1
56+
},
57+
"kind": "SignalR",
58+
"properties": {
59+
"tls": {
60+
"clientCertEnabled": false
61+
},
62+
"features": [
63+
{
64+
"flag": "ServiceMode",
65+
"value": "Default",
66+
"properties": {}
67+
},
68+
{
69+
"flag": "EnableConnectivityLogs",
70+
"value": "True",
71+
"properties": {}
72+
}
73+
],
74+
"cors": {
75+
"allowedOrigins": [
76+
"*"
77+
]
78+
},
79+
"serverless": {
80+
"connectionTimeoutInSeconds": 30
81+
},
82+
"upstream": {},
83+
"networkACLs": {
84+
"defaultAction": "Deny",
85+
"publicNetwork": {
86+
"allow": [
87+
"ServerConnection",
88+
"ClientConnection",
89+
"RESTAPI",
90+
"Trace"
91+
]
92+
},
93+
"privateEndpoints": []
94+
},
95+
"publicNetworkAccess": "Enabled",
96+
"disableLocalAuth": true,
97+
"disableAadAuth": false
98+
}
99+
}
100+
]
101+
}
102+
```
103+
104+
## Use Azure Policy
105+
106+
You can assign the [Azure SignalR Service should have local authentication methods disabled](https://ms.portal.azure.com/#view/Microsoft_Azure_Policy/PolicyDetailBlade/definitionId/%2Fproviders%2FMicrosoft.Authorization%2FpolicyDefinitions%2Ff70eecba-335d-4bbc-81d5-5b17b03d498f) Azure policy to an Azure subscription or a resource group to enforce disabling of local authentication for all SignalR resources in the subscription or the resource group.
107+
108+
![Screenshot of disabling local auth policy](./media/howto-azure-active-directory/disable-local-auth-policy.png)
109+
110+
## Next steps
111+
112+
See the following docs to learn about authentication methods.
113+
114+
- [Authenticate with Azure applications](./signalr-howto-authorize-application.md)
115+
- [Authenticate with managed identities](./signalr-howto-authorize-managed-identity.md)
87.2 KB
Loading
67.8 KB
Loading
63.4 KB
Loading
71.6 KB
Loading
61.7 KB
Loading
77.2 KB
Loading

articles/azure-signalr/signalr-howto-authorize-application.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ The first step is to register an Azure application.
2424
2. Under **Manage** section, select **App registrations**.
2525
3. Select **New registration**.
2626

27-
![Screenshot of registering an application](./media/authenticate/register-an-application.png)
27+
![Screenshot of registering an application](./media/howto-azure-active-directory/register-an-application.png)
2828

2929
4. Enter a display **Name** for your application.
3030
5. Select **Register** to confirm the register.
3131

3232
Once you have your application registered, you can find the **Application (client) ID** and **Directory (tenant) ID** under its Overview page. These GUIDs can be useful in the following steps.
3333

34-
![Screenshot of an application](./media/authenticate/application-overview.png)
34+
![Screenshot of an application](./media/howto-azure-active-directory/application-overview.png)
3535

3636
To learn more about registering an application, see
3737
- [Quickstart: Register an application with the Microsoft identity platform](../active-directory/develop/quickstart-register-app.md).
@@ -47,7 +47,7 @@ The application requires a client secret to prove its identity when requesting a
4747

4848
1. Under **Manage** section, select **Certificates & secrets**
4949
1. On the **Client secrets** tab, select **New client secret**.
50-
![Screenshot of creating a client secret](./media/authenticate/new-client-secret.png)
50+
![Screenshot of creating a client secret](./media/howto-azure-active-directory/new-client-secret.png)
5151
1. Enter a **description** for the client secret, and choose a **expire time**.
5252
1. Copy the value of the **client secret** and then paste it to a secure location.
5353
> [!NOTE]
@@ -57,7 +57,7 @@ The application requires a client secret to prove its identity when requesting a
5757

5858
You can also upload a certification instead of creating a client secret.
5959

60-
![Screenshot of uploading a certification](./media/authenticate/upload-certificate.png)
60+
![Screenshot of uploading a certification](./media/howto-azure-active-directory/upload-certificate.png)
6161

6262
To learn more about adding credentials, see
6363

articles/azure-signalr/signalr-howto-authorize-managed-identity.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ This example shows you how to configure `System-assigned managed identity` on a
2626
1. Open [Azure portal](https://portal.azure.com/), Search for and select a Virtual Machine.
2727
1. Under **Settings** section, select **Identity**.
2828
1. On the **System assigned** tab, toggle the **Status** to **On**.
29-
![Screenshot of an application](./media/authenticate/identity-virtual-machine.png)
29+
![Screenshot of an application](./media/howto-azure-active-directory/identity-virtual-machine.png)
3030
1. Select the **Save** button to confirm the change.
3131

3232

0 commit comments

Comments
 (0)