microsoft / vscode-azurefunctions

Azure Functions extension for VS Code
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions
MIT License
290 stars 131 forks source link

Could not resolve resource <resourceId> Function Apps #4121

Closed vdmazahreh closed 1 month ago

vdmazahreh commented 2 months ago

This is probably related to 4111, but the new version did not work for us. We are not using any form of Azure Government.

image

1- macOS. 2- Contributor role present. 3- Issue happens across team members. 5- App services and Static web apps are facing the same issue. However, containers apps and service busses for example work fine. 6- Azure Resources extension works as expected when uninstalling Azure Functions extension. Same thing for other resources. 7- FAs are spread across different resource groups.

Things we've tried so far: 1- Downgrading Azure Resources and Azure Functions to previous version. 2- Uninstalling and reinstalling package. 3- Updating both Azure Resources and Azure Functions extensions to the latest versions.

nturinski commented 2 months ago

Hi @vdmazahreh

Sorry you're running into this issue, but could you answer a few questions for me to help debug this?

  1. Is there an error popping up on the bottom right? If so, could you give me the exact error message that is popping up?
  2. Have you create a containerized function app? And if so, is it in the same geolocation as the App Service/Static Web/Function apps that are having this error?
yashdhanore commented 2 months ago

Hey @nturinski maybe i can chime in here since @vdmazahreh was helping me out with this issue.

  1. Is there an error popping up on the bottom right? If so, could you give me the exact error message that is popping up?

    image
  2. Have you create a containerized function app? And if so, is it in the same geolocation as the App Service/Static Web/Function apps that are having this error?

Yes the containerized func app is in west europe which is same as the location of app service

nturinski commented 2 months ago

Thanks for the fast response @yashdhanore

Well, it's good to know that it was the issue that I was expecting 🤔

Unfortunately, this is an Azure service issue. For whatever reason, Azure does not love when a containerized function app is in the same region as another app type (it can be App Service, Static, or Function). The payload we get from the LIST call doesn't contain this required property (defaultHostName) and causes our extension to break.

The current workaround is to have your containerized function app in a different region from all of your other standard apps, though I realize that is not a great solution 🙁

I would hope that the service would fix this, but we will investigate a workaround from the dev tooling side as well. Sorry about this inconvenience.

yashdhanore commented 2 months ago

@nturinski Thanks for clarifying this! i think we can work with having it in different region for now 😁

vdmazahreh commented 2 months ago

Thank you @nturinski for your help!

zihanfangms commented 1 month ago

Hi @nturinski , do you know when this bug will be fixed? Thanks!

yashdhanore commented 1 month ago

hey @nturinski i deleted the containerized function app and the managed environment associated with it and i still get the same error 🙁

nturinski commented 1 month ago

😭 Okay, well that super sucks.

Sorry, I don't have a clear timeline when this will be fixed, but we'll start investigating what we can do on our end to mitigate this nasty behavior. I'll let you all know when we have a fix up for PR and when you can expect it to release.

nturinski commented 1 month ago

Hi, just wanted to let you know that we have merged a fix and it should be released sometime next week!

If you'd like to test it now, you can download the artifact from this run: https://github.com/microsoft/vscode-azurefunctions/actions/runs/9107955805

  1. Scroll to the bottom of the page
  2. image
  3. Unzip the file
  4. In VS Code, press F1 to open the command palette
  5. Search for the command Install from VSIX
  6. Select the vsix you just extracted

If you do end up trying the alpha build, please let me know if it actually resolves the issue!

zihanfangms commented 1 month ago

Found an alternative way to deploy azure function locally: https://learn.microsoft.com/en-us/azure/azure-functions/functions-core-tools-reference?tabs=v2#func-azure-functionapp-publish

zihanfangms commented 1 month ago

[like] Zihan Fang reacted to your message:


From: Nathan @.> Sent: Thursday, May 16, 2024 7:20:57 AM To: microsoft/vscode-azurefunctions @.> Cc: Zihan Fang @.>; Comment @.> Subject: Re: [microsoft/vscode-azurefunctions] Could not resolve resource Function Apps (Issue #4121)

Hi, just wanted to let you know that we have merged a fix and it should be released sometime next week!

If you'd like to test it now, you can download the artifact from this run: https://github.com/microsoft/vscode-azurefunctions/actions/runs/9107955805

  1. Scroll to the bottom of the page
  2. image.png (view on web)https://github.com/microsoft/vscode-azurefunctions/assets/5290572/908b7ca1-a08c-4459-b3df-7f54c94bfb99
  3. Unzip the file
  4. In VS Code, press F1 to open the command palette
  5. Search for the command Install from VSIX
  6. Select the vsix you just extracted

If you do end up trying the alpha build, please let me know if it actually resolves the issue!

— Reply to this email directly, view it on GitHubhttps://github.com/microsoft/vscode-azurefunctions/issues/4121#issuecomment-2114252246, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A7T4LXCSHZN645IEK2BG2JLZCRM5TAVCNFSM6AAAAABHFZYL6OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJUGI2TEMRUGY. You are receiving this because you commented.Message ID: @.***>

yashdhanore commented 1 month ago

Hey @nturinski i still get the same error. I'm using v1.14.4-alpha.0 which you mentioned and i still get the same could not resolve resource error. Apart from that in the outputs section i see that it is trying to fetch resources which have been deleted so it says the The Resource 'Microsoft.Web/sites/' under resource group '' was not found.

vdmazahreh commented 1 month ago

Hello Team, we've tried the alpha build, and we are still facing the same issue. We would appreciate any suggestion on how to proceed.

Thank you for your effort regarding this. @nturinski