> 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-container-app.md).

# Azure Container Apps

<div data-full-width="true"><figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2Fz8OxTvYgVGNFlKs7mBGw%2FAzure%20Container%20Service.jpg?alt=media&#x26;token=4b089185-96f2-4117-ac64-cd5ecbc763b9" 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%2Fz8OxTvYgVGNFlKs7mBGw%2FAzure%20Container%20Service.jpg?alt=media&#x26;token=4b089185-96f2-4117-ac64-cd5ecbc763b9" alt=""><figcaption></figcaption></figure></div>

## 概要 <a href="#overview" id="overview"></a>

本ページでは、KeeperオートメーターをAzure Container Appsに公開する手順を取り扱います。クラウド上でオートメーターをホストする簡易な方法です。

{% hint style="info" %}
**Azure Government**、**GCC High**、**DoD** などの環境では、Azure Container Appsが利用できないリージョンがあるため、[Azure App Services](/sso-connect-cloud/jp/device-approvals/automator/azure-app-services.md) の手順を使用してください。
{% endhint %}

### 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 %}

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

<div data-full-width="true"><figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FYpND36ScIvVD9PD3tAKg%2FScreenshot%202023-12-12%20at%2012.39.19%20PM.png?alt=media&#x26;token=250b5990-7892-496c-8a9f-2df6ccb67ee5" alt="" width="563"><figcaption><p>Mac/Linuxで生成されたキー値の例</p></figcaption></figure></div>

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2F9gVL0GUEkYsV9eMkj1u1%2Fpowershell_ise_CWVvD57ReW.png?alt=media&#x26;token=6bc50198-9f6d-4a00-a166-bfe4ef477f71" alt=""><figcaption><p>PowerShellで生成されたキー値の例</p></figcaption></figure>

### 2. コンテナレジストリの作成

コンテナレジストリがない場合は、新規作成して構成します。例は以下のとおりです。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FEIUwj4Eg2toYmRWCHgW0%2Fimage.png?alt=media&#x26;token=87dc9c13-d9f4-4a6c-b3ac-6b7187999bd1" 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%2FOjXWtI99nUN3bnWJaU3C%2Fimage.png?alt=media&#x26;token=a0791915-5036-4d2d-8c85-e58c90e40386" alt=""><figcaption></figcaption></figure>

### 3. コンテナーアプリの作成

Azureから新しいコンテナーアプリを作成します。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2F01XN5GodaXq3ZpUyru0t%2Fimage.png?alt=media&#x26;token=e84522a8-338d-4109-8c13-d9f4f4e112bf" alt=""><figcaption></figcaption></figure>

* 新しいリソースグループを選択または作成します。
* コンテナアプリ名を「keeperautomator」または任意の名前に設定します。
* デプロイメントソースとして **\[Container Image]** を選択します
* サービスをホストしたい地域を選択します。
* 新しいアプリ環境を作成するか、既存の環境を選択します。
* **\[Next : Container >]** をクリックします

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FQg9rdmcFdjNrGzyU2rmF%2Fimage.png?alt=media&#x26;token=7b00efc9-818a-4943-9605-cd22cdef2bb4" alt=""><figcaption></figcaption></figure>

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

**Container** 手順では、以下のとおり設定します。

* **\[Use quickstart image]** のチェックを外します
* **\[Docker Hub または他のレジストリ]** を選択します
* **\[パブリック]** を選択します
* レジストリログインサーバーに\*\*`docker.io`\*\*を選択します
* イメージを設定し、\*\*`keeper/automator:latest`\*\*としてタグを付けます
* **Container resource allocation** に進みます
* CPUとメモリは **0.5 CPU** コアと **1Gi** で十分ですが、新規デバイスログイン数に応じて変更できます
* 上記の手順1の値を使用して\*\*`AUTOMATOR_CONFIG_KEY`\*\*という環境変数を作成します
* \*\*`8089`**の値を使用して**`AUTOMATOR_PORT`\*\*という環境変数を作成します
* \*\*`none`**の値で**`SSL_MODE`\*\*という環境変数を作成します
* **\[Next : Ingress >]** をクリックします

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FhdhRW2SnpiaMULmSOQEj%2Fimage.png?alt=media&#x26;token=47dec193-7988-4fd5-9a3d-ab0141fdaf23" alt=""><figcaption></figcaption></figure>

### 5. イングレスのセットアップ

イングレスセットアップ画面で以下を選択します。

