-
Notifications
You must be signed in to change notification settings - Fork 149
Expand file tree
/
Copy pathstartFunctionApp.ts
More file actions
26 lines (22 loc) · 1.06 KB
/
startFunctionApp.ts
File metadata and controls
26 lines (22 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { type SiteClient } from '@microsoft/vscode-azext-azureappservice';
import { type IActionContext } from '@microsoft/vscode-azext-utils';
import { localize } from '../localize';
import { type SlotTreeItem } from '../tree/SlotTreeItem';
import { pickFunctionApp } from '../utils/pickFunctionApp';
export async function startFunctionApp(context: IActionContext, node?: SlotTreeItem): Promise<void> {
if (!node) {
node = await pickFunctionApp(context);
}
const client: SiteClient = await node.site.createClient(context);
await node.runWithTemporaryDescription(
context,
localize('starting', 'Starting...'),
async () => {
await client.start();
}
);
}