问题
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
回答1:
You need to set/select the subscription before you issue the new-azuresbnamespace command.
Select-AzureSubscription -SubscriptionName
来源:https://stackoverflow.com/questions/25684696/how-can-i-create-a-windows-service-acs-by-powershell-the-server-failed-to-authn