Skip to content

Commit 5e5d3ee

Browse files
Merge pull request #218004 from spelluru/sbusqueueqs1110
making passwordless the default option
2 parents 8968b17 + bc29649 commit 5e5d3ee

File tree

7 files changed

+252
-226
lines changed

7 files changed

+252
-226
lines changed
Loading

articles/service-bus-messaging/service-bus-dotnet-get-started-with-queues.md

Lines changed: 129 additions & 89 deletions
Large diffs are not rendered by default.

articles/service-bus-messaging/service-bus-dotnet-how-to-use-topics-subscriptions.md

Lines changed: 98 additions & 68 deletions
Large diffs are not rendered by default.
4.48 KB
Loading

includes/passwordless/service-bus/service-bus-assign-roles.md

Lines changed: 10 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -17,65 +17,29 @@ The following example assigns the `Azure Service Bus Data Owner` role to your us
1717
### Azure built-in roles for Azure Service Bus
1818
For Azure Service Bus, the management of namespaces and all related resources through the Azure portal and the Azure resource management API is already protected using the Azure RBAC model. Azure provides the below Azure built-in roles for authorizing access to a Service Bus namespace:
1919

20-
- [Azure Service Bus Data Owner](../../../articles/role-based-access-control/built-in-roles.md#azure-service-bus-data-owner): Enables data access to Service Bus namespace and its entities (queues, topics, subscriptions, and filters)
20+
- [Azure Service Bus Data Owner](../../../articles/role-based-access-control/built-in-roles.md#azure-service-bus-data-owner): Enables data access to Service Bus namespace and its entities (queues, topics, subscriptions, and filters). A member of this role can send and receive messages from queues or topics/subscriptions.
2121
- [Azure Service Bus Data Sender](../../../articles/role-based-access-control/built-in-roles.md#azure-service-bus-data-sender): Use this role to give the send access to Service Bus namespace and its entities.
2222
- [Azure Service Bus Data Receiver](../../../articles/role-based-access-control/built-in-roles.md#azure-service-bus-data-receiver): Use this role to give the receive access to Service Bus namespace and its entities.
2323

2424
If you want to create a custom role, see [Rights required for Service Bus operations](../../../articles/service-bus-messaging/service-bus-sas.md#rights-required-for-service-bus-operations).
2525

26-
> [!IMPORTANT]
27-
> In most cases, it will take a minute or two for the role assignment to propagate in Azure. In rare cases, it may take up to eight minutes. If you receive authentication errors when you first run your code, wait a few moments and try again.
26+
### Add Azure AD user to Azure Service Bus Owner role
2827

29-
### [Azure portal](#tab/roles-azure-portal)
28+
Add your Azure AD user name to the **Azure Service Bus Data Owner** role at the Service Bus namespace level. It will allow an app running in the context of your user account to send messages to a queue or a topic, and receive messages from a queue or a topic's subscription.
3029

31-
1. In the Azure portal, locate your service bus namespace using the main search bar or left navigation.
30+
> [!IMPORTANT]
31+
> In most cases, it will take a minute or two for the role assignment to propagate in Azure. In rare cases, it may take up to **eight minutes**. If you receive authentication errors when you first run your code, wait a few moments and try again.
3232
33+
1. If you don't have the Service Bus Namespace page open in the Azure portal, locate your Service Bus namespace using the main search bar or left navigation.
3334
2. On the overview page, select **Access control (IAM)** from the left-hand menu.
34-
3535
3. On the **Access control (IAM)** page, select the **Role assignments** tab.
36-
3736
4. Select **+ Add** from the top menu and then **Add role assignment** from the resulting drop-down menu.
3837

3938
:::image type="content" source="media/service-bus-assign-roles/add-role.png" alt-text="A screenshot showing how to assign a role.":::
40-
4139
5. Use the search box to filter the results to the desired role. For this example, search for `Azure Service Bus Data Owner` and select the matching result. Then choose **Next**.
40+
1. Under **Assign access to**, select **User, group, or service principal**, and then choose **+ Select members**.
4241

43-
6. Under **Assign access to**, select **User, group, or service principal**, and then choose **+ Select members**.
44-
45-
7. In the dialog, search for your Azure AD username (usually your *user@domain* email address) and then choose **Select** at the bottom of the dialog.
46-
47-
8. Select **Review + assign** to go to the final page, and then **Review + assign** again to complete the process.
48-
49-
### [Azure CLI](#tab/roles-azure-cli)
50-
51-
To assign a role at the resource level using the Azure CLI, you first must retrieve the resource ID using the `az servicebus namespace show` command. You can filter the output properties using the `--query` parameter.
52-
53-
```azurecli
54-
az servicebus namespace show -g '<your-service-bus-resource-group>' -n '<your-service-bus-name> --query id
55-
```
56-
57-
Copy the output `Id` from the preceding command. You can then assign roles using the [az role](/cli/azure/role) command of the Azure CLI.
58-
59-
```azurecli
60-
az role assignment create --assignee "<user@domain>" \
61-
--role "Azure Service Bus Data Owner" \
62-
--scope "<your-resource-id>"
63-
```
64-
65-
### [PowerShell](#tab/roles-powershell)
66-
67-
To assign a role at the resource level using Azure PowerShell, you first must retrieve the resource ID using the `Get-AzResource` command.
68-
69-
```azurepowershell
70-
Get-AzResource -ResourceGroupName "<your-service-bus-resource-group>" -Name "<your-service-bus-name>"
71-
```
72-
73-
Copy the `Id` value from the preceding command output. You can then assign roles using the [New-AzRoleAssignment](/powershell/module/az.resources/new-azroleassignment) command in PowerShell.
74-
75-
```azurepowershell
76-
New-AzRoleAssignment -SignInName <user@domain> `
77-
-RoleDefinitionName "Azure Service Bus Data Owner" `
78-
-Scope <yourStorageAccountId>
79-
```
42+
43+
1. In the dialog, search for your Azure AD username (usually your *user@domain* email address) and then choose **Select** at the bottom of the dialog.
44+
1. Select **Review + assign** to go to the final page, and then **Review + assign** again to complete the process.
8045

81-
---

includes/passwordless/service-bus/service-bus-create-namespace-portal-passwordless.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ To begin using Service Bus messaging entities in Azure, you must first create a
1616
To create a namespace:
1717

1818
1. Sign in to the [Azure portal](https://portal.azure.com)
19-
2. In the left navigation pane of the portal, select **+ Create a resource**, select **Integration**, and then select **Service Bus**.
19+
2. In the left navigation pane of the portal, select **All services**, select **Integration** from the list of categories, hover the mouse over **Service Bus**, and then select **Create** on the Service Bus tile.
2020

2121
:::image type="content" source="./media/service-bus-create-namespace-portal/create-resource-service-bus-menu.png" alt-text="Image showing selection of Create a resource, Integration, and then Service Bus in the menu.":::
2222
3. In the **Basics** tag of the **Create namespace** page, follow these steps:
@@ -32,7 +32,7 @@ To create a namespace:
3232
1. For **Pricing tier**, select the pricing tier (Basic, Standard, or Premium) for the namespace. For this quickstart, select **Standard**.
3333

3434
> [!IMPORTANT]
35-
> If you want to use [Topics and subscriptions](../../../articles/service-bus-messaging/service-bus-queues-topics-subscriptions.md#topics-and-subscriptions), choose either Standard or Premium. Topics/subscriptions aren't supported in the Basic pricing tier.
35+
> If you want to use [Topics and subscriptions](../../../articles/service-bus-messaging/service-bus-queues-topics-subscriptions.md#topics-and-subscriptions), choose either Standard or [Premium](../../../articles/service-bus-messaging/service-bus-premium-messaging.md). Topics/subscriptions aren't supported in the Basic pricing tier.
3636
3737
If you selected the **Premium** pricing tier, specify the number of **messaging units**. The premium tier provides resource isolation at the CPU and memory level so that each workload runs in isolation. This resource container is called a messaging unit. A premium namespace has at least one messaging unit. You can select 1, 2, 4, 8 or 16 messaging units for each Service Bus Premium namespace. For more information, see [Service Bus Premium Messaging](../../../articles/service-bus-messaging/service-bus-premium-messaging.md).
3838

@@ -45,4 +45,4 @@ To create a namespace:
4545
:::image type="content" source="./media/service-bus-create-namespace-portal/deployment-alert.png" alt-text="Image showing the deployment succeeded page with the Go to resource link.":::
4646
5. You see the home page for your service bus namespace.
4747

48-
:::image type="content" source="./media/service-bus-create-namespace-portal/service-bus-namespace-home-page.png" alt-text="Image showing the home page of the Service Bus namespace created." :::
48+
:::image type="content" source="./media/service-bus-create-namespace-portal/service-bus-namespace-home-page.png" lightbox="./media/service-bus-create-namespace-portal/service-bus-namespace-home-page.png" alt-text="Image showing the home page of the Service Bus namespace created." :::

includes/passwordless/service-bus/service-bus-passwordless-template-tabbed.md

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,6 @@ ms.custom: include file
1212

1313

1414

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](../../../articles/service-bus-messaging/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-passwordless-template-tabbed/connection-string.png" lightbox="./media/service-bus-create-namespace-portal/connection-string.png" alt-text="Screenshot shows an SAS 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-
3115
## [Passwordless](#tab/passwordless)
3216

3317
## Authenticate the app to Azure
@@ -40,13 +24,21 @@ A client can use the connection string to connect to the Service Bus namespace.
4024

4125
[!INCLUDE [service-bus-assign-roles](service-bus-assign-roles.md)]
4226

43-
### Sign in and add the Azure Identity package
4427

45-
You can authorize access to the service bus namespace using the following steps:
28+
## [Connection String](#tab/connection-string)
29+
30+
## Get the connection string
31+
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](../../../articles/service-bus-messaging/service-bus-authentication-and-authorization.md) for information about how to create rules with more constrained rights for regular senders and receivers.
32+
33+
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:
4634

47-
[!INCLUDE [default-azure-credential-sign-in](../../../includes/passwordless/default-azure-credential-sign-in.md)]
35+
1. On the **Service Bus Namespace** page, select **Shared access policies** on the left menu.
36+
3. On the **Shared access policies** page, select **RootManageSharedAccessKey**.
37+
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.
38+
39+
:::image type="content" source="./media/service-bus-passwordless-template-tabbed/connection-string.png" lightbox="./media/service-bus-create-namespace-portal/connection-string.png" alt-text="Screenshot shows an SAS policy called RootManageSharedAccessKey, which includes keys and connection strings.":::
4840

49-
[!INCLUDE [visual-studio-add-identity](../../../includes/passwordless/visual-studio-add-identity.md)]
41+
You can use this page to copy primary key, secondary key, primary connection string, and secondary connection string.
5042

5143

5244
---

0 commit comments

Comments
 (0)