Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where can i find the code of an Azure Function?

I'm new to Azure Functions and been thrown into a project without a proper introduction and anybody I could ask is out of office. My simple most likely stupid question is; where can I find the actual code?

In the azure portal, the functions are listed as "read-only" and only contains a function.json. The resource is an App Service and it has a couple of functions. There is no link to any git repository in properties.

like image 395
figursagsmats Avatar asked Jul 18 '18 09:07

figursagsmats


Video Answer


2 Answers

Read-only Functions would be compiled and published (e.g. through Visual Studio or a CI/CD pipeline.) The Azure Functions Portal engineers are working on a new, improved experience for this but for now, if your Function app has a deployment source configured, you can view it from the Portal in two ways from your Function app:

  1. Platform Features > Deployment Options.
  2. Platform Features > Resource Explorer. In the file tree on the lefthand side, find your Function app's name, and under that, sourcecontrols. Click to expand in the righthand window.

If your Function app doesn't have a deployment source configured (e.g. your team has been publishing code manually) then things get harder. Depending on how your company has set up their source control and what you already have access to, the function.json you see might help: the entryPoint property in a build-generated function.json will give you the full assembly name of that function (e.g. VSSample.HelloSequence.Run). That or the assembly name of the uploaded DLL in the scriptfile property might help you locate the project.

Good luck! Keep posting if you have further questions; we're here to help.

like image 114
Katy Shimizu Avatar answered Oct 11 '22 08:10

Katy Shimizu


AFAIK, if we create the azure function in the Visual Studio and publish it to Azure(there may be other ways), it will appear in the situation you described like the screenshot.

enter image description here

Actually, the code is existing in the portal, but the code has been compiled, you could access it in the Platform features -> Advanced tools (Kudu) -> Debug console.

enter image description here

If you want to get the .cs file, I think you should ask it for your coworkers, there will not be in azure.

like image 39
Joy Wang Avatar answered Oct 11 '22 08:10

Joy Wang