[Troubleshooting] Azure Function App with GitHub Actions

[Troubleshooting] Azure Function App with GitHub Actions
Azure Function App
  1. Azure Function App을 Azure에서 기본 제공하는 GitHub Actions Deployment Template으로 CI/CD를 구성하면 애플리케이션 배포 후 Function을 찾지 못하는 문제가 발생합니다.
  2. 이유는 위 참고문서에서 나오듯 WEBSITE_RUN_FROM_PACKAGE 라는 환경변수가 자동으로 추가되기 때문입니다.
  3. 로컬 개발환경에서는 정상적으로 동작하는데 원격으로 배포만 하면 문제가 생겨서 GitHub Actions Yaml 파일에 Azure CLI로 해당 환경변수를 삭제하는 스크립트를 넣어보고 별 방법을 다 써 봤지만 결국 문제를 해결하지 못했습니다. ㅠㅠ
  4. 결국 로컬 개발 환경처럼 Azure Functions Core Tool을 통해 원격 클라우드 자원에 접근하게끔 GitHub Actions 배포 스크립트를 작성하면 됩니다.
    1. Checkout main repo to current directory.
    2. Install azure-functions-core-tools
    3. func azure functionapp publish

name: func-xxx

on:
  push:
    branches:
      - main
  workflow_dispatch:

env:
  AZURE_FUNCTIONAPP_PACKAGE_PATH: "." 
  PYTHON_VERSION: "3.11" 

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Setup Python version
        uses: actions/setup-python@v5
        with:
          python-version: ${{ env.PYTHON_VERSION }}

      - name: Create and start virtual environment
        run: |
          python -m venv venv
          source venv/bin/activate

      - name: Install dependencies
        run: pip install -r requirements.txt

      - name: Publish function app by az-core-tools
        run: |
          curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
          sudo apt-get install azure-functions-core-tools-4
          
          az login --service-principal -u xxx -p xxx --tenant xxx
          
          func azure functionapp publish func-xxx
          
        shell: bash
  1. 정상 동작합니다. ^^

Read more

[React Native] WebView 안드로이드 로그인 유지

증상 * 안드로이드 앱에서 로그인 유지가 의도한 것 보다 짧게 유지 되거나 로그인 정보가 날라가는 오류가 있었습니다 원인 * 로그인 인증을 위한 쿠키가 메모리에서 디스크로 이동하는데 일정 간격이 있어서 실시간으로 동기화 되지 않았기 때문입니다 조치 * 안드로이드에서 쿠키를 디스크(영구 저장소)로 저장하는 메소드를 앱이 백그라운드로 이동할 때 호출하여 해결하였습니다 * React native의 쿠키관리

By Taehwan Go