Step 1: Build your React project
Open the terminal in VS Code and run:
npm install
npm run build
Step 2: Get Deployment Token
- Go to Microsoft Azure Portal.
- Open your Azure Static Web App
- Click Deployment Token
- Copy the token
Step 3: Install Azure Static Web Apps CLI
Install the CLI tool:
npm install -g @azure/static-web-apps-cli
This installs SWA CLI.
Step 3: Deploy the build folder
Run this command inside your project folder.
swa deploy ./dist --deployment-token ABC123XYZ
Your URL changed because the deployment was created as a preview environment instead of production.
If you want to deploy on a real URL, then run the command.
swa deploy ./dist --deployment-token TokenHere --env production
swa deploy ./dist --deployment-token TokenHere --env production
Your site will be available at:
https://your-app-name.azurestaticapps.net
No comments:
Post a Comment