我可以使用Azure管理庫來擴展Azure Web應用程序/ api應用程序嗎?我基本上想要實現擴展和縮小Web應用程序來處理節流。因此,我需要通過C#代碼來擴展Web應用程序和api應用程序。任何指向任何apprpriate庫/ ReST API的指針?Azure網站縮放
隨着下面提到的答案的幫助,我瞭解如何更新APP服務計劃以擴展,但是,我無法爲我的APP服務找到webHostingPlanName。我嘗試了下面的代碼,並且託管計劃總是出現爲空。
var regionName = "myregion";
var credentials = GetCredentials();
var websiteManagementClient = CloudContext.Clients.CreateWebSiteManagementClient(credentials);
var webSpaces = websiteManagementClient.WebSpaces.List();
var webSpace = webSpaces.FirstOrDefault(x => x.GeoRegion == regionName);
if (webSpace == null)
{
throw new Exception(string.Format("No webspace for region {0} found", regionName));
}
var webHostingPlans = websiteManagementClient.WebHostingPlans.List(webSpace.Name);
var webHostingPlan = webHostingPlans.FirstOrDefault();// this is null always, I know an APP service exists in this region
的可能的複製[如何擴展Azure雲服務上下從的WebAPI REST API] (HTTP://計算器。com/questions/19197445/how-to-scale-azure-cloud-service-up-and-down-from-rest-api-with-webapi) –