I've started creating a small application that will use VueJS as a frontend with Azure Functions as the backend. I was looking at using Azure Static Web Apps to host both components for the application and Gitlab to store / deploy the app.
Everything but the creation of the Azure functions works. Following https://docs.microsoft.com/en-us/azure/static-web-apps/gitlab?tabs=vue
The output from the deploy step, listed below is:
App Directory Location: '/builds/*/valhalla/valhalla-client/dist/spa' was found.
Api Directory Location: '/builds/*/valhalla/valhalla-api/dist' was found.
Looking for event info
Could not get event info. Proceeding
Starting to build app with Oryx
Azure Static Web Apps utilizes Oryx to build both static applications and Azure Functions. You can find more details on Oryx here: https://github.com/microsoft/Oryx
---Oryx build logs---
Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
You can report issues at https://github.com/Microsoft/Oryx/issues
Oryx Version: 0.2.20220131.3, Commit: ec344c058843461525ff03b46031553b6e15a47a, ReleaseTagName: 20220131.3
Build Operation ID: |qAffRWArEg8=.deee9498_
Repository Commit : 7cdd5b61f956e6cb8459b13a42af363c4440a97b
Detecting platforms...
Could not detect any platform in the source directory.
Error: Could not detect the language from repo.
---End of Oryx build logs---
Oryx was unable to determine the build steps. Continuing assuming the assets in this folder are already built. If this is an unexpected behavior please contact support.
Finished building app with Oryx
Starting to build function app with Oryx
---Oryx build logs---
Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
You can report issues at https://github.com/Microsoft/Oryx/issues
Oryx Version: 0.2.20220131.3, Commit: ec344c058843461525ff03b46031553b6e15a47a, ReleaseTagName: 20220131.3
Build Operation ID: |NGXLP5bVBRk=.705477f6_
Repository Commit : 7cdd5b61f956e6cb8459b13a42af363c4440a97b
Detecting platforms...
Could not detect any platform in the source directory.
Error: Could not detect the language from repo.
---End of Oryx build logs---
Oryx was unable to determine the build steps. Continuing assuming the assets in this folder are already built. If this is an unexpected behavior please contact support.
[WARNING] The function language could not be detected. The language will be defaulted to node.
Function Runtime Information. OS: linux, Functions Runtime: ~3, node version: 12
Finished building function app with Oryx
Zipping Api Artifacts
Done Zipping Api Artifacts
Zipping App Artifacts
Done Zipping App Artifacts
Uploading build artifacts.
Finished Upload. Polling on deployment.
Status: InProgress. Time: 0.1762737(s)
Status: InProgress. Time: 15.3950401(s)
Status: Succeeded. Time: 30.5043965(s)
Deployment Complete :)
Visit your site at: https://polite-pebble-0dc00000f.1.azurestaticapps.net
Thanks for using Azure Static Web Apps!
Exiting
Cleaning up project directory and file based variables 00:00
Job succeeded
The deploy step appears to have succeeded, and the frontend is deployed, but there are no Azure Functions showing up in this Static Web App. Is something missed here? So far, the Azure Functions I have are the boiler-plate from instantiating a new Azure Function folder.
image: node:latest
variables:
API_TOKEN: $DEPLOYMENT_TOKEN
APP_PATH: '$CI_PROJECT_DIR/valhalla-client/dist/spa'
API_PATH: '$CI_PROJECT_DIR/valhalla-api/dist'
stages:
- install_api
- build_api
- install_client
- build_client
- deploy
install_api:
stage: install_api
script:
- cd valhalla-api
- npm ci
artifacts:
paths:
- valhalla-api/node_modules/
cache:
key: node
paths:
- valhalla-api/node_modules/
only:
- master
install_client:
stage: install_client
script:
- cd valhalla-client
- npm ci
artifacts:
paths:
- valhalla-client/node_modules/
cache:
key: node
paths:
- valhalla-client/node_modules/
only:
- master
build_api:
stage: build_api
dependencies:
- install_api
script:
- cd valhalla-api
- npm install -g azure-functions-core-tools@3 --unsafe-perm true
- npm run build
artifacts:
paths:
- valhalla-api/dist
cache:
key: build_api
paths:
- valhalla-api/dist
only:
- master
needs:
- job: install_api
artifacts: true
optional: true
build_client:
stage: build_client
dependencies:
- install_client
script:
- cd valhalla-client
- npm i -g @quasar/cli
- quasar build
artifacts:
paths:
- valhalla-client/dist/spa
cache:
key: build_client
paths:
- valhalla-client/dist/spa
only:
- master
needs:
- job: install_client
artifacts: true
optional: true
deploy:
stage: deploy
dependencies:
- build_api
- build_client
image: registry.gitlab.com/static-web-apps/azure-static-web-apps-deploy
script:
- echo "App deployed successfully."
only:
- master