In this tutorial, you learn to:
Creation of new project using import method
Importing project using Repo by URL
Setting |
Value |
Subscription |
Your Azure subscription name. |
Resource Group |
Select an existing group name or create a new one. |
Name |
Enter myGitLabApp. |
Hosting plan type |
Select Free. |
Region |
Select a region closest to you. |
Source |
Select Other. |
Static Web App resource creation
*Note: This is just an example.
Copying deployment token from Static Web App resource
Adding Deployment Token in project CI/CD variable section
variables:
API_TOKEN: $DEPLOYMENT_TOKEN
APP_PATH: '$CI_PROJECT_DIR/src'
deploy:
stage: deploy
image: registry.gitlab.com/static-web-apps/azure-static-web-apps-deploy
script:
- echo "App deployed successfully."
*Note: $CI_PROJECT_DIR is the full path the repository is cloned to, and where the job runs from.
Note:
If you are not using sample app, the values for APP_PATH, API_PATH and OUTPUT_PATH need to change to match the values in your application.
Property |
Description |
Example |
Required |
APP_PATH |
Location of your application code. |
Enter $CI_PROJECT_DIR/ if your application source code is at the root of the repository, or $CI_PROJECT_DIR /app if your application code is in a directory called app. |
Yes |
API_PATH |
Location of your Azure Functions code. |
Enter $CI_PROJECT_DIR /api if your app code is in a folder called api. |
No |
OUTPUT_PATH |
Location of the build output directory relative to the APP_PATH. |
If your application source code is located at $CI_PROJECT_DIR /app, and the build script outputs files to the $CI_PROJECT_DIR /app/build folder, then set $CI_PROJECT_DIR /app/build as the OUTPUT_PATH value. |
No |
API_TOKEN |
API token for deployment |
Include API_TOKEN: $DEPLOYMENT_TOKEN |
Yes |
URL for newly deployed app
Clean up the resources you deployed by deleting the resource group.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.