例えば、新入社員研修などで JupyterLab を用意したいとします。Azure App Service プランの B1 は 8 アプリをのせる事ができます。アプリごとに利用者を割り当てるという使い方を想定して、JupyterLab を動かす検証をしてみました。
App Service プランの B1 を作成
bash
prefix=mnrlab
region=japaneast
az group create \
--name ${prefix}-rg \
--location $region
az appservice plan create \
--name ${prefix}-asp \
--resource-group ${prefix}-rg \
--sku B1 \
--is-linux
user01 用の JupyterLab を作成
bash
username=user01
az webapp create \
--name ${prefix}-$username \
--resource-group ${prefix}-rg \
--plan ${prefix}-asp \
--deployment-container-image-name quay.io/jupyter/scipy-notebook:2024-03-14 \
--https-only
az webapp config access-restriction add \
--name ${prefix}-$username \
--resource-group ${prefix}-rg \
--priority 100 \
--rule-name MyIP \
--action Allow \
--ip-address $(curl -s inet-ip.info)
az webapp config appsettings set \
--name ${prefix}-$username \
--resource-group ${prefix}-rg \
--settings WEBSITES_PORT=8888
az webapp log config \
--name ${prefix}-$username \
--resource-group ${prefix}-rg \
--web-server-logging filesystem
user01 用の JupyterLab にアクセス
ログストリームから token を探す
user01 用の JupyterLab ログイン後画面
簡単な動作確認
user02 用の JupyterLab を作成
bash
username=user02
az webapp create \
--name ${prefix}-$username \
--resource-group ${prefix}-rg \
--plan ${prefix}-asp \
--deployment-container-image-name quay.io/jupyter/scipy-notebook:2024-03-14 \
--https-only
az webapp config access-restriction add \
--name ${prefix}-$username \
--resource-group ${prefix}-rg \
--priority 100 \
--rule-name MyIP \
--action Allow \
--ip-address $(curl -s inet-ip.info)
az webapp config appsettings set \
--name ${prefix}-$username \
--resource-group ${prefix}-rg \
--settings WEBSITES_PORT=8888
az webapp log config \
--name ${prefix}-$username \
--resource-group ${prefix}-rg \
--web-server-logging filesystem
user02 用の JupyterLab にアクセス
参考