I am also using js v4 functions and having the same issue. I deploy using Azure DevOps, here is my pipeline script:
pr:
branches:
include:
- main
trigger:
- None
jobs:
- job: build_and_deploy_job
displayName: Build and Deploy Job
condition: or(eq(variables['Build.Reason'], 'Manual'),or(eq(variables['Build.Reason'], 'PullRequest'),eq(variables['Build.Reason'], 'IndividualCI')))
pool:
vmImage: ubuntu-latest
variables:
- group: var-group-cloud
steps:
- script: echo '$(Build.BuildNumber)'
- checkout: self
submodules: true
- task: npmAuthenticate@0
inputs:
workingFile: 'app/.npmrc'
- task: npmAuthenticate@0
inputs:
workingFile: 'api/.npmrc'
- task: AzureStaticWebApp@0
inputs:
azure_static_web_apps_api_token: $(deployment-token-swa)
app_location: 'app/dist'
api_location: 'api/dist'
config_file_location: 'app'
skip_app_build: true
skip_api_build: true
verbose: true
The pipeline runs fine:
Verbose logging enabled
Try to validate location at: '/working_dir/app/dist'.
Build timeout not specified, defaulting to 15 minutes
App Directory Location: 'app/dist' was found.
Try to validate location at: '/working_dir/swa-db-connections'.
Try to validate location at: '/working_dir/app/staticwebapp.config.json'.
config_file_location: config file 'app/staticwebapp.config.json' was found.
Looking for event info
Event info parsed from action options.
Skipping step to build /working_dir/app/dist with Oryx
Didn't find Oryx manifest file under location: /3f1db353-56eb-46df-b463-bba386af76b4-swa-oryx/app-manifest/oryx-manifest.toml
Determined default file to be: index.html
Using 'staticwebapp.config.json' file for configuration information, 'routes.json' will be ignored.
Copying 'staticwebapp.config.json' to build output
Calculating the size of app artifacts: 1826946 B
Try to validate location at: '/working_dir/api/dist'.
Api Directory Location: 'api/dist' was found.
Skipping step to build /working_dir/api/dist with Oryx
Function Runtime Information. OS: linux, Functions Runtime: ~4, node version: 18
Zipping Api Artifacts
Api Zip will be created from directory: /working_dir/api/dist
Api Content Hash: ccdd531b41a643a01561b4a3df8f7594
Done Zipping Api Artifacts
Zipping App Artifacts
App Zip will be created from directory: /working_dir/app/dist
Done Zipping App Artifacts
Uploading build artifacts.
Finished Upload. Polling on deployment.
Status: InProgress. Time: 0.0484021(s)
Status: InProgress. Time: 15.1168382(s)
Status: Succeeded. Time: 30.1606424(s)
Deployment Complete :)
Seems to deploy successfully. I can access the app, so it has indeed been deployed, but API does not seem to be. Application Insights under Static Web App blade states:
App Insights is only applicable to Static Web Apps with at least one function. Add a function to your app to enable App Insights.