通过Powershell或API扩展Azure服务总线 [英] Scale Azure Service Bus through Powershell or API

查看:61
本文介绍了通过Powershell或API扩展Azure服务总线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Azure上创建新的Serviec总线,然后使用自动化脚本对其进行扩展.

I want to create a new Serviec Bus on Azure and then scale it up by using automation script.

现在,我可以通过powershell cmdlet成功创建服务总线 New-AzureSBNamespace -Name $Namespace -Location $Location -CreateACSNamespace $CreateACSNamespace -NamespaceType Messaging 但是我找不到任何cmdlet或Azure管理API来扩展其容量.

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.

通过nuget安装WindowsAzure.ServiceBus之后,我发现了此类

After installing WindowsAzure.ServiceBus via nuget I found this class

new Microsoft.ServiceBus.Management.MessagingSKUPlan(){SKU=2, SelectedEventHubUnit = 20 }; 但是我不知道如何使用它来扩展服务总线

new Microsoft.ServiceBus.Management.MessagingSKUPlan(){SKU=2, SelectedEventHubUnit = 20 }; But I don't know how to use it to scale the service bus

我找到了一个终点 https://manage.windowsazure.com/ServiceBus/UpdateMessagingSKUPlan http://manage.windowsazure.net 使用的用于扩展服务总线的功能,但它使用的是http cookie从使用MS证书的Powershell普通身份验证难以实现的身份验证.

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.

我的问题是,有什么方法可以从Powershell或api扩展Azure服务总线吗? 如果没有,是否知道如何调用 https://manage.windowsazure.com/ServiceBus/UpdateMessagingSKUPlan 我的自动化脚本中的api?

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?

推荐答案

ThroughPut单位是命名空间级别的设置,并且需要对Azure管理终结点进行REST API调用.这需要两个步骤:

ThroughPut units is a Namespace level setting and will require a REST API call to the Azure Management endpoint. This requires two steps:

  1. 首先在NS上执行GET以获取现有的NamespaceSKUPlan 请求Uri格式:https://management.core.windows.net/<subscriptipn id>/services/ServiceBus/Namespaces/<namespaceName>/MessagingPlan
  2. 然后在此属性中的相同Uri填充上执行剩余PUT操作: <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>
  1. First do a GET on NS to get the existing NamespaceSKUPlan Request Uri format: https://management.core.windows.net/<subscriptipn id>/services/ServiceBus/Namespaces/<namespaceName>/MessagingPlan
  2. Then perform a rest PUT operation on the same Uri stuffing in this properties: <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>

这篇关于通过Powershell或API扩展Azure服务总线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