
Cloud
Learning Level
Azure Static Web Apps automatically builds and deploys static sites and SPAs with custom domain and SSL.
By the end of this lesson, you'll understand:
# Create Static Web App
az staticwebapp create \
--name myStaticApp \
--resource-group myResourceGroup \
--source https://github.com/myusername/myrepo \
--location eastus \
--branch main \
--app-location "src" \
--output-location "build"staticwebapp.config.json:
{
"routes": [
{
"route": "/*",
"serve": "/index.html",
"statusCode": 200
},
{
"route": "/api/*",
"allowedRoles": ["authenticated"]
}
],
"navigationFallback": {
"rewrite": "/index.html"
},
"auth": {
"identityProviders": {
"azureActiveDirectory": {
"registration": {
"openIdIssuer": "https://login.microsoftonline.com/...",
"clientIdSettingName": "AZURE_CLIENT_ID"
}
}
}
}
}# Deploy function as backend
az functionapp create \
--resource-group myResourceGroup \
--consumption-plan-location eastus \
--runtime node \
--name myStaticAppApi# Add custom domain
az staticwebapp custom-domain set \
--name myStaticApp \
--resource-group myResourceGroup \
--domain-name mycompany.comLearn about cost optimization strategies, or explore advanced deployment patterns.
Resources
Ojasa Mirai
Master AI-powered development skills through structured learning, real projects, and verified credentials. Whether you're upskilling your team or launching your career, we deliver the skills companies actually need.
Learn Deep • Build Real • Verify Skills • Launch Forward