見出し画像

超簡単PythonでGoogle Cloud Functions入門

超簡単にPythonでGoogle Cloud Functionsに入門

1. プロジェクト作成

Google Cloud Consoleからプロジェクト作成

FireShot Capture 151 - 新しいプロジェクト – Google Cloud Platform - console.cloud.google.com

FireShot Capture 152 - ホーム – My Project 23067 – Google Cloud Platform - console.cloud.google.com

2. メニューの「APIとサービス」からCloud Functions APIとCloud Build API有効化

FireShot Capture 154 - 概要 – API とサービス – My Project 23067 – Google Cloud Platform_ - console.cloud.google.com

FireShot Capture 153 - 概要 – API とサービス – My Project 23067 – Google Cloud Platform_ - console.cloud.google.com

2. 関数を作成

メニューの「Cloud Functions」から関数を作成

画像5

FireShot Capture 159 - 関数の作成 – Cloud Functions – My Project 23067 – Google Cloud Platform_ - console.cloud.google.com

トリガーは「HTTP」、認証は「未認証…」を選択し保存

FireShot Capture 160 - 関数の作成 – Cloud Functions – My Project 23067 – Google Cloud Platform_ - console.cloud.google.com

3. デプロイ

ランタイムに「Python 3.9」を選択しデプロイ

FireShot Capture 161 - 関数の作成 – Cloud Functions – My Project 23067 – Google Cloud Platform_ - console.cloud.google.com

画像9

4. 関数をテスト

操作メニューの「関数をテスト」を選択

画像10

画像11

「関数をテストする」を選択

画像12

5. ログを表示

操作メニューの「ログを表示」を選択

画像13

FireShot Capture 169 - ログ エクスプローラ – ロギング – My Project 23067 – Google Cloud Platform_ - console.cloud.google.com

以上、超簡単!

6. 参考

7. 関連記事





この記事が気に入ったらサポートをしてみませんか?