Skip to content

Commit 5b4c2e1

Browse files
Apply suggestions from code review
Co-authored-by: Scott Addie <[email protected]>
1 parent 7a26834 commit 5b4c2e1

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

articles/service-bus-messaging/service-bus-migrate-azure-credentials.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ ms.service: service-bus
1010
ms.topic: how-to
1111
ms.custom:
1212
- devx-track-csharp
13-
- passwordless-java
14-
- passwordless-js
15-
- passwordless-python
1613
- passwordless-dotnet
1714
ms.devlang: csharp
1815
---
@@ -26,7 +23,9 @@ Application requests to Azure Service Bus must be authenticated using either acc
2623
The following code example demonstrates how to connect to Azure Service Bus using a connection string that includes an access key. When you create a Service Bus, Azure generates these keys and connection strings automatically. Many developers gravitate towards this solution because it feels familiar to options they've worked with in the past. If your application currently uses connection strings, consider migrating to passwordless connections using the steps described in this document.
2724

2825
```csharp
29-
var serviceBusClient = new ServiceBusClient("<NAMESPACE-CONNECTION-STRING>", clientOptions);
26+
var serviceBusClient = new ServiceBusClient(
27+
"<NAMESPACE-CONNECTION-STRING>",
28+
clientOptions);
3029
```
3130

3231
Connection strings should be used with caution. Developers must be diligent to never expose the keys in an unsecure location. Anyone who gains access to the key is able to authenticate. For example, if an account key is accidentally checked into source control, sent through an unsecure email, pasted into the wrong chat, or viewed by someone who shouldn't have permission, there's risk of a malicious user accessing the application. Instead, consider updating your application to use passwordless connections.
@@ -164,7 +163,7 @@ az containerapp identity assign \
164163
--name <app-name>
165164
```
166165

167-
### [Azure virtual machines](#tab/virtual-machines-identity)
166+
### [Azure Virtual Machines](#tab/virtual-machines-identity)
168167

169168
You can assign a managed identity to a virtual machine with the [az vm identity assign](/cli/azure/vm/identity) command.
170169

@@ -202,7 +201,7 @@ If you connected your services using the Service Connector you don't need to com
202201

203202
1. Navigate to your Service Bus overview page and select **Access Control (IAM)** from the left navigation.
204203

205-
1. Choose **Add role assignment**
204+
1. Choose **Add role assignment**.
206205

207206
:::image type="content" source="../../includes/passwordless/media/migration-add-role-small.png" alt-text="Screenshot showing how to add a role to a managed identity." lightbox="../../includes/passwordless/media/migration-add-role.png":::
208207

@@ -227,7 +226,7 @@ az servicebus show \
227226
--query id
228227
```
229228

230-
Copy the output ID from the preceding command. You can then assign roles using the az role command of the Azure CLI.
229+
Copy the output ID from the preceding command. You can then assign roles using the `az role` command of the Azure CLI.
231230

232231
```azurecli
233232
az role assignment create \
@@ -245,7 +244,3 @@ After making these code changes, browse to your hosted application in the browse
245244
## Next steps
246245

247246
In this tutorial, you learned how to migrate an application to passwordless connections.
248-
249-
You can read the following resources to explore the concepts discussed in this article in more depth:
250-
251-
* To learn more about .NET Core, see [Get started with .NET in 10 minutes](https://dotnet.microsoft.com/learn/dotnet/hello-world-tutorial/intro).

0 commit comments

Comments
 (0)