* イングレスを有効 (**`Enable`**)にします
* イングレスのトラフィックを\*\*`Accepting traffic from anywhere`\*\* にします (後ほど変更します)
* イングレスタイプを\*\*`HTTP`\*\*にします
* ターゲットポートを\*\*`8089`\*\*に設定します

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2F4eBLqu47HoxFpk74sCt8%2Fimage.png?alt=media&#x26;token=88a95966-9155-4d4e-906b-fc73187c5c4e" alt=""><figcaption></figcaption></figure>

### 6. コンテナアプリの作成

**\[Review + Create]** をクリックしてから **\[Create]** をクリックします。

数分後、コンテナアプリが作成され自動的に起動します。

**\[Go to Resource (リソースに移動)]** をクリックするとコンテナ環境に移動します。

<div><figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FrXEaj8eA7sMX9v3XMnmZ%2F4-complete.png?alt=media&#x26;token=d9d736db-a301-4b8e-ac17-0647ec521b40" 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%2FrXEaj8eA7sMX9v3XMnmZ%2F4-complete.png?alt=media&#x26;token=d9d736db-a301-4b8e-ac17-0647ec521b40" alt=""><figcaption><p>リソースに移動</p></figcaption></figure></div>

### 7. イングレス設定のカスタマイズ

Keeperオートメーターへの通信を制限するには、画面左側 **Network** セクションの **\[Ingress]** をクリックします。

* **\[Ingress]** をクリックします。
* **\[Allow traffic from IPs configured below, deny all other traffic]** を選択します。
* **\[Add]** をクリックし、[Keeperの公開IP](/sso-connect-cloud/jp/device-approvals/automator/ingress-requirements.md)とテスト用IPを追加します。詳しくは[ingress-requirements.md](/sso-connect-cloud/jp/device-approvals/automator/ingress-requirements.md)をご参照ください。
* **\[Save]** をクリックします。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FxCYFd0WjIvtBzcrb5psS%2Fimage.png?alt=media&#x26;token=5ebd30ab-1305-44aa-8ca2-5304691f095f" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
ヘルスチェックを実行する場合は、自身のIPアドレスも追加してください。IPアドレスは <https://checkip.amazonaws.com> で確認できます。
{% endhint %}

### 8. スケーリングの設定

* **\[Application]** > **\[Scale]** を開き、最小レプリカ数と最大レプリカ数を **1** に設定します
* **\[Save as a new revision]** をクリックします

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FfzGDpDmr4f0zxgpnltVk%2Fimage.png?alt=media&#x26;token=98d64241-02d3-4630-b6c8-2053a918b757" alt=""><figcaption></figcaption></figure>

### 9. ボリュームの作成

* **\[Application]** > **\[Volume]** を選択し、**\[+ 追加]** をクリックします。
* **\[Ephemeral Storage]** (一時ストレージ) を選択し、任意の名前を付けて **\[Add]** をクリックします。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2Ff5YBKbCG0J7EkO4c1HOJ%2Fimage.png?alt=media&#x26;token=c5d8caf9-91da-4e5a-a074-c59b4f3dbcbe" alt=""><figcaption></figcaption></figure>

* **\[Save as a new revision]** をクリックします。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FKSaseDNSXTAghe0CGrBp%2Fimage.png?alt=media&#x26;token=e11ee8f5-746a-4e92-adcf-3d1514de0d80" alt=""><figcaption></figcaption></figure>

### 10. ヘルスプローブとボリュームマウントのセットアップ

* **\[Application]** の **\[Revisions and replicas]** セクションに移動します。
* **\[Create new revision]** をクリックします。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FlPmj3AOpATwrHGTjGtR7%2Fimage.png?alt=media&#x26;token=4d776a38-f94e-4dbd-9019-32203d949f63" alt=""><figcaption></figcaption></figure>

**\[Application]** > **\[Revisions and replicas]** をクリックし、新しいリビジョンがアクティブ化されるのを確認します。

* 次に、**\[Container]** タブをクリックします。
* 下部にあるコンテナーイメージ名のリンク (この例では「keeperautomator」) をクリックします。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2Fb8DgTe2eXMEsDuT9BENB%2Fimage.png?alt=media&#x26;token=15812330-2435-4eb0-a243-5dcce23c28f3" alt=""><figcaption></figcaption></figure>

**\[Health Probes]** に移動し、**\[Liveness probes]** の箇所で以下のように設定します。

* **\[Enable liveness probes]** をチェック
* Transport: **`HTTP`**
* Path: **`/health`**
* Port: **`8089`**
* Initial delay seconds: **`5`**
* Period seconds: **`30`**

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FP04jUo9kRkpc9BldQnMp%2Fimage.png?alt=media&#x26;token=7a641150-76fa-4cd5-a8ea-cf0fb757885f" alt="" width="563"><figcaption><p>Liveness probes</p></figcaption></figure>

**\[Startup probes]** の箇所で以下のように設定します。

* **\[Enable startup probes]** をチェック
* Transport: **`HTTP`**
* Path: **`/health`**
* Port: **`8089`**
* Initial delay seconds: **`5`**
* Period seconds: **`30`**

**\[Volume Mounts]** のタブで以下のように設定します。

* **\[+ Add]** を選択します。
* 以前の手順で作成したボリュームを選択し、**\[Mount path]** に「/usr/mybin/config」を追加します。

<figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2Fxvbf48quv0fnyZOtvvz6%2Fimage.png?alt=media&#x26;token=f47f87d1-95b6-49d8-b13b-043d3d21c48c" alt=""><figcaption></figcaption></figure>

構成を完了します。

* **\[Save]** をクリックしてから **\[Create]** をクリックして新しい構成をビルドします。\
  数分後、新しいコンテナが起動します。

### 11. アプリケーションURLの取得

リビジョンのアクティブ化が完了するまで待ちます。

コンテナーアプリの概要の右側に、割り当てられたアプリケーションURLが表示されます。このURLをコピーして以下の手順で使用します。

(例: <https://craigautomator1.xyx-1234.azurecontainerapps.io>)

<div><figure><img src="https://1914737032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfd2v-YT48Ljtykb8qm%2Fuploads%2FT62hntkCafJEFqIAiinN%2F5-copy-url.png?alt=media&#x26;token=abb3b627-8e76-409a-ba56-ece98d12125b" 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%2FT62hntkCafJEFqIAiinN%2F5-copy-url.png?alt=media&#x26;token=abb3b627-8e76-409a-ba56-ece98d12125b" alt=""><figcaption><p>アプリケーションURLの取得</p></figcaption></figure></div>

### 12. Keeperコマンダーにログイン

最後の手順にはKeeperコマンダーが必要です。任意のワークステーションから実行でき、サーバーへのインストールは不要です。

ワークステーションまたはサーバーにKeeperコマンダーCLIをインストールします。バイナリインストーラーを含む手順は [Keeperコマンダーのインストール](/keeperpam/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>
```

### 13. オートメーターの作成

`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%2F7GBt50GX3QLEWfnCbb98%2FScreen%20Shot%202021-09-10%20at%203.59.58%20PM.png?alt=media&#x26;token=849a6c08-e390-4bef-8e18-c46ee627348f" alt=""><figcaption><p>オートメーターの作成</p></figcaption></figure>

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

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

URLはまだ空です。これは **手順 11** で取得した Application URL です。

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

{% code overflow="wrap" %}

```
automator edit --url https://<application URL> --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` コマンドの使用例です。

```
$ curl https://craigautomator1.xyz.azurecontainerapps.io/health
OK
```

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

Keeperオートメーターのデプロイが完了したら、エンドユーザー体験をテストできます。SSO IDプロバイダで認証後、承認プロンプトは表示されません。

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

### 高度な機能

Azure Container Appsには、本ページの範囲外の高度な機能が多数あります。以下はその一例です。

#### 複数のコンテナーでのスケーリング

複数のコンテナでKeeperオートメーターサービスを実行したい場合は以下を行います。

* **\[Scale and replicas]** をクリックします。
* **\[Edit and deploy]** をクリックします。
* **\[Scale]** タブをクリックします。
* コンテナーの最小数および最大数を選択します。最小数は少なくとも1にします。
* **\[Create]** をクリックします。
* 1分後に新しいバージョンがデプロイされます。
* コンテナーの数に応じて何度か`automator setup xxx`を実行します (コンテナーにつき1回)。
* コンテナーの数に応じて何度か`automator init xxx`を実行します (コンテナーにつき1回)。

#### ログ作成

Keeperオートメーターのログは、「コンソール」または「ログストリーム」を使用して表示および監視できます。

たとえば、実行中のオートメーターサービスのログファイルを追跡するには以下のようにします。

* **\[Console]** をクリックします
* **/bin/sh** を選択します
* **\[Connect]** をクリックします
* プロンプトで `tail -f logs/keeper-automator.log` を実行します

#### 高度な設定

環境変数でランタイム機能の有効/無効を切り替えられます。変数の一覧は [高度な設定](/sso-connect-cloud/jp/device-approvals/automator/advanced-settings.md) をご参照ください。


---

# 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-container-app.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.
