Quantcast
Channel: Service Bus forum
Viewing all articles
Browse latest Browse all 1916

How to get Service Bus queue connection string using PowerShell or .Net assembly Microsoft.ServiceBus.dll?

$
0
0

Hi

I need to get the ConnectionString of a Service Bus Queue using PowerShell or at least the using the .Net assembly Microsoft.ServiceBus.dll via PowerShell. I need it to put in a config file. I need the ConnectionString for an actual queue not just the Service Bus itself.

I have tried the code below but the ConnectionString doesn't seem to exist here so I'm not sure where to get it. Can anyone help please?

$CurrentNamespace = Get-AzureSBNamespace -Name $ServiceBusNamespace
$NamespaceManager = [Microsoft.ServiceBus.NamespaceManager]::CreateFromConnectionString($CurrentNamespace.ConnectionString);
$NamespaceManager.GetQueue($Queue) | select -ExpandProperty ConnectionString

Thanks

Robert


Viewing all articles
Browse latest Browse all 1916

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>