import type { WebSiteManagementModels } from "@azure/arm-appservice" ; import { IActionContext } from "vscode-azureextensionui" ; import { ext } from "./extensionVariables" ; import { localize } from "./localize" ; import { ParsedSite } from "./SiteClient" ; export async function verifyNoRunFromPackageSetting ( context , site ) { let updateSettings = false ; const runFromPackageSettings = [ 'WEBSITE_RUN_FROM_PACKAGE' , 'WEBSITE_RUN_FROM_ZIP' ] ; const client = await site . createClient ( context ) ; const applicationSettings = await client . listApplicationSettings ( ) ; for ( const settingName of runFromPackageSettings ) { if ( applicationSettings . properties && applicationSettings . properties [ settingName ] ) { delete applicationSettings . properties [ settingName ] ; ext . outputChannel . appendLog ( localize ( 'deletingSetting' , 'Deleting setting "{0}"...' , settingName ) , { resourceName : site . fullName } ) ; updateSettings = true ; } } if ( updateSettings ) { await client . updateApplicationSettings ( applicationSettings ) ; } }