我想以编程方式管理我的Azure的云服务。
我知道的REST API,但我想知道,如果是可用的原生C#API只是想有一个与Azure存储。
REST API -托管服务业务: http://msdn.microsoft.com/en-us/library/windowsazure/ee460812.aspx
或者我需要包装的REST API自己在下面的描述后?
Azure的-不能以编程方式进行VIP交换: 天青-不能以编程方式进行VIP交换
谢谢。
编辑:
该CSManage建议对我帮助很大。
您可以重用ServiceManagement项目,并编写自己的客户端(而非CSManage)。
使用ServiceManagementHelper设置一个信道,以执行所述命令。
例:
public static string SubscriptionId { get; set; }
public static string CertificateThumbprint { get; set; }
public static X509Certificate2 Certificate { get; set; }
private void button1_Click(object sender, EventArgs e)
{
SubscriptionId = ConfigurationManager.AppSettings["SubscriptionId"];
CertificateThumbprint = ConfigurationManager.AppSettings["CertificateThumbprint"];
X509Store certificateStore = new X509Store(StoreName.My, StoreLocation.CurrentUser);
certificateStore.Open(OpenFlags.ReadOnly);
X509Certificate2Collection certs = certificateStore.Certificates.Find(X509FindType.FindByThumbprint, CertificateThumbprint, false);
if (certs.Count != 1)
{
MessageBox.Show("Client certificate cannot be found. Please check the config file. ");
return;
}
Certificate = certs[0];
// List Hosted Services
var channel = ServiceManagementHelper.CreateServiceManagementChannel("WindowsAzureEndPoint", Certificate);
var lhs = channel.ListHostedServices(SubscriptionId);
foreach (HostedService hs in lhs)
{
MessageBox.Show(hs.ServiceName);
}
}