1

So, I downloaded the azure powershell because I wanted to create a service bus namespace with an attached ACS by powershell, something that apparently cant be done anymore via the UI.

http://msdn.microsoft.com/en-us/library/azure/dn170478.aspx

Service Bus authentication through ACS is managed through a companion “-sb” ACS namespace. If you want a companion ACS namespace to be created for a Service Bus namespace, create your Service Bus namespace using the New-AzureSBNamespace PowerShell cmdlet. For example: Windows PowerShell

New-AzureSBNamespace <namespaceName> "<Region>”

For example, if you create a Service Bus namespace called contoso.servicebus.windows.net, a companion ACS namespace called contoso-sb.accesscontrol.windows.net is provisioned automatically. For all namespaces that were created before August 2014, an accompanying ACS namespace was created.

So, what I did is:

Get-AzurePublishSettingsFile

This made me download a file and then I used:

Import-AzurePublishSettingsFile –PublishSettingsFile "C:\Users\valencil\Google Drive\Tools\Pay-As-You-Go-9-5-2014-credentials.publishsettings"  

The import didnt throw any error, however when I tried:

New-AzureSBNamespace "levalencia" "West-Europe”

I got this error:

New-AzureSBNamespace : ForbiddenError: The server failed to authenticate the request. Verify that the certificate is valid and is associated with this 
subscription.
At line:1 char:1
+ New-AzureSBNamespace "levalencia" "West-Europe”
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [New-AzureSBNamespace], CloudException
    + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.ServiceBus.NewAzureSBNamespaceCommand
Luis Valencia
  • 32,619
  • 93
  • 286
  • 506

1 Answers1

3

You need to set/select the subscription before you issue the new-azuresbnamespace command.

Select-AzureSubscription -SubscriptionName

BrentDaCodeMonkey
  • 5,493
  • 20
  • 18
  • that doesnt exist. maybe u meant this http://msdn.microsoft.com/en-us/library/dn722501.aspx – Luis Valencia Sep 05 '14 at 12:45
  • I think you're missing some of the azure powershell bits as select-azuresubscription does indeed exist: http://msdn.microsoft.com/en-us/library/dn495203.aspx I also just verified the presence of this cmdlet on my own machine (which has Azure Powershell 8.7.1) – BrentDaCodeMonkey Sep 05 '14 at 13:20
  • it worked for me with set, my bus name was wrong, I suppose SET and SELECT do the same? http://screencast.com/t/Mwp3f9Ithir – Luis Valencia Sep 05 '14 at 13:29
  • select-azuresubscription, i think you mean – Elaine Jul 13 '15 at 11:38