3

I have deployed a function app and there are no functions visible:

No functions found

In Kodu what I can see seems correct (the files are under wwwroot):

function app debugger

In the app files tab. I can see two folder separators that I'm guessing this could be the problem:

App files

I have WEBSITE_RUN_FROM_PACKAGE disabled and I'm deploying with:

az functionapp deployment source config-zip -g <resource-group> -n <app-name> --src ./deploy.zip
Remo H. Jansen
  • 23,172
  • 11
  • 70
  • 93

2 Answers2

4

After trying millions of things, this is what did it for me:

My folder structure is the following:

dist <-- this folder is present if you use TypeScript
│   └── src
│       ├── dal
│       ├── functions
│       │    └── <MY FUNCTIONS ARE HERE>
│       └── shared
├── host.json
└── package.json

One of my changes was in the host.json:

  // ...
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[4.0.0, 5.0.0)" <-- upgraded the version
  }

Another thing I did was to upgrade everything (Azure CLI, function core tools, etc.).

And finally, I saw this in the docs:

During preview, the v4 model requires you to set the app setting AzureWebJobsFeatureFlags to EnableWorkerIndexing. For more information, see Enable v4 programming model.

To create it I needed to run:

az functionapp config appsettings set --name <FUNCTION_APP_NAME> \
--resource-group <RESOURCE_GROUP_NAME> \
--settings AzureWebJobsFeatureFlags=EnableWorkerIndexing

Then I restarted the function app and it finally worked.

Remo H. Jansen
  • 23,172
  • 11
  • 70
  • 93
1

I have deployed the Azure Function with the given command.

Even Iam unable to see the Functions in the Function tab of the deployed Azure Function.

In the app files tab. I can see two folder separators that I'm guessing this could be the problem:

In App files only configuration files will be available.

enter image description here

  • To check and run the deployed function, Navigate to the App Service Editor(Preview).

enter image description here

  • Click on Open Editor, you can see the deployed Functions.
  • Select and Run the Function, Output is shown on Right Pane.

enter image description here

My package.json file:

{
  "name": "nodefunction",
  "version": "1.0.0",
  "description": "",
  "scripts": {
    "start": "func start",
    "test": "echo \"No tests yet...\""
  },
  "dependencies": {
    "@azure/functions": "^4.0.0-alpha.7"
  },
  "devDependencies": {},
  "main": "src/functions/*.js"
}
Harshitha
  • 3,784
  • 2
  • 4
  • 9
  • I can see the functions under `src/functions` do you know if `"main": "dist/src/functions/*.js"` (this value was created by default by the function tools) in the `package.json` could be the problem? My functions don't have the `dist` folder. – Remo H. Jansen Apr 13 '23 at 07:20
  • 1
    Updated my `package.json` file in the update section of the answer. – Harshitha Apr 13 '23 at 07:35
  • My Functions are under `src/functions` folder itself. Even I don't have dist folder. – Harshitha Apr 13 '23 at 07:36
  • I'm starting to think that the only difference is that my project is a TypeScript project. I cannot remove the dist folder because I need a configuration that will work both locally and in the deployment. – Remo H. Jansen Apr 13 '23 at 10:05
  • 1
    No matter typescript/javascript, the functions are available in the `App Service Editor`. – Harshitha Apr 13 '23 at 10:12