|
| 1 | +--- |
| 2 | +title: "include file" |
| 3 | +description: "include file" |
| 4 | +services: storage |
| 5 | +author: alexwolfmsft |
| 6 | +ms.service: storage |
| 7 | +ms.topic: include |
| 8 | +ms.date: 09/09/2022 |
| 9 | +ms.author: alexwolf |
| 10 | +ms.custom: include file |
| 11 | +--- |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | +## [Connection String](#tab/connection-string) |
| 16 | + |
| 17 | +## Get the connection string |
| 18 | +Creating a new namespace automatically generates an initial Shared Access Signature (SAS) policy with primary and secondary keys, and primary and secondary connection strings that each grant full control over all aspects of the namespace. See [Service Bus authentication and authorization](../service-bus-authentication-and-authorization.md) for information about how to create rules with more constrained rights for regular senders and receivers. |
| 19 | + |
| 20 | +A client can use the connection string to connect to the Service Bus namespace. To copy the primary connection string for your namespace, follow these steps: |
| 21 | + |
| 22 | +1. On the **Service Bus Namespace** page, select **Shared access policies** on the left menu. |
| 23 | +3. On the **Shared access policies** page, select **RootManageSharedAccessKey**. |
| 24 | +4. In the **Policy: RootManageSharedAccessKey** window, select the copy button next to **Primary Connection String**, to copy the connection string to your clipboard for later use. Paste this value into Notepad or some other temporary location. |
| 25 | + |
| 26 | + :::image type="content" source="./media/service-bus-create-namespace-portal/connection-string.png" lightbox="./media/service-bus-create-namespace-portal/connection-string.png" alt-text="Screenshot shows an S A S policy called RootManageSharedAccessKey, which includes keys and connection strings."::: |
| 27 | + |
| 28 | + You can use this page to copy primary key, secondary key, primary connection string, and secondary connection string. |
| 29 | + |
| 30 | + |
| 31 | +## [Passwordless (Recommended)](#tab/passwordless) |
| 32 | + |
| 33 | +## Authenticate the app to Azure |
| 34 | + |
| 35 | +[!INCLUDE [passwordless-overview](../../../includes/passwordless/passwordless-overview.md)] |
| 36 | + |
| 37 | +[!INCLUDE [passwordless-default-azure-credential-overview](../../../includes/passwordless/dotnet-default-azure-credential-overview.md)] |
| 38 | + |
| 39 | +### Assign roles to your Azure AD user |
| 40 | + |
| 41 | +[!INCLUDE [service-bus-assign-roles](service-bus-assign-roles.md)] |
| 42 | + |
| 43 | +### Sign in and add the Azure Identity package |
| 44 | + |
| 45 | +You can authorize access to the service bus namespace using the following steps: |
| 46 | + |
| 47 | +[!INCLUDE [default-azure-credential-sign-in](../../../includes/passwordless/default-azure-credential-sign-in.md)] |
| 48 | + |
| 49 | +[!INCLUDE [visual-studio-add-identity](../../../includes/passwordless/visual-studio-add-identity.md)] |
| 50 | + |
| 51 | + |
| 52 | +--- |
0 commit comments