azure队列服务php连接字符串

时间:2015-01-15 16:21:52

标签: php azure queue

所以我想要一个脚本连接到队列并检索消息。在.NET应用程序中,我使用以下字符串进行连接,并且一切运行良好:

sb://host.com/USER;StsEndpoint=https://host.com:9355/USER/;RuntimePort=9354;ManagementPort=9355;SharedSecretIssuer=USER;SharedSecretValue=XXX';

它是一个非常大的字符串,但它在.NET中运行良好。但是对于php,我注意到在Azure php sdk文档中,连接字符串应该具有以下格式:

DefaultEndpointsProtocol=[http|https];AccountName=[yourAccount];AccountKey=[yourKey]

我不确定如何翻译"我有php所需格式的大网址。我尝试了以下但没有工作

DefaultEndpointsProtocol=https://host.com;AccountName=USER;AccountKey=XXX

任何人都知道连接字符串应该如何显示?提前致谢

2 个答案:

答案 0 :(得分:1)

我相信你混合了2件事 - 在.Net中的服务总线队列和在PHP中的Azure存储队列。您尝试在PHP中使用的连接字符串用于存储队列。根据此处的文档:https://github.com/Azure/azure-sdk-for-php(请参阅“入门”部分),Service Bus的连接字符串应采用以下格式:

  

端点= [yourEndpoint]; SharedSecretIssuer = [yourWrapAuthenticationName]; SharedSecretValue = [yourWrapPassword]

     

端点通常是格式   https://[yourNamespace].servicebus.windows.net

答案 1 :(得分:0)

这是一篇很棒的文章,展示了如何设置:

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

  

Endpoint = [yourEndpoint]; SharedSecretIssuer = [Default Issuer]; SharedSecretValue = [Default Key]

本文介绍如何设置通过PHP使用时需要的ACS连接:

https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-authentication-and-authorization