> For the complete documentation index, see [llms.txt](https://docs.keeper.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.keeper.io/sso-connect-cloud/jp/device-approvals/automator/azure-app-services.md).

# Azure App Services

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FRK3VwZlJwg9GJJYLv943%2Fimage.png?alt=media&#x26;token=59cec1f5-eed6-4b22-948f-68015085ab15" alt=""><figcaption></figcaption></figure>

## 概要

本ページでは、Azure App Services上でKeeperオートメーターをウェブアプリとしてデプロイする手順を取り扱います。GCC HighやDoDなどの環境では、このサービスでオートメーターをホストできます。

### 1. オートメーター構成キーの作成

コマンドラインを開き、オペレーティングシステムに応じて以下のいずれかの方法を使用してURLエンコード形式で256ビットAESキーを生成します。

#### キーの作成

{% tabs %}
{% tab title="Mac/Linux" %}

```
openssl rand -base64 32
```

{% endtab %}

{% tab title="Windows (PowerShell)" %}

```powershell
[Byte[]]$key = New-Object Byte[] 32; [System.Security.Cryptography.RNGCryptoServiceProvider]::Create().GetBytes($key); [System.Convert]::ToBase64String($key)
```

{% endtab %}
{% endtabs %}

このコマンドで生成された値は、**手順 6** で使用します。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2F1MOv9cm1F2ginDKoSQMq%2Fimage.png?alt=media&#x26;token=6d27a641-2137-4016-89c8-0079c585bd00" alt=""><figcaption><p>Mac/Linuxで生成されたキー値の例</p></figcaption></figure>

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FAakxx7QDkqVW3Sx68a1m%2Fimage.png?alt=media&#x26;token=9d2287e0-46f2-4db4-ae85-494259ee2b10" alt=""><figcaption><p>PowerShellで生成されたキー値の例</p></figcaption></figure>

### 2. App Servicesウェブアプリを作成

Azureポータルで検索バーから **\[App Services]** を選び、**\[+ 作成]** > **\[+ Web アプリ]** で新しいウェブアプリを作成します。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FLcPOrk7pbzmv31o07OIE%2Fimage.png?alt=media&#x26;token=6a5f9969-9211-440b-87c8-059750b437ac" alt=""><figcaption></figcaption></figure>

* 新しいリソースグループを作成します。
* **\[インスタンスの詳細]** の **\[名前]** に名前を入力します。
* **\[公開]** を **\[コンテナー]** に設定します。
* **\[オペレーティング システム]** を **\[Linux]** に設定します。
* サービスをホストする地域を選択します。
* Linuxプランを選択するか新規作成します。料金プランは最低 **\[Premium V3 P0V3]** ですが、最終的なプランは利用環境に応じて異なります。
* **\[コンテナー]** セクションへ進みます。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FLkiuHWgDrx3jBpA416hi%2Fimage.png?alt=media&#x26;token=5d38491c-00db-40f9-bf89-a41c4e936423" alt=""><figcaption></figcaption></figure>

### 3. コンテナの詳細をセットアップ

**\[コンテナー]** セクションでは以下のとおり設定します。

* **\[イメージ ソース]:** **\[その他のコンテナー レジストリ]**
* **\[アクセスの種類]:** **\[パブリック]**
* **\[レジストリ サーバー URL]:** **<https://index.docker.io>** (デフォルト入力済み)
* **\[イメージとタグ]:** **`keeper/automator:latest`**
* **\[監視 + セキュリティ]** セクションへ進みます。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FWQKQX42xUijnUD2klJ5W%2Fimage.png?alt=media&#x26;token=282c485d-6b4c-41a9-abcf-0d43961114dc" alt=""><figcaption></figcaption></figure>

### 4. WebAppモニタリングの設定

* **\[Application Insights を有効にする]** を **\[はい]** に設定します。
* **\[Application Insights]** を選択するか、新規作成します。
* **\[確認および作成]** セクションへ進みます。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FieGnQ5Eoewo004Afg32r%2Fimage.png?alt=media&#x26;token=244cd768-cf84-44d6-9906-145130808bb2" alt=""><figcaption></figcaption></figure>

### 5. WebAppの作成

**\[作成]** をクリックします。

数分後、WebAppが作成され、自動的に起動します。

**\[リソースに移動]** をクリックしてリソース画面へ移動します。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FcKzCVb67IYseShIRKbCp%2Fimage.png?alt=media&#x26;token=9d09a6ca-0c14-4073-864a-7279e259d04a" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2F3fLLr5SbsCoOCn12aNPK%2Fimage.png?alt=media&#x26;token=9242e6d6-7948-4563-97d7-afa787c62289" alt=""><figcaption></figcaption></figure>

**\[既定のドメイン]** の値を控えます。オートメーターのセットアップと初期化で使用します。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2F6m48PCGwgZe4r75ppy1x%2Fimage.png?alt=media&#x26;token=02c3fadb-f105-4a4d-a81d-db773bfedadb" alt=""><figcaption></figcaption></figure>

### 6. WebAppの構成

**\[構成]** を開き、**\[新しいアプリケーション設定]** を選択します。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FYqkXstiLR7x9AS35vsro%2Fimage.png?alt=media&#x26;token=dd62dc21-010a-458d-9413-25aaeff55739" alt=""><figcaption></figcaption></figure>

環境変数は、UIによっては左側メニューの **\[環境変数]** から設定する場合があります。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FfIX2UiL2lZECsBs3aubF%2Fimage.png?alt=media&#x26;token=554aa233-632c-4917-a66b-0093b51c24bf" alt=""><figcaption></figcaption></figure>

以下のアプリケーション設定を追加します。

* 以下の環境変数を作成します。
  * **AUTOMATOR\_CONFIG\_KEY:** 手順 1 で生成した値
  * **AUTOMATOR\_PORT:** 8089
  * **SSL\_MODE:** none
  * **WEBSITES\_PORT:** 8089

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FYQnMrGOFhb6CbEbs5B1D%2Fimage.png?alt=media&#x26;token=f8accc20-906d-4124-b236-6c1c406ecf74" alt=""><figcaption></figcaption></figure>

* **\[適用]** をクリックします。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2Foe2oPFyR2jLWR2fu8Bfg%2Fimage.png?alt=media&#x26;token=b8c91e70-3cad-4b41-99a4-54208c5001d5" alt=""><figcaption></figcaption></figure>

### 7. Diagnosticsの設定

**\[診断設定]** を開き、**\[+ 診断設定を追加する]** をクリックします。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2F50mt3rD61BLPZeT8xuyc%2Fimage.png?alt=media&#x26;token=d14f6fe4-1fac-4e4a-a0b1-5151eac196a2" alt=""><figcaption></figcaption></figure>

* 診断設定名を入力します。
* **\[App Service コンソール ログ]** を選択します。
* **\[App Service アプリケーション ログ]** を選択します。
* **\[Log Analytics ワークスペースへの送信]** を選択します。
  * Log Analyticsワークスペースを選択するか、新規作成します。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FWZW2BpzHIDdCLe3g1uri%2Fimage.png?alt=media&#x26;token=265933b2-d8d7-4cfd-bf31-3608fc7d755e" alt=""><figcaption></figcaption></figure>

### 8. ログの設定

メインメニューから **\[ログ]** を選択し、**\[X]** でクエリウィンドウを閉じます。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FmUgzo8dlApYiIXtnyXIk%2Fimage.png?alt=media&#x26;token=e1534ac1-b514-413b-910c-6b94e610fd8f" alt=""><figcaption></figcaption></figure>

**\[シンプル モード]** から **\[KQL モード]** に切り替え、新しいクエリを追加します。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FHG1fb3XCnorrpQKvg3AM%2Fimage.png?alt=media&#x26;token=2a5cdccd-df85-440b-a408-350f757cf572" alt=""><figcaption></figcaption></figure>

以下は、Dockerのデプロイおよび起動ログを確認するKQLクエリです。

```powershell
AppServicePlatformLogs
project TimeGen=substring(TimeGenerated, 0, 19), Message
sort by TimeGen desc
```

以下は、アプリケーションのエラーログを確認するKQLクエリです。

```powershell
AppServiceConsoleLogs
project TimeGen=substring(TimeGenerated, 0, 19), ResultDescription
sort by TimeGen desc
```

### 9. App Serviceログの設定

メインメニュー **\[監視]** から **\[App Service ログ]** を選択し、**\[アプリケーション ログ]** の **\[ファイル システム]** を選んで保持期間を設定します。

**\[保存]** をクリックします。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FErG1HkGHgXB6a28XSyZO%2Fimage.png?alt=media&#x26;token=990ef0a5-2704-4119-ba21-822f558335de" alt=""><figcaption></figcaption></figure>

### 10. Log Streamの確認

メインメニュー **\[概要]** から **\[ログ ストリーム]** を開き、オートメーターが接続されログが記録されていることを確認します。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2F9EmI7racV2hexRdCqlpA%2Fimage.png?alt=media&#x26;token=f2206f12-30f9-4083-a088-bd6b108f95be" alt=""><figcaption></figcaption></figure>

### 11. 正常性チェックの構成

メインメニュー **\[監視]** から **\[正常性チェック]** を選択します。**\[有効]** にし、**\[パス]** を **`/health`** に設定します。**\[保存]** で保存し、確認の **\[保存]** でもう一度保存します。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FkBDSaYx2eKcDo2P1u0Eg%2Fimage.png?alt=media&#x26;token=281166b8-aa59-4bca-90e0-b012fa571e26" alt=""><figcaption></figcaption></figure>

### 12. アクセス制限の構成

**\[ネットワーク]** セクションでアクセスルールやAzure Front Doorを設定できます。メインメニューから **\[ネットワーク]** を開き、**\[アクセス制限なしで有効]** をクリックします。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FEJbsp5OrRpMj2ZsQ8XUj%2Fimage.png?alt=media&#x26;token=c765dc7c-a28e-4c6d-a5f4-16efc674ddc1" alt=""><figcaption></figcaption></figure>

**\[アクセス制限]** で **\[選択した仮想ネットワークと IP アドレスから有効]** を選び、**\[不一致のルール アクション]** を **\[拒否]** にします。**\[+ 追加]** で受信アクセスルールを追加します。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FCltW5b8YYUSKXYYyn3jC%2Fimage.png?alt=media&#x26;token=e555d886-b130-45c5-94f4-d9314091c65b" alt=""><figcaption></figcaption></figure>

**\[ルールの追加]** で受信ファイアウォールルールを追加します。トラフィックは、以下のページに記載の各地域向け **\[ネットワーク ファイアウォールの設定]** として公開されているKeeper IPアドレスに制限してください。

{% content-ref url="/pages/MWsRxgCXmgNrGbXqVgAW" %}
[イングレス要件](/sso-connect-cloud/jp/device-approvals/automator/ingress-requirements.md)
{% endcontent-ref %}

**\[ルールの追加]** をクリックします。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FmLVGDAJcelPZ3OZ9CTVE%2Fimage.png?alt=media&#x26;token=df327077-8251-449e-b844-e28a0ace6371" alt=""><figcaption></figcaption></figure>

**\[保存]** をクリックして構成を保存します。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FcJtcdlKbDlmRLfMMSgeE%2Fimage.png?alt=media&#x26;token=b5a1bfad-baa3-4418-b8e6-547846cf47cc" alt=""><figcaption></figcaption></figure>

### 13. Keeperコマンダーへのログイン

オートメーター構成の最終手順にはKeeperコマンダーが必要です。任意のワークステーションから実行でき、サーバーへのインストールは不要です。KeeperコマンダーCLIのインストール手順は[Keeperコマンダーのインストール](/keeperpam/jp/commander-cli/commander-installation-setup.md)をご参照ください。

インストール後、Keeperコマンダーを起動するか、既存のターミナルから `keeper shell` と入力してセッションを開き、`login`コマンドを使用してログインします。オートメーターを設定するには、Keeper管理者またはSSOノードを管理できる管理者としてログインする必要があります。

```
$ keeper shell

My Vault> login admin@company.com

  _  __  
 | |/ /___ ___ _ __  ___ _ _ 
 | ' </ -_) -_) '_ \/ -_) '_|
 |_|\_\___\___| .__/\___|_|
 v16.x.xxx    |_|

 password manager & digital vault

Logging in to Keeper Commander
Enter password for admin@company.com
Password: ********************
Successfully authenticated with Master Password
Syncing...
Decrypted [58] record(s)

My Vault>
```

### 14. オートメーターを作成

`automator create` から始まる一連のコマンドを使用してオートメーターを作成します。

```
My Vault> automator create --name "My Automator" --node "Azure Cloud"
```

ノード名 (この場合は「Azure Cloud」) は、以下のように管理コンソールUIから取得します。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2Frapf0wqAmjrfNWJ4taHH%2Fimage.png?alt=media&#x26;token=1f4f1258-ab76-4c92-91ca-8b53d9fb98b7" alt=""><figcaption><p>オートメーターの作成</p></figcaption></figure>

コマンドを実行すると、IDプロバイダからのメタデータを含むオートメーター設定が表示されます。

```
                    Automator ID: 1477468749950
                            Name: My Automator
                             URL: 
                         Enabled: No
                     Initialized: No
                          Skills: Device Approval
```

URLはまだ空です。これは[手順5](#id-5-webappwo)で控えた **\[既定のドメイン]** の値です。

以下のとおり `automator edit` コマンドを実行し、URLとスキル (`team`、`team_for_user`、`device`) を設定します。

{% code overflow="wrap" %}

```
automator edit --url https://<Default domain> --skill=team --skill=team_for_user --skill=device "My Automator"
```

{% endcode %}

次に、キーを交換します。オートメーター公開キーで暗号化されたエンタープライズ秘密キーが オートメーターに提供されます。

```
automator setup "My Automator"
```

新しい構成でオートメーターを初期化します。

```
automator init "My Automator"
```

サービスを有効にします。

```
automator enable "My Automator"
```

この時点で構成は完了となります。

外部ヘルスチェックには、以下のURLを使用できます。

https\://\<server>/health

以下は、`curl` コマンドの使用例です。

```
$ [rainer@iradar keeper]$ curl -vk https://keeperapprovalautomator.azurewebsites.net/health
* About to connect() to keeperapprovalautomator.azurewebsites.net port 443 (#0)
*   Trying 40.112.243.106...
* Connected to keeperapprovalautomator.azurewebsites.net (40.112.243.106) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* skipping SSL peer certificate verification
* SSL connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
* Server certificate:
*       subject: CN=*.azurewebsites.net,O=Microsoft Corporation,L=Redmond,ST=WA,C=US
*       start date: Oct 31 23:08:36 2023 GMT
*       expire date: Jun 27 23:59:59 2024 GMT
*       common name: *.azurewebsites.net
*       issuer: CN=Microsoft Azure TLS Issuing CA 01,O=Microsoft Corporation,C=US
> GET /health HTTP/1.1
> User-Agent: curl/7.29.0
> Host: keeperapprovalautomator.azurewebsites.net
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Length: 2
< Content-Type: text/plain
< Date: Sat, 23 Mar 2024 05:08:13 GMT
< Server: Jetty(11.0.20)
< Strict-Transport-Security: max-age=31622400; includeSubDomains
<
* Connection #0 to host keeperapprovalautomator.azurewebsites.net left intact

```

### ユーザー体験のテスト

Keeperオートメーターがデプロイされましたので、ユーザー体験をテストできます。ユーザーが SSO IDプロバイダで認証した後は、承認を求めるプロンプトが表示されなくなります。

最も簡単な方法は、ブラウザのシークレットモードでKeeperウェブボルトを開き、クラウドSSOコネクトでログインすることです。デバイス承認のプロンプトは表示されません。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.keeper.io/sso-connect-cloud/jp/device-approvals/automator/azure-app-services.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
