Skip to content

Commit e6260c9

Browse files
Copilotalexweiningernturinski
authored
Fix deployment to stopped Function Apps with clear error message (#4664)
* Initial plan * Add check to block deployment to stopped Function Apps with clear error message Co-authored-by: alexweininger <[email protected]> * Revert main.js to original state Co-authored-by: nturinski <[email protected]> * Fix case sensitivity in stopped state check and remove deploy test file Co-authored-by: nturinski <[email protected]> * Don't suppress error message --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: alexweininger <[email protected]> Co-authored-by: nturinski <[email protected]> Co-authored-by: Nathan <[email protected]>
1 parent 91b5be7 commit e6260c9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/commands/deploy/deploy.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ async function deploy(actionContext: IActionContext, arg1: vscode.Uri | string |
9292
await node.initSite(context);
9393
const site = node.site;
9494

95+
// Check if the function app is stopped and block deployment with a clear error message
96+
if (site.rawSite.state?.toLowerCase() === 'stopped') {
97+
throw new Error(localize('functionAppStoppedError', 'Cannot deploy to function app "{0}" because it is currently stopped. Please start the function app before deploying.', site.fullName));
98+
}
99+
95100
const subscriptionContext: ISubscriptionContext & { subscription: AzureSubscription } = {
96101
...node.subscription,
97102
subscription: await subscriptionExperience(context, ext.rgApiV2.resources.azureResourceTreeDataProvider, {

0 commit comments

Comments
 (0)