Web App

Static Web App

Create Static web App

  • Set Github username as environment variable: GITHUB_USER_NAME=$username

az group create --name $groupname --location $location
az staticwebapp create --name my-first-static-web-app --resource-group my-swa-group --source https://github.com/$GITHUB_USER_NAME/my-first-static-web-app --location "eastus2" --branch main --app-location "src" --login-with-github
# The URL passed to the --source parameter must not include the .git suffix

Verification

  • az staticwebapp list: list static web app

  • az staticwebapp show -n $staticwebappname --query defaultHostname: query url of static web app

  • az staticwebapp show --name my-first-static-web-app --query "repositoryUrl": Query Repo URL

Reference

Last updated