2017-07-03 64 views
3

我一直在嘗試設置ACS名稱空間以啓用從PHP集成應用程序訪問。這是門戶網站中的一個選項,但現在已被刪除,所以我試圖通過PowerShell創建名稱空間。正如您從註釋行中看到的,我一直在嘗試幾種方法。天藍色的環境是在過去幾周內建立的。使用ACS創建Azure服務總線(用於PHP集成)

#Add-AzureRMAccount 
Login-AzureRmAccount -SubscriptionId "my-guid" 
#Select-AzureRMSubscription -SubscriptionId "my-guid" | Select-AzureRmSubscription 
Get-AzureRmSubscription -SubscriptionId "my-guid" | Select-AzureRmSubscription 
New-AzureSBNamespace -Name "myservicebus.servicebus.windows.net" -Location "UK South" -CreateACSNamespace $true -NamespaceType Messaging 

我曾嘗試多種組合,但我不斷收到同樣的錯誤,當我致電新AzureSBNamespace方法,該方法如下:「沒有默認訂閱已被指定爲」

enter image description here

編輯:我現在可以通過power shell創建命名空間/服務總線,但似乎沒有爲它創建ACS。

Login-AzureRmAccount -SubscriptionId "2a428947-cc0e-4fa5-aef2-a7ad0fe7a26e" 
Get-AzureRmSubscription -SubscriptionId "2a428947-cc0e-4fa5-aef2-a7ad0fe7a26e" | Select-AzureRmSubscription 
New-AzureRmServiceBusNamespace -ResourceGroup StevenStone-Shop -NamespaceName my-service-bus -Location UKSouth -SkuName "Basic" 

爲什麼我試圖做到這一點的原因是,我可以用一個連接通過PHP連接,如下圖所示:

「終點= [yourEndpoint]; SharedSecretIssuer = [預設發行]; SharedSecretValue = [默認密鑰]」

https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-php-how-to-use-queues

+0

正在更新powershell/azure命令 - https://docs.microsoft.com/en-us/powershell/azure/install-azurerm-ps?view=azurermps-4.1.0新方法 - https://docs.microsoft .com/en-us/powershell/module/azurerm.servicebus /?view = azurermps-4.1.0 – Andrew

回答

0

您可能需要添加-CreateACSNamespace $true以創建新的ACS Service Bus名稱空間的命令。

Add-AzureAccount # this will sign you in 
New-AzureSBNamespace -CreateACSNamespace $true -Name 'mytestbusname' -Location 'West US' -NamespaceType 'Messaging' 

enter image description here

如果成功的話,你會得到PowerShell的輸出連接字符串。如果您發現連接錯誤並且連接字符串看起來像Endpoint=sb://...,請將其更改爲Endpoint=https://...

欲瞭解更多詳情,請參閱this post

+0

我相信這隻適用於舊門戶,並不使用New-AzureRmServiceBusNamespace,這是我可用的(通過CSP,因此我們只能獲得新的門戶) – Andrew

+0

您是否嘗試在ASM模式下使用'Add-AzureAccount'登錄? –