![](/img/trans.png)
[英]Is there a way to programmatically create an Azure ServiceBus Topic
[英]Create Azure ServiceBus Namaspace
这是使用Azure PowerShell cmdlet(例如,在美国东部)创建的方法:
New-AzureSBNamespace -Name "[YOUR SB NAMESPACE NAME]" -Location "East US"
总有REST API。 我尚未将其用于服务总线,或者请给我一个示例。 相反,这里是指向它的链接供您参考。 :)
http://msdn.microsoft.com/zh-CN/library/azure/jj856303.aspx
如果需要C#体验,还可以使用一个客户端库(处于预览状态)。
这是使用服务总线管理库的示例代码:
// Get this from the portal
var subscriptionId = "5f830156-0000-0000-0000-000000000000";
// Get this from your .publishsettings file
var managementCert = "MIIKFAI...really long string of base64...==";
var creds = new CertificateCloudCredentials(
subscriptionId,
new X509Certificate2(Convert.FromBase64String(managementCert)));
ServiceBusManagementClient sbMgmtClient = new ServiceBusManagementClient(creds);
sbMgmtClient.Namespaces.Create("[YOUR SB NAMESPACE NAME]", "East US");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.