MasterHans
MasterHans

Reputation: 11

How to set up AZURE PHP SDK to SAS connection string

I am trying to fetch messages from topic and subscription of my client in Azur Service Bus. the connection string looks like this:

$connectionString = 
"Endpoint=<namespacename>.servicebus.windows.net;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=<your_key_from_the_portal>"

This is what my client gave to me and this is new Shared Access Signature (SAS) format. But as I admit Azur PHP SDK using the old ACS format connection string looks like this:

$connectionString =
"Endpoint=sb://mynamespace.servicebus.windows.net/;SharedSecretIssuer=owner;SharedSecretValue=[MyVal]";

I saw some answers here which recommended to set up Azur portal to use ACS connection string format. Is there any way to change or set up Azur PHP SDK to use the new type of connection string?

Upvotes: 0

Views: 290

Answers (1)

Aaron Chen
Aaron Chen

Reputation: 9950

As far as I know, the current PHP Service Bus APIs(v5.0.0) only support ACS connection strings. Currently, you can create ACS connection strings via Azure Powershell:

First, make sure you have Azure PowerShell installed, then in a PowerShell command prompt, run

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

You can refer to https://github.com/Azure/azure-sdk-for-php#service-bus-queues for more info.

Upvotes: 1

Related Questions