Tutorials
This guide covers deploying your Agility CMS .NET application to Azure App Service, including one-click deployment, manual deployment, and CI/CD setup.
This guide covers deploying your Agility CMS .NET application to Azure App Service, including one-click deployment, manual deployment, and CI/CD setup.
The fastest way to deploy is using our Azure Resource Manager (ARM) templates.
| Parameter | Required | Default | Description |
|---|---|---|---|
webAppName | Yes | - | Globally unique name (becomes yourname.azurewebsites.net) |
instanceGuid | Yes | - | Agility CMS Instance GUID |
securityKey | Yes | - | Security key for preview mode |
fetchAPIKey | Yes | - | Live content API key |
previewAPIKey | Yes | - | Preview content API key |
locales | No | en-us | Comma-separated locale codes |
channelName | No | website | Agility sitemap channel |
sku | No | B1 | App Service Plan SKU |
| SKU | WebSockets | AlwaysOn | Recommended For |
|---|---|---|---|
| F1 (Free) | No | No | Not supported |
| D1 (Shared) | No | No | Not supported |
| B1 | Yes | Yes | Development/Testing |
| S1 | Yes | Yes | Production |
| P1V2+ | Yes | Yes | High-traffic production |
Important: The Blazor starter requires WebSockets for Interactive Server components. Choose B1 or higher.
The ARM template creates:
Install Extensions
Build for Release
dotnet publish -c Release -o ./publish
Deploy
publish folder# Login to Azure
az login
# Create resource group
az group create --name myResourceGroup --location eastus
# Create App Service Plan
az appservice plan create \
--name myAppServicePlan \
--resource-group myResourceGroup \
--sku B1 \
--is-linux
# Create Web App
az webapp create \
--name myAgilityApp \
--resource-group myResourceGroup \
--plan myAppServicePlan \
--runtime "DOTNET|10.0"
# Configure settings
az webapp config appsettings set \
--name myAgilityApp \
--resource-group myResourceGroup \
--settings \
AppSettings__InstanceGUID=your-guid \
AppSettings__SecurityKey=your-key \
AppSettings__FetchAPIKey=defaultlive.your-key \
AppSettings__PreviewAPIKey=defaultpreview.your-key
# Enable WebSockets (required for Blazor)
az webapp config set \
--name myAgilityApp \
--resource-group myResourceGroup \
--web-sockets-enabled true
# Deploy code
az webapp deployment source config-local-git \
--name myAgilityApp \
--resource-group myResourceGroup
# Push to deploy
git remote add azure <deployment-url>
git push azure main
Create .github/workflows/azure-deploy.yml:
name: Deploy to Azure
on:
push:
branches: [main]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: |
cd Agility.NET.Blazor.Starter
dotnet restore
npm install
- name: Build
run: |
cd Agility.NET.Blazor.Starter
dotnet publish -c Release -o ./publish
- name: Deploy to Azure
uses: azure/webapps-deploy@v3
with:
app-name: ${{ secrets.AZURE_APP_NAME }}
publish-profile: ${{ secrets.AZURE_PUBLISH_PROFILE }}
package: ./Agility.NET.Blazor.Starter/publish
Setup:
AZURE_PUBLISH_PROFILEAZURE_APP_NAMEIn Azure Portal:
| Name | Value |
|---|---|
AppSettings__InstanceGUID | Your instance GUID |
AppSettings__SecurityKey | Your security key |
AppSettings__FetchAPIKey | Your live API key |
AppSettings__PreviewAPIKey | Your preview API key |
AppSettings__Locales | en-us (or your locales) |
AppSettings__ChannelName | website |
AppSettings__CacheInMinutes | 5 |
Set up cache invalidation in Agility CMS:
https://your-app.azurewebsites.net/api/revalidateEnable content preview:
https://your-app.azurewebsites.net{path}?agilitypreviewkey={previewkey}az webapp config appsettings set \
--name myAgilityApp \
--resource-group myResourceGroup \
--settings APPLICATIONINSIGHTS_CONNECTION_STRING=your-connection-string
Log Stream (real-time):
az webapp log tail --name myAgilityApp --resource-group myResourceGroup
In Azure Portal:
Verify WebSockets are enabled:
az webapp config show --name myAgilityApp --resource-group myResourceGroup \
--query webSocketsEnabled
Enable if needed:
az webapp config set --name myAgilityApp --resource-group myResourceGroup \
--web-sockets-enabled true
ChannelName matches your sitemapEnable AlwaysOn to prevent cold starts:
az webapp config set --name myAgilityApp --resource-group myResourceGroup \
--always-on true
Change to a larger SKU:
az appservice plan update --name myAppServicePlan \
--resource-group myResourceGroup \
--sku S1
Add more instances:
az appservice plan update --name myAppServicePlan \
--resource-group myResourceGroup \
--number-of-workers 3
Configure auto-scale rules in Azure Portal:
The F1 (Free) tier does not support: