아래 공식 문서를 참조하여 생성함
https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference?tabs=blob
애저 펑션에서는 특정한 함수들이 적은 수의, 기술적인 개념 코어/컴포넌트의 코어를 공유한다.
언어나 어떤 바인딩을 사용하는지에 관계없이 말이다.
주어진 언어의 바인딩에 특정한 세부사항에 뛰어들기 전에, 오버뷰들을 읽어두면 적용하기 쉬울 것임.
Azure Functions Overview (추후에 게시글에서 다루겠음)
https://docs.microsoft.com/en-us/azure/azure-functions/functions-overview
Function code
function이란?
Azure Functions의 아주 기초가되는 컨셉이다.
function은 두개의 중요한 것이 있는데,
- 코드
- 다양한 언어로 작성될수있는 코드
- 특정 config
- function.json file
(Compiled language라면 이 config 파일은 코드의 annotations에 따라 자동생성되며,
Scripted language라면 스스로 생성해야한다)
function.json file은 function의 trigger, bindings, 다른 configuration 셋팅들을 정의한다.
모든 function은 반드시 하나(one and only one!!)의 trigger를 가지고 있어야한다.
프로그램이 실행되고 있는 동안에 이 config파일을 사용하는데,
events를 결정하거나 모니터하거나 데이터를 어떻게 집어 넣거나 function의 실행 결과를 return하는 것에 사용한다.
다음은 function.json file의 예이다
'''
{
"disabled":false,
"bindings":[
// ... bindings here
{
"type": "bindingType",
"direction": "in",
"name": "myParamName",
// ... more depending on binding
}
]
}
'''
binding property는 트리거와 바인딩을 구성하는 곳에 작성된다.
각 바인딩은 공유하는 셋팅도 있으며
어떤 셋팅은 특정한 부분적인 바인딩 타입에 특정하게 셋팅으로 사용되기도 한다
모든 바인딩은 아래 셋팅을 필요로 한다
| Property | Values | Type | Comments | |
|:-----------:|:----------------------------------------------:|:--------:|:-----------------------------------------------------------------------------------------------------------------------------------------------:|:---:|
| type | Name of binding. For example, queueTrigger. | string | | |
| direction | in, out | string | Indicates whether the binding is for receiving data into the function or sending data from the function. | |
| name | Function identifier. For example, myQueue. | string | The name that is used for the bound data in the function. For C#, this is an argument name; for JavaScript, it's the key in a key/value list. | |
'Azure Function Study' 카테고리의 다른 글
Azutre Functions triggers and bindings concepts (0) | 2022.08.05 |
---|