Node-Red에서 Azure Logic Apps 호출
개요
Node-RED, 정말 편리하네요.
PoC로 바삭하게 시스템 만들 때 뭔가, 엄청 편리합니다.
클라우드 측도 가능한 한 코딩리스로하고 싶기 때문에,
Azure Logic Apps를 사용하고 있습니다.
이번에는 에지 측을 Node-RED, 클라우드 측을 Azure Logic Apps로 구축 한 시스템을 예로
그 절차를 소개합니다.
시스템 구성
실제로 과거에 한 PoC를 소재로 하고 싶습니다.
방에 몇 가지 온도 센서를 놓고,
그것을 클라우드의 데이터베이스에 저장합니다.

※데이터의 가시화에 대해서는 Power BI에서 IoT 데이터 시각화(초급편) 를 참조해 주십시오.
절차
데이터 형식 결정
Node-RED에서 Logic Apps로 전송할 데이터 구조를 결정합니다.
이번에는 다음 JSON 형식으로 데이터를 교환하기로 결정합니다.

Logic Apps
에지 측의 Node-Red에서 데이터를 수신하는 Logic Apps를 만들고 설정합니다.
1. Azure 포털에 로그인하고 홈 화면에서 리소스 만들기를 클릭합니다.

2. 검색 창에 Logic App을 입력하여 검색한 다음 결과에서 Logic App을 클릭합니다.

3. 만들기를 클릭합니다.

4. 필요한 정보를 입력하고 만들기를 클릭합니다.

5. 생성이 완료되면 Logic Apps 디자이너를 표시하고 일반 트리거로 시작에서 HTTP 요청 수신 시를 클릭합니다.

6. 아래와 같은 화면이 표시됩니다. 샘플 페이로드를 사용하여 스키마 생성을 클릭합니다.

7. 먼저 결정한 JSON 데이터를 붙여 넣습니다.

8. JSON 스키마가 자동 생성되었습니다.

9. 이 후, 본래는 수신한 데이터를 처리하는 플로우를 작성합니다만, 그것은 또 다른 기회에. 여기서 일단 흐름을 저장합니다.

10. HTTP 요청을 수락하는 URL이 자동 생성되므로 복사 버튼을 클릭하여 복사합니다.

11. 실행을 클릭합니다. 이제 Node-RED에서 데이터를 받을 준비가 되었습니다.

Node-RED
Node-RED는 Rasp파이 용 OS 인 Raspbian에 사전 설치된 것을 사용했습니다.
작성한 플로우는 이런 느낌이 매우 간단합니다.

①5분에 1회 기동
②온도 센서(2JCIE-BL01)에서 블루투스로 데이터를 읽습니다.
③ 송신 데이터 생성
④Logic Apps에 데이터 전송
⑤ 결과를 디버그 출력
이번에는 Logic Apps와 관련된 부분만 설명합니다.
④의 Logic Apps로의 데이터 송신에는 「http request」노드를 이용합니다.

설정은 이런 느낌입니다.
메소드는 POST이며 URL은 앞에 두었던 URL을 설정합니다.

실행 결과
Node-RED 측을 배포하여 실행 결과를 확인합니다.
Azure Logic Apps 블레이드에서 개요를 선택하고 하단 실행 기록을 클릭합니다.

그러면 아래와 같이 전송된 데이터를 확인할 수 있습니다.

정리?
그래서 Node-RED에서 Azure Logic Apps를 호출하는 단계를 설명했지만,
Node-RED 측은 단순히 HTTP Request를 실행할 뿐입니다.
그 결과 대부분의 절차는 Azure Logic Apps의 내용이되었습니다 (웃음).
또한 Logic Apps 호출 시 보안에 대한 자세한 내용은 아래를 참조하십시오.
htps : // / cs. 미 c 로소 ft. 코 m / 자 jp / 아즈레 / ぉ ギ ぉ ps / ぉ ギ 〇
Reference
이 문제에 관하여(Node-Red에서 Azure Logic Apps 호출), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/yossihard/items/a746ac25345df86cf263
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
실제로 과거에 한 PoC를 소재로 하고 싶습니다.
방에 몇 가지 온도 센서를 놓고,
그것을 클라우드의 데이터베이스에 저장합니다.

※데이터의 가시화에 대해서는 Power BI에서 IoT 데이터 시각화(초급편) 를 참조해 주십시오.
절차
데이터 형식 결정
Node-RED에서 Logic Apps로 전송할 데이터 구조를 결정합니다.
이번에는 다음 JSON 형식으로 데이터를 교환하기로 결정합니다.

Logic Apps
에지 측의 Node-Red에서 데이터를 수신하는 Logic Apps를 만들고 설정합니다.
1. Azure 포털에 로그인하고 홈 화면에서 리소스 만들기를 클릭합니다.

2. 검색 창에 Logic App을 입력하여 검색한 다음 결과에서 Logic App을 클릭합니다.

3. 만들기를 클릭합니다.

4. 필요한 정보를 입력하고 만들기를 클릭합니다.

5. 생성이 완료되면 Logic Apps 디자이너를 표시하고 일반 트리거로 시작에서 HTTP 요청 수신 시를 클릭합니다.

6. 아래와 같은 화면이 표시됩니다. 샘플 페이로드를 사용하여 스키마 생성을 클릭합니다.

7. 먼저 결정한 JSON 데이터를 붙여 넣습니다.

8. JSON 스키마가 자동 생성되었습니다.

9. 이 후, 본래는 수신한 데이터를 처리하는 플로우를 작성합니다만, 그것은 또 다른 기회에. 여기서 일단 흐름을 저장합니다.

10. HTTP 요청을 수락하는 URL이 자동 생성되므로 복사 버튼을 클릭하여 복사합니다.

11. 실행을 클릭합니다. 이제 Node-RED에서 데이터를 받을 준비가 되었습니다.

Node-RED
Node-RED는 Rasp파이 용 OS 인 Raspbian에 사전 설치된 것을 사용했습니다.
작성한 플로우는 이런 느낌이 매우 간단합니다.

①5분에 1회 기동
②온도 센서(2JCIE-BL01)에서 블루투스로 데이터를 읽습니다.
③ 송신 데이터 생성
④Logic Apps에 데이터 전송
⑤ 결과를 디버그 출력
이번에는 Logic Apps와 관련된 부분만 설명합니다.
④의 Logic Apps로의 데이터 송신에는 「http request」노드를 이용합니다.

설정은 이런 느낌입니다.
메소드는 POST이며 URL은 앞에 두었던 URL을 설정합니다.

실행 결과
Node-RED 측을 배포하여 실행 결과를 확인합니다.
Azure Logic Apps 블레이드에서 개요를 선택하고 하단 실행 기록을 클릭합니다.

그러면 아래와 같이 전송된 데이터를 확인할 수 있습니다.

정리?
그래서 Node-RED에서 Azure Logic Apps를 호출하는 단계를 설명했지만,
Node-RED 측은 단순히 HTTP Request를 실행할 뿐입니다.
그 결과 대부분의 절차는 Azure Logic Apps의 내용이되었습니다 (웃음).
또한 Logic Apps 호출 시 보안에 대한 자세한 내용은 아래를 참조하십시오.
htps : // / cs. 미 c 로소 ft. 코 m / 자 jp / 아즈레 / ぉ ギ ぉ ps / ぉ ギ 〇
Reference
이 문제에 관하여(Node-Red에서 Azure Logic Apps 호출), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/yossihard/items/a746ac25345df86cf263
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
그래서 Node-RED에서 Azure Logic Apps를 호출하는 단계를 설명했지만,
Node-RED 측은 단순히 HTTP Request를 실행할 뿐입니다.
그 결과 대부분의 절차는 Azure Logic Apps의 내용이되었습니다 (웃음).
또한 Logic Apps 호출 시 보안에 대한 자세한 내용은 아래를 참조하십시오.
htps : // / cs. 미 c 로소 ft. 코 m / 자 jp / 아즈레 / ぉ ギ ぉ ps / ぉ ギ 〇
Reference
이 문제에 관하여(Node-Red에서 Azure Logic Apps 호출), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/yossihard/items/a746ac25345df86cf263텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)