Azure Cloud Services를 프로그래밍 방식으로 관리하고 싶습니다.네이티브 C# API를 사용하여 Azure 클라우드 서비스를 관리 하시겠습니까?
저는 REST API를 알고 있지만 Azure Storage와 마찬가지로 네이티브 C# API를 사용할 수 있는지 궁금합니다.
REST API를 - 호스팅 서비스에 대한 운영 : http://msdn.microsoft.com/en-us/library/windowsazure/ee460812.aspx
또는 REST 아래의 게시물에 설명 된대로 자신을 무슨 API 내가 포장해야합니까? Azure - Cannot programmatically perform VIP Swap
감사합니다 : -
푸른 프로그래밍 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);
}
}
명령 릿 API를 통해 VM을 관리하거나 Azure CLI 도구 (노드로 작성)를 사용하여 VM을 관리 할 수 있습니다. 그게 내가 사용하는거야. – smcg
감사합니다. csmanage가 필요한 것 같습니다. 이제 코드를 이해하면됩니다. :-) –