Am able to create the queue with the below code,
$queuename = "samplequeue"
$CurrentNamespace = Get-AzureSBNamespace -Name "mynamespace"
$NamespaceManager = [Microsoft.ServiceBus.NamespaceManager]::CreateFromConnectionString($CurrentNamespace.ConnectionString);
$QueueDescription = New-Object -TypeName Microsoft.ServiceBus.Messaging.QueueDescription -ArgumentList $queuename
$NamespaceManager.CreateQueue($QueueDescription);
I am looking for powershell cmdlets to create/ manage Shared Access Policy for a ServiceBus Queue.
Am able to add it from the management portal.
Also tried the below cmdlet,
New-AzureSBAuthorizationRule -Name "readwritepolicy" -Namespace "mynamespace"-Permission $("Send") -EntityName "notsure" -EntityType "Queue"
which gives me the below error,
New-AzureSBAuthorizationRule : Object reference not set to an instance of an object.
At line:1 char:1+ New-AzureSBAuthorizationRule -Name "readwritepolicy" -Namespace "mynamespace" ...+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo : CloseError: (:) [New-AzureSBAuthorizationRule], NullReferenceException+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.ServiceBus.NewAzureSBAuthorizationRuleCommand
Am i doing anything wrong? What is EntityName ?