Managed API Function not recognized when building manually
- Dominant language
- No language data
- Stars
- 346
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
Because of the [permission issue](https://github.com/microsoft/azure-pipelines-tasks/issues/16156) when using the API build in the AzureStaticWebApp@0 task, I am skipping the API build and build it in an earlier task.
Here is my task:
```
- task: AzureStaticWebApp@0
inputs:
app_location: "/dist"
output_location: ""
skip_app_build: true
api_location: "/src/api/dist"
skip_api_build: true
verbose: true
azure_static_web_apps_api_token: "$(DeploymentToken)"
```
The build for the app works fine, but my api (Managed Function, node:18) is not recognized in the portal. It's not showing up. The build task for my Function looks like this:
```
- task: Npm@1
displayName: "Build command Api (function): npm --prefix api build --production"
inputs:
command: custom
verbose: false
customCommand: "run --prefix src/api build --production"
```
My dist folder, in the pipeline looks like this:
```
2025-01-13T15:46:12.7797380Z ├── src
2025-01-13T15:46:12.7797647Z │ ├── api
2025-01-13T15:46:12.7797785Z │ │ ├── dist
2025-01-13T15:46:12.7797937Z │ │ │ ├── functions
2025-01-13T15:46:12.7798106Z │ │ │ │ └── HealthCheck.js
2025-01-13T15:46:12.7798260Z │ │ │ ├── host.json
2025-01-13T15:46:12.7798407Z │ │ │ ├── index.js
2025-01-13T15:46:12.7798558Z │ │ │ └── package.json
```
Am I missing any files in the output folder? I think the package.json shouldn't be there but I added it, since it has some information about the 'main' method.
I added the following code to my staticwebappconfig.json, to set the language:
```
"platform": {
"apiRuntime": "node:18"
}
```
That part is picked up correctly by the pipeline. Locally the function works fine.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.