使用ACS创建Azure服务总线(用于PHP集成)

问题描述:

我一直在尝试设置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

您可能需要添加-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'登录? –