Skip to content

Commit bfac8ef

Browse files
committed
server: respect WEBSITES_PORT; add frontend diagnostics endpoint and startup logging
1 parent 8659e0c commit bfac8ef

File tree

4 files changed

+1832
-4
lines changed

4 files changed

+1832
-4
lines changed

.github/workflows/docker-deploy.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,27 @@ jobs:
7979
if: ${{ steps.check-secrets.outputs.deploy_ready == 'true' }}
8080
run: |
8181
az webapp config container set --name ${{ secrets.EDITOR_API_APP_NAME }} --resource-group ${{ secrets.RESOURCE_GROUP }} --docker-custom-image-name ${{ needs.build-and-push.outputs.registry }}/app-scripting-editor-api:latest
82+
83+
- name: Set WEBSITES_PORT for editor-api
84+
if: ${{ steps.check-secrets.outputs.deploy_ready == 'true' }}
85+
run: |
86+
echo "Setting WEBSITES_PORT=4000 for ${EDITOR_API_APP_NAME}"
87+
az webapp config appsettings set --name ${{ secrets.EDITOR_API_APP_NAME }} --resource-group ${{ secrets.RESOURCE_GROUP }} --settings WEBSITES_PORT=4000
88+
89+
- name: Smoke test editor-api
90+
if: ${{ steps.check-secrets.outputs.deploy_ready == 'true' }}
91+
run: |
92+
host=$(az webapp show --name ${{ secrets.EDITOR_API_APP_NAME }} --resource-group ${{ secrets.RESOURCE_GROUP }} --query defaultHostName -o tsv)
93+
echo "Testing https://$host/api/health"
94+
for i in 1 2 3 4 5 6 7 8 9 10; do
95+
status=$(curl -s -o /dev/null -w "%{http_code}" "https://$host/api/health" || echo "000")
96+
if [ "$status" = "200" ]; then
97+
echo "OK: health returned 200"
98+
exit 0
99+
fi
100+
echo "Attempt $i: status=$status; retrying in 5s..."
101+
sleep 5
102+
done
103+
echo "ERROR: editor-api did not become healthy"
104+
az webapp log tail --name ${{ secrets.EDITOR_API_APP_NAME }} --resource-group ${{ secrets.RESOURCE_GROUP }} &
105+
exit 1

0 commit comments

Comments
 (0)