728x90
728x90

Azure App Services 403 오류 임시 해결 방법

들어가며

  • Azure App Services에 배포한 웹 애플리케이션에 익명 POST 요청을 할 때, 원인을 알 수 없는 403 Forbidden 오류가 발생할 때 대처하는 방법을 정리해본다.

 

방법

명령어를 이용하여 Azure App Services 인증(Authentication) 끄기

  • 나의 경우, 아래 명령을 이용하여 인증(Authentication) 기능을 @disable@ 하여 문제를 해결하였다.
$ az webapp auth update \
  --resource-group <RESOURCE_GROUP> \
  --name <APP_SERVICE_NAME> \
  --enabled false

 

상태 확인
$ az webapp auth show \
  --resource-group <RESOURCE_GROUP> \
  --name <APP_SERVICE_NAME>

 

이 방법은 Azure App Services의 인증(Authentication) 기능 자체를 끄는 방법이기 때문에, 규모가 있는 웹 애플리케이션에서는 더 근본적인 해결 방법을 찾을 필요가 있다.

 

(참고) 로그 관련 기능

  • 403 원인 분석을 위해 명령어를 이용하여 로그 관련 설정을 할 수 있다.
# Application Log (Node.js console.log)
$ az webapp log config \
  --resource-group <RESOURCE_GROUP> \
  --name <APP_SERVICE_NAME> \
  --application-logging filesystem \
  --level information

# Web Server 로그
$ az webapp log config \
  --resource-group <RESOURCE_GROUP> \
  --name <APP_SERVICE_NAME> \
  --web-server-logging filesystem
  
# 실시간 로그 스트림 확인
$ az webapp log tail \
  --resource-group <RESOURCE_GROUP> \
  --name <APP_SERVICE_NAME>

 

(참고) IP/접근 제한 확인

$ az webapp config access-restriction show \
  --resource-group <RESOURCE_GROUP> \
  --name <APP_SERVICE_NAME>

 

(참고) Deny ALL 규칙 제거

$ az webapp config access-restriction remove \
  --resource-group <RESOURCE_GROUP> \
  --name <APP_SERVICE_NAME> \
  --rule-name <RULE_NAME>

 

참고 사이트

 

인증 및 권한 부여 - Azure App Service

Azure App Service 및 Azure Functions의 기본 제공 인증 및 권한 부여 지원 및 앱을 보호하는 방법에 대해 알아봅니다.

learn.microsoft.com

 

728x90
728x90