Open v-xinda opened 2 years ago
I've been able to reproduce this intermittently. In some cases, it looks like the function app resource item doesn't have a set appSettingsTreeItem
. This appears set only when loading children, so perhaps a bug when commands that need the property are invoked before the item is expanded?
Workaround appears to be to expand the function app node first before deploying.
May be the same as #3219.
We also meet this exception when test java 17 support in VSCode, which seems caused by https://github.com/microsoft/vscode-azurefunctions/blob/main/src/commands/deploy/verifyAppSettings.ts#L41, as node.appSettingsTreeItem
may be undefined if node is not expanded. Resolved in commit https://github.com/microsoft/vscode-azurefunctions/pull/3311/commits/ec8fe909ad27c9d496f78a23448f97412c0cf6a7
@philliphoff I ran into this after deploying to a freshly created app from the portal, specifically after the extension added WEBSITE_RUN_FROM_PACKAGE
to the app settings (VS Code will add that setting by default for windows apps, but the portal won't). It seems to happen consistently if I remove that setting before deploy, but not if I have that setting. So I wonder if it's related to updating app settings during deploy
@ejizba. Yes, looking at the code, if the extension needs to update the app settings during deployment, it needs the appSettingsTreeItem
property be available. However, this only appears to be set when the app node has been expanded. If no settings need to be updated during deployment, that logic is skipped.
OS: Win 10 Build Version: 20220902.7 Regression: Previous release
Repro Steps:
Expect: Succeed to deploy the nodejs project to a function app.
Actual: Fail to deploy the nodejs project to a function app.
More Info:
AzureWebJobsFeatureFlags:EnableWorkerIndexing
, but sometimes the deployment is still failed.