projectkudu / kudu

Kudu is the engine behind git/hg deployments, WebJobs, and various other features in Azure Web Sites. It can also run outside of Azure.
Apache License 2.0
3.12k stars 652 forks source link

Calls for ListSecrets API will fail for .NET Isolated Functions in the call to FunctionsManager #3489

Closed FinVamp1 closed 12 months ago

FinVamp1 commented 1 year ago

Repro steps.

  1. Create a .NET 7 Isolated app for Azure Functions and deploy this to Azure.
  2. Ensure that this app has at least one Function.
  3. Test the List Secrets API via https://learn.microsoft.com/en-us/rest/api/appservice/web-apps/list-function-secrets?view=rest-appservice-2022-03-01&tryIt=true&source=docs#code-try-0

The log/error given by the failure.

{"error":{"code":"NotFound","message":"System.IO.FileNotFoundException: Function (TimerTrigger1) does not exist\r\n
at Kudu.Core.Functions.FunctionManager.GetFuncPathAndCheckExistence(String name) in C:\Kudu Files\Private\src\master\Kudu.Core\Functions\FunctionManager.cs:line 395\r\n
at Kudu.Core.Functions.FunctionManager.d__12.MoveNext() in C:\Kudu Files\Private\src\master\Kudu.Core\Functions\FunctionManager.cs:line 220\r\n

https://github.com/projectkudu/kudu/blob/2c22ace416363bda73d9363db4c3f0176d61b558/Kudu.Core/Functions/FunctionManager.cs#L387 has this code and it checks for a folder structure for the Function App rather than the metadata for Isolated Functions.

This may also come up for the new programming models for Python, Node, and PowerShell.

Mention any other details that might be useful.


Thanks! We'll be in touch soon.

mathewc commented 12 months ago

The old ListSecrets API shouldn't be used anymore. Please use the ListKeys API https://learn.microsoft.com/en-us/rest/api/appservice/web-apps/list-function-keys?view=rest-appservice-2022-03-01.

FinVamp1 commented 12 months ago

Thanks @mathewc as per your suggestion I'll resolve this.