internal static HostingEnvironmentProfile CreateHostingEnvironmentProfile(string subscriptionId, string resourceGroupName, string aseResourceGroupName, string aseName)
        {
            var rg            = string.IsNullOrEmpty(aseResourceGroupName) ? resourceGroupName : aseResourceGroupName;
            var aseResourceId = CmdletHelpers.GetAppServiceEnvironmentResourceId(subscriptionId, rg, aseName);

            return(new HostingEnvironmentProfile(
                       aseResourceId,
                       CmdletHelpers.AppServiceEnvironmentResourcesName,
                       aseName));
        }
Example #2
0
        public AppServicePlan CreateOrUpdateAppServicePlan(string resourceGroupName, string appServicePlanName, AppServicePlan appServicePlan, string aseName = null, string aseResourceGroupName = null)
        {
            if (!string.IsNullOrEmpty(aseName) &&
                !string.IsNullOrEmpty(aseResourceGroupName))
            {
                appServicePlan.HostingEnvironmentProfile = new HostingEnvironmentProfile(
                    id: CmdletHelpers.GetAppServiceEnvironmentResourceId(WrappedWebsitesClient.SubscriptionId, aseResourceGroupName, aseName),
                    name: aseName,
                    type: CmdletHelpers.AppServiceEnvironmentResourcesName);
            }

            return(WrappedWebsitesClient.AppServicePlans().CreateOrUpdate(resourceGroupName, appServicePlanName, appServicePlan));
        }