title: How can I create a windows service ACS by powershell? The server failed to authneticate the request
body: <p>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.</p>
  
  <p><a href="http://msdn.microsoft.com/en-us/library/azure/dn170478.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/azure/dn170478.aspx</a></p>
  
  <p>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</p>
  
  <pre><code>New-AzureSBNamespace &lt;namespaceName&gt; "&lt;Region&gt;”
  </code></pre>
  
  <p>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.</p>
  
  <p>So, what I did is:</p>
  
  <pre><code>Get-AzurePublishSettingsFile
  </code></pre>
  
  <p>This made me download a file and then I used:</p>
  
  <pre><code>Import-AzurePublishSettingsFile –PublishSettingsFile "C:\Users\valencil\Google Drive\Tools\Pay-As-You-Go-9-5-2014-credentials.publishsettings"  
  </code></pre>
  
  <p>The import didnt throw any error, however when I tried:</p>
  
  <pre><code>New-AzureSBNamespace "levalencia" "West-Europe”
  </code></pre>
  
  <p>I got this error:</p>
  
  <pre><code>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
  </code></pre>