Azure

Azure Database for MySQLにLogic Appsで接続する

はじめに

Azure Database for MySQLにLogic Appsで接続できるようになったので試してみたいと思います。

You can now use the Azure Database for MySQL - Flexible Server connector when building workflows using Power Automate and Azure Logic apps. Microsoft Power Automate and Logic Apps are both integration platforms that empower you to build automated processes using low-code, drag-and-drop tools. The Azure Database for MySQL – Flexible Server connector allows you to perform data operations such as list rows, update, add new row, and delete a row. These data operations are necessary to automate your processes where data operations are required on the data stored in the Azure Database for MySQL – Flexible Server database. The connector allows you to build internal applications.

 

Logic Appsの設定

Logic Appsは従量課金です。

すでにAzure Database for MySQL が構築されてDB(demo)にデータが入力されています。主キーはIDです。maiってtypoですw

また事前にAzureへのサービスにアクセスを許可する必要があります。

 

今回は、ブラウザでアクセスしてAzure Database for MySQL を接続して結果を表示します。

最初にトリガーとしてHTTP要求の受信時を追加します。

次にアクションを追加します。ここでAzure Database for MySQLを選択します。

Get rowを追加します。最初に接続情報を設定します。

 

データを取得するテーブルを選択します。

Row IDには主キーを入力します。今回はID1のデータを取得しています。

この結果をブラウザに表示させます。

応答を追加します。本文に表示項目を追加します。

HTT要求の受信時でGETを設定します。

 

以上でLogic Appsの設定は完了です。

確認

アクセスするURLはHTTP要求の受信時に記載されています。

アクセスすると氏名が表示されることを確認します。

以上で確認は完了です。

まとめ

Azure Database for MySQLにLogic Appsで接続する方法を紹介しました。意図もあっさり接続ができました。Logic Appsで簡単な出力は可能になると思います。

-Azure
-,