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.

Azure Web Appsを複製する方法

0
Posted at
  • App Service Planを新しく作成したapp-service-plan-hogetest-v3に変更してWebAppsを複製させたい
  • App Service PlanはAzure Web Appsとは違うRGに属している。
  • 同じRGにapp-hogetest-frontを複製して新たにapp-hogetest-ocr-front-V3(AppServicePlan:app-service-plan-hogetest-v3)を作成する。

既存のアプリの複製

Azure Powershellからやってみる

$srcapp = Get-AzWebApp -ResourceGroupName [リソースグループ名] -Name app-hogetest-front

New-AzWebApp

$destapp = New-AzWebApp -ResourceGroupName [リソースグループ名] -Name app-hogetest-front-V3 -Location "Japan East" -AppServicePlan app-service-plan-hogetest-v3 -SourceWebApp $srcapp

複製元のデプロイスロットをすべて含ませて複製する場合には、-IncludeSourceWebAppSlotsを使う。

$destapp = New-AzWebApp -ResourceGroupName [リソースグループ名] -Name app-hogetest-front-V3 -Location "Japan East" -AppServicePlan /subscriptions/[サブスクリプションID]/resourcegroups/[新しいAppServicePlanがあるRG]/providers/Microsoft.Web/serverfarms/app-service-plan-hogetest-v3 -SourceWebApp $srcapp -IncludeSourceWebAppSlots

WebAppsにある[アプリの複製]

WebAppsにある [アプリの複製] からでも複製できる。

ARMテンプレートを使う

  • 複製元のARMテンプレートをエクスポートして、カスタムデプロイを行えば複製できた。

まとめ

  • どの方法も複製することはできた。
  • 複製先はオリジナルと違う名前にする必要があるので、URLが変わってしまう欠点がある。
    • 複製元と同じURLで作成したい場合は、複製元を先に消してから行う必要があるのでARMテンプレートで行うしか方法はなさそう?
  • URLを変更せず、安全に複製する方法でもっといい方法があればコメントください。
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?