Can I scale azure web apps/api apps using Azure Management libraries? I basically want to implement scaling up and down of web apps to handle throttling. Hence, I need to scale the web app and api apps via C# code. Any pointers to any apprpriate library/ ReST API?
With teh help of the answer mentioned below, I understand how to update the APP Service plan to scale out, however, I am not able to find webHostingPlanName for my APP Service. I tried with the below code, and hosting plan always comes out to be null.
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