microsoft / vscode-azurefunctions

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

Local Debug Prompts for storage account and creates AzureWebJobsStorage in application settings while AzureWebJobsStorage__accountName setting is used #3987

Closed timothyv000 closed 8 months ago

timothyv000 commented 8 months ago

The issue is similar to #3575, but I still have issues with local debug.

While using an Azure Function with Python and trying to debug it locally I get the prompt for a storage account or use local emulator. I am using a managed identity for authentication in the function and am using DefaultAzureCredential() in the python code. The function runs properly in Azure. Therefore I use the AzureWebJobsStorage__accountName setting, which is also present in my local.settings.json.

The weird thing is however that if I add another folder to my workspace in VSCode for an Azure Function, that does use a AzureWebJobs setting with connection_string and I place this folder on top in the workspace (above my folder for the actual function I want to debug). I do not get the prompt for the storage account and I can debug my actual function without issues. So somehow while checking for the AzureWebJobs setting, it sees it present in the local.settings.json of another random function project in the same workspace (which it probably reads from top to bottom, since I need to place it above my function in the workspace). So I am using this as a workaround for now, to be able to debug my function properly.

Back to the main problem, if I am using the AzureWebJobsStorage__accountName setting, I would not expect a prompt for the storage account and would like to debug my function without adding the workaround.

nturinski commented 8 months ago

Hi @timothyv000

I want to make sure that I understand the problem here.

Basically, the Functions extension should recognize if a AzureWebJobsStorage__accountName when starting a debug session and not prompt for a storage account, right?

timothyv000 commented 8 months ago

Hi @nturinski

You are totally correct.