public static async deployAppService()

in src/extension/src/azure/azureServices.ts [198:242]


  public static async deployAppService(
    appService: IAppService,
    projectName: string,
    backendFrameworkLinuxVersion: string,
    path: string
  ): Promise<void> {
    const subscription = AzureServices.getSubscription(appService.subscription);
    const aspName = await AzureServices.AzureAppServiceProvider.generateValidASPName(projectName);

    const appServicePlan = AzureServices.IsMicrosoftLearnSubscription(subscription)
      ? CONSTANTS.SKU_DESCRIPTION.FREE
      : CONSTANTS.SKU_DESCRIPTION.BASIC;

    const userAppServiceSelection: AppServiceSelections = {
      siteName: appService.serviceName,
      subscriptionItem: subscription,
      resourceGroupItem: await AzureAuth.getResourceGroupItem(appService.resourceGroup, subscription),
      appServicePlanName: aspName,
      tier: appServicePlan.tier,
      sku: appServicePlan.name,
      linuxFxVersion: backendFrameworkLinuxVersion,
      location: appService.location,
    };

    await AzureServices.AzureAppServiceProvider.checkWebAppName(
      userAppServiceSelection.siteName,
      userAppServiceSelection.subscriptionItem
    )
      .then((invalidReason) => {
        if (invalidReason !== undefined && invalidReason === "") {
          throw new ValidationError(invalidReason);
        }
      })
      .catch((error: Error) => {
        throw error; //to log in telemetry
      });

    const result = await AzureServices.AzureAppServiceProvider.createWebApp(userAppServiceSelection, path);
    if (!result) {
      throw new Error(MESSAGES.ERRORS.APP_SERVICE_UNDEFINED_ID);
    }

    const id = AzureServices.convertId(result);
    AzureServices.updateAppServiceDeployInSettingsFile(path, id);
  }