How can I create a windows service ACS by powershell? The server failed to authneticate the request

馋奶兔 提交于 2019-12-24 16:17:26

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!