Skip to content

アプリケーション内で をクリックすると、お使いのDataRobotバージョンに関する全プラットフォームドキュメントにアクセスできます。

AzureMLでのスコアリングコードの自動デプロイと置換

本機能の提供について

AzureMLでのスコアリングコードの自動デプロイと置換はプレミアム機能です。 この機能を有効にする方法については、DataRobotの担当者または管理者にお問い合わせください。

機能フラグ:AzureMLでのスコアリングコードの自動デプロイと置換を有効にする(プレミアム機能

DataRobotが管理するAzureML予測環境を作成して、AzureMLでDataRobotスコアリングコードをデプロイします。 DataRobot管理を有効にすると、外部AzureMLデプロイは、自動スコアリングコード置換を含むMLOps管理にアクセスできます。

AzureML予測環境の作成

AzureMLにモデルをデプロイするには、まずカスタムAzureML予測環境を作成します。

  1. Open the Console > Prediction environments page and click + Add prediction environment.

  2. 予測環境を追加ダイアログボックスで、予測環境設定を行います。

    • 予測環境の説明的な名前とオプションの説明を入力します。

    • プラットフォームドロップダウンリストからAzureを選択します。

    • DataRobotが管理設定を有効にすると、この予測環境が管理エージェントを介してDataRobotスコアリングコードモデルを自動的にパッケージ化してデプロイできます。

    The Supported model formats settings are automatically set to DataRobot and DataRobot Scoring Code only and can't be changed, as this is the only model format supported by AzureML.

  3. In the Management settings section, select the related Azure service principal Credentials. 指定された資格情報を使用してアクセスできるAzureサブスクリプションAzureリソースグループ、およびAzureMLワークスペースフィールドを設定します。

    「Azureサービスプリンシパルの資格情報が必要です」

    AzureMLでDataRobotがスコアリングコードを管理するには、既存のAzureサービスプリンシパルの資格情報が必要です。 既存の資格情報を持っていない場合、Azureサービスプリンシパルの資格情報が必要ですというアラートが表示され、資格情報に移動してAzureサービスプリンシパルの資格情報を作成するよう促されます。

    必要な資格情報を作成するには、資格情報のタイプで、Azureサービスプリンシパルを選択します。 次に、クライアントIDクライアントシークレットAzureテナントID表示名を入力します。 資格情報を検証して保存するには、保存してサインインをクリックします。

    You can find these IDs and the display name on Azure's App registrations > Overview tab (1) and generate secrets on the App registration > Certificates and secrets tab(2):

    In addition, if you are using tags for governance and resource management in AzureML, click AzureML tags and then + Add new tag to add the required tags to the prediction environment.

  4. (Optional) If you want to connect to and retrieve data from Azure Event Hubs for monitoring, in the Monitoring settings section, click Enable monitoring and configure the Event Hubs Namespace, Event Hubs Instance, and Managed Identities fields. これには有効な資格情報AzureサブスクリプションID、およびAzureリソースグループが必要です。

    You can also click Environment variables and then + New environment variables to add environment variables to the prediction environment.

  5. 環境設定を行った後、環境を追加をクリックします。

    AzureML環境は、予測環境ページから利用できるようになりました。

モデルをAzureML予測環境にデプロイ

AzureML予測環境を作成したら、その環境にモデルをデプロイできます。

  1. On the Registry > Model directory page, in the table of registered models, click the registered model containing the version you want to deploy, opening the list of versions.

    モデルサポート

    AzureML prediction environments do not support models without Scoring Code support.

  2. From the list of versions, click the Scoring Code enabled version you want to deploy, opening the registered model version panel.

  3. In the upper-right corner of any tab in the registered model version panel, click Deploy.

  4. In the Prediction history and service health settings, under Choose prediction environment, click Change.

  5. In the Select prediction environment panel, click AzureML, and then click the prediction environment you want to deploy to.

  6. With an AzureML environment selected, in the Prediction history and service health section, under Endpoint, click + Add endpoint.

  7. エンドポイントを選択ダイアログボックスで、想定されるワークロードに応じて、オンラインまたはバッチエンドポイントを定義し、次へをクリックします。

  8. (Optional) On the next page, define additional Environment key-value pairs to provide extra parameters to the Azure deployment interface. 次に確認をクリックします。

  9. Configure the remaining deployment settings and click Deploy model.

While the deployment is Launching, you can monitor the status events on the deployment's Monitoring > Service health tab under Recent activity > Agent activity

AzureMLで予測を行う

AzureML予測環境にモデルをデプロイしたら、予測 > ポータブル予測タブのコードスニペットを使用して、AzureMLでデータをスコアリングできます。 コードスニペットを実行する前に、以下のいずれかの方法で必要な資格情報を提供する必要があります。

  • スニペットを実行する前に、Azure Service Principalのシークレットを環境変数としてローカルにエクスポートします。

    環境変数 説明
    AZURE_CLIENT_ID アプリの登録 > 概要タブのアプリケーションID
    AZURE_TENANT_ID アプリの登録 > 概要タブのディレクトリID
    AZURE_CLIENT_SECRET アプリの登録 > 証明書およびシークレットタブで生成されたシークレットトークン。
  • Azure CLIをインストールし、az loginコマンドを実行して、ポータブル予測スニペットが個人のAzure資格情報を使用できるようにします。

重要

AzureMLのバッチおよびオンラインエンドポイントへのデプロイには、標準のDataRobotデプロイとは異なるAPIを使用します。

  • オンラインエンドポイントはJSONまたはCSV入力をサポートし、結果をJSONに出力します。

  • バッチエンドポイントはCSV入力をサポートし、結果をCSVファイルに出力します。


更新しました September 7, 2024