We have a few standard websites in our azure subscription. We are trying to automate some tasks, one being creating a site in Azure. We are using the 'Microsoft Azure Web Sites Management Library' from Nuget. We are using the below code, but in spite of telling it dedicated, it always gets created as a Free site and not Standard.
domain is a string containing the domain for the site. hostName is a string containing the domain + 'azurewebsites.net', domain has periods stripped for hostName. ws is a WebSpace object that we retrieved from calling previous Azure methods for our subscription.
var newSite = new WebSiteCreateParameters();
newSite.Name = domain;
newSite.HostNames.Add(hostName);
newSite.ComputeMode = WebSiteComputeMode.Dedicated;
newSite.ServerFarm = "DefaultServerFarm";
newSite.WebSpaceName = ws.Name;
newSite.WebSpace = new WebSiteCreateParameters.WebSpaceDetails()
{
GeoRegion = ws.GeoRegion,
Name = ws.Name,
Plan = ws.Plan
};
var r = await AzureClient.WebSites.CreateAsync(
ws.Name,
newSite,
new System.Threading.CancellationToken()
);