0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Business Central のコンテナーサンドボックス環境を構築する

Last updated at Posted at 2021-11-04

Microsoft Dynamics 365 の ERP の1つである Business Central について、開発およびテストのために使用できるコンテナーベースの環境を PC に作成する手順を説明します

前提として、Docker Desktop for Windows で Windows containers のサービスを起動していることが必要 1 です。 この記事の説明では Windows 10 を使用しています

Docker サービスには Linux containers と Windows containers の2種類がありますが、Business Central では Windows containers を使用します。Linux と Windows の切替えはタスクバーのアイコンメニューから行えます。現在、どちらのサービスが起動しているか、ということは PowerShell で docker version --format '{{.Server.Os}}' を実行すると確認することができます

ファイル名

既定の Linux containers を使用していると WSL 2 installation is incomplete と警告が出る場合がありますが、Business Central では Linux containers を使用しないため WSL 2 (Windows Subsystem for Linux) のインストールは必要ありません

ファイル名

Business Central から CreateBCSandbox.ps1 をダウンロードする

Business Central にサインインして、コンテナーサンドボックス環境 のページ 2 を開きます。画面右上の虫眼鏡 :mag_right: のアイコンから検索してください

ファイル名

Host locally を選択して、CreateBCSandbox.ps1 をダウンロードします

ファイル名

CreateBCSandbox.ps1 を実行する

スクリプトを実行する前にテキストエディタで CreateBCSandbox.ps1 を開き、$accept_eula$false から $true へ$containername にはコンテナ名 bcserver を設定します

$accept_eula = $true
$containername = 'bcserver'

この手順を省略すると、エラー You have to accept the eula in order to create a Container. になってしまいます

ファイル名

スクリプトは管理者として実行する必要があります。スクリプトをダウンロードしたフォルダを開き、Windows Explorer のメニューから Windows PowerShell を管理者として開きます

ファイル名

CreateBCSandbox.ps1 を実行します。実行ポリシーによっては「ファイルはデジタル署名されていません」というエラー PSSecurityException が起きるため、必要に応じて -ExecutionPolicy unrestricted オプションを付けて実行してください

powershell.exe -ExecutionPolicy unrestricted .\CreateBCSandbox.ps1

Business Central の Docker イメージ のダウンロードから始まるため、30 分程度の時間がかかります

ファイル名

スクリプトの実行が完了したら Docker Desktop の画面からコンテナの起動を確認してください。コンテナの起動/停止/廃棄といった操作は Docker Desktop から行うことができます

ファイル名

コンテナーサンドボックス環境の動作を確認する

コンテナを正常に起動できていれば、ブラウザからコンテナーサンドボックス環境の動作を確認することができます。Web Client URL は Docker Desktop の LOGS 画面から確認できます。手順通りにコンテナ名を bcserver としている場合、Web Client URL は http://bcserver/BC/?tenant=default となっているはずです

ファイル名

参考

  1. Docker Desktop for Windows のシステム要件は docs.docker.com の説明をご確認ください

  2. オブジェクト ID は Page 1920 Container Sandbox Environment です

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?