Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

๐Ÿ :octocat: Azure Functions + Timer trigger + GitHub Actions + Python3.10 + Pipenv + Util class + Flake8 + Unittest + Csv ใใ‚“ใชใ‚ตใƒณใƒ—ใƒซใ‚’ไฝœใ‚ใ†ใ˜ใ‚ƒใชใ„ใ‹!

Notifications You must be signed in to change notification settings

yuu-eguci/function-app-sample-csv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

11 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Azure Function App sample: CSV

Build and deploy Python project to Azure Function App - function-app-sample-csv

๐Ÿ :octocat: Azure Functions + Timer trigger + GitHub Actions + Python3.10 + Pipenv + Util class + Flake8 + Unittest + Csv ใใ‚“ใชใ‚ตใƒณใƒ—ใƒซใ‚’ไฝœใ‚ใ†ใ˜ใ‚ƒใชใ„ใ‹!

TIL

  • Function App ใ‚’ไฝœใ‚ใ†ใฃใคใฃใฆใใฟใŒๆœ€ๅˆใซๆ€ใ†ใฎใฏ "ใฉใ‚“ใชใƒ‡ใ‚ฃใƒฌใ‚ฏใƒˆใƒชๆง‹ๆˆใฎใƒชใƒใ‚ธใƒˆใƒชใซใชใ‚‹ใ‚“ใ ใ‚ใ†?" ใ ใ‚ˆใชใ€‚ใ“ใ†ใ ใ‚ˆโ†“
    • ใ“ใ‚Œใ‚’ใปใƒผใ‚“ใฃใฆ่ฆ‹ใชใŒใ‚‰ Azure Function App ใ‚’่ฆ‹ใ‚‹ใจใ€ใฒใจใคใฎใƒชใ‚ฝใƒผใ‚นใฎไธญใซ่ค‡ๆ•ฐใฎ functions ใŒใ‚ใ‚‹ใฎใŒใ‚ใ‹ใ‚‹ใญใ€‚
<project_root>/
 | - .venv/
 | - .vscode/
 | - my_first_function/
 | | - __init__.py
 | | - function.json
 | | - example.py
 | - my_second_function/
 | | - __init__.py
 | | - function.json
 | - shared_code/
 | | - __init__.py
 | | - my_first_helper_function.py
 | | - my_second_helper_function.py
 | - tests/
 | | - test_my_second_function.py
 | - .funcignore
 | - host.json
 | - local.settings.json
 | - requirements.txt
 | - Dockerfile

ๅ‚่€ƒ: https://learn.microsoft.com/ja-jp/azure/azure-functions/functions-reference-python?tabs=asgi%2Capplication-level&pivots=python-mode-configuration#folder-structure

  • ใ“ใฎใƒ‡ใ‚ฃใƒฌใ‚ฏใƒˆใƒชๆง‹ๆˆใฏ Azure Functions ๆ‹กๅผตๆฉŸ่ƒฝใงไฝœใ‚‹ใ€‚ (VSC)
    • Python ใƒ—ใƒญใ‚ฐใƒฉใƒŸใƒณใ‚ฐใƒขใƒ‡ใƒซ v2 ใฏใ€ใ“ใฎใƒชใƒใ‚ธใƒˆใƒชใ‚’ไฝœใฃใฆใ„ใ‚‹ๆฎต้šŽใงใฏใƒ—ใƒฌใƒ“ใƒฅใƒผใ€‚
  • venv ็’ฐๅขƒใŒใƒ‡ใƒ•ใ‚ฉใ ใ‘ใฉใ€ใใฃใใ‚Šใใฎใพใพ pipenv ใซๆ›ฟใˆใ‚‹ใ“ใจใŒใงใใ‚‹ใ€‚
  • CI/CD ใฏ Azure Function App ๅดใซใƒชใ‚ฝใƒผใ‚นใ‚’ไฝœใ‚‹ใจใใคใ„ใงใซ GitHub Actions ใ‚’่จญๅฎšใงใใ‚‹ใ‹ใ‚‰ใ€ใใ‚Œใงใ‚„ใฃใกใ‚ƒใŠใ†ใ€‚ Secrets ใ‚‚็™ป้Œฒใ—ใฆใใ‚Œใฆๆฅฝใ ใ‚ˆใ€‚
    • ๆณจๆ„: ใ“ใ‚Œใ‚’ๆœ‰ๅŠนใซใ™ใ‚‹ใซใฏใƒชใ‚ฝใƒผใ‚นใฎ public url ใ‚’ๆœ‰ๅŠนใซใ™ใ‚‹ๅฟ…่ฆใŒใ‚ใ‚‹ใ€‚ไธ€ๅบฆ "ใ‚ปใ‚ญใƒฅใƒชใƒ†ใ‚ฃใฎใŸใ‚ใ€œ" ใจใ‹ใ„ใฃใฆ็„กๅŠนใซใ—ใŸใ‚‰ใƒ‡ใƒ—ใƒญใ‚คใ™ใ‚‹ใจใ 403 ใŒๅ‡บใพใใฃใŸใ€‚
  • Function App ใฏ App Service Plan ใฎไธŠใซใ‚ใ‚‹ใฃใฝใใฆใ€ slot ใ‚’ไฝฟใ†ใ“ใจใ‚‚ใงใใ‚‹ใ€‚
  • ใ“ใฎใƒชใƒใ‚ธใƒˆใƒชใงใฏ flake8 ใ‚„ unittest ใ‚‚ๅฐŽๅ…ฅใ—ใŸใ‚ˆใ€‚ yml ใ‚’่ฆ‹ใŸใ‚‰้›ฐๅ›ฒๆฐ—ใŒใ‚ใ‹ใ‚‹ใ‚ˆใ€‚
  • ใƒญใƒผใ‚ซใƒซ็’ฐๅขƒใงๅฎŸ่กŒใ™ใ‚‹ใจใใฏใ“ใ‚“ใชๆ„Ÿใ˜โ†“
    1. F5 ๆŠผใ—ใฆ Azure Tools ๆ‹กๅผตๆฉŸ่ƒฝใ‚’ใ‚คใƒณใ‚นใƒˆใƒผใƒซ
    2. Azurite ๆ‹กๅผตๆฉŸ่ƒฝใ‚’ใ‚คใƒณใ‚นใƒˆใƒผใƒซ
    3. Azurite: Start ใ™ใ‚‹
    4. Terminal ใง func start ใ™ใ‚‹
  • ใƒญใƒผใ‚ซใƒซ็’ฐๅขƒๅฎŸ่กŒใฎๅ‚่€ƒใฏใ“ใ“โ†“

About

๐Ÿ :octocat: Azure Functions + Timer trigger + GitHub Actions + Python3.10 + Pipenv + Util class + Flake8 + Unittest + Csv ใใ‚“ใชใ‚ตใƒณใƒ—ใƒซใ‚’ไฝœใ‚ใ†ใ˜ใ‚ƒใชใ„ใ‹!

Topics

Resources

Stars

Watchers

Forks

Languages