Azure / Azure/static-web-apps

Intermittent 503's

Open
#1,464 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
346
Forks
67
PR merge metrics
No merged PRs in 30d

Description

For a few days now we have started to observe intermittent 503 errors in all 3 of our main Azure Static Web Apps. The errors seem to come in brief bursts around cold starts, but weirdly requests before them and after them will succeed so its not purely the function app not running yet.

We recently updated everything to .NET 8, and switched on ReadyToRun publishing. We are deploying using the SWA CLI to allow us to build on the windows GitHub agent.

Steps to reproduce the behavior:
1. Create a .NET 8 function app with readytorun enabled
2. Create the github actions file to deploy the function app to azure static web apps
3. When the app first starts up, a few requests respond with 503's

My github action:
` - name: 'Build all the things'
shell: bash
run: |
cd Product
cd Product.Api
dotnet publish -c Release -r win-x64 -o ./output &
cd ..
cd ..
cd ./Product.Components
npm install && npm run build &
cd ..
cd ./Product
npm install && npm run build &
cd ..
npm install -g @azure/static-web-apps-cli
sleep 10

- name: Azure Login
uses: Azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
enable-AzPSSession: false
environment: azurecloud
- name: Deploy site with Azure Static Web Apps CLI
run: |
cd AssetOperatorPortal
swa deploy ./dist --api-language "dotnetisolated" --api-version "8.0" --swa-config-location ./ --api-location ./Product.Api/output --app-name swa${{ env.PRODUCT_NAME }}${{ env.ENV_CODE }} --tenant-id ${{env.TENANT_ID}} --subscription-id ${{env.SUBSCRIPTION_ID}} --env Production --deployment-token $(az staticwebapp secrets list --name swa${{ env.PRODUCT_NAME }}${{ env.ENV_CODE }} --query "properties.apiKey" | xargs)`

**Expected behavior**
No 503's should be fired on start
image

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.