Skip to content

Commit aec77c9

Browse files
Copilotswathipil
andcommitted
Update WebSockets example to use Azure Identity instead of connection string
Co-authored-by: swathipil <[email protected]>
1 parent d60ef1d commit aec77c9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

sdk/servicebus/azure-servicebus/TROUBLESHOOTING.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,13 @@ Connection errors can occur due to network issues, firewall restrictions, or ser
203203

204204
```python
205205
from azure.servicebus import ServiceBusClient, TransportType
206+
from azure.identity import DefaultAzureCredential
206207

207-
# Using connection string with WebSockets
208-
client = ServiceBusClient.from_connection_string(
209-
"your_connection_string",
208+
# Using Azure Identity with WebSockets
209+
credential = DefaultAzureCredential()
210+
client = ServiceBusClient(
211+
"your_namespace.servicebus.windows.net",
212+
credential,
210213
transport_type=TransportType.AmqpOverWebsocket
211214
)
212215
```

0 commit comments

Comments
 (0)