Reputation: 954
I want to create a new Serviec Bus on Azure and then scale it up by using automation script.
Right now I can create the service bus successfully by powershell cmdlet
New-AzureSBNamespace -Name $Namespace -Location $Location -CreateACSNamespace $CreateACSNamespace -NamespaceType Messaging
But I can't find any cmdlet or azure management API to scale its capacity.
After installing WindowsAzure.ServiceBus via nuget I found this class
new Microsoft.ServiceBus.Management.MessagingSKUPlan(){SKU=2, SelectedEventHubUnit = 20 };
But I don't know how to use it to scale the service bus
I've found an end point https://manage.windowsazure.com/ServiceBus/UpdateMessagingSKUPlan
that used by http://manage.windowsazure.net to scale the service bus, but it's using http cookie for authentication which is hard to implement from Powershell normal authentication that using MS certificate.
My question is is there any way to scale the azure service bus from Powershell or an api? If not, is there any idea how to call https://manage.windowsazure.com/ServiceBus/UpdateMessagingSKUPlan api from my automation script?
Upvotes: 1
Views: 687
Reputation: 11
See
Set-AzureRmServiceBusNamespace -SkuCapacity 2 -ResourceGroupName <busName>
Upvotes: 1
Reputation: 954
ThroughPut units is a Namespace level setting and will require a REST API call to the Azure Management endpoint. This requires two steps:
https://management.core.windows.net/<subscriptipn id>/services/ServiceBus/Namespaces/<namespaceName>/MessagingPlan
<NamespaceSKUPlan xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<SKU>{1 or 2}</SKU>
<SelectedEventHubUnit>{1 - 20}</SelectedEventHubUnit>
<Revision>{value from previous GET}</Revision>
</NamespaceSKUPlan>
Upvotes: 3