In the last couple of weeks I’ve had to copy a bunch of Azure WebApps and Functions from one Azure Tenant to another. I hadn’t had to do this for a while and went looking for the quickest and easiest way to accomplish it. As with anything cloud based, things move fast. Some of the methods I found were too onerous and more complex than they needed to be. There is of course the Backup option as well. However for WebApps that is only available if you are on a Standard or above tier Plan. Mine weren’t and I didn’t have the desire to uplift to get that feature.
In this post I show my method to quickly copy an Azure WebApp from one Azure Tenant to another. I cover copying Azure Functions in another post. My approach is;
Open your WebApp in the Azure Portal. Select Automation Script
Download the Automation Script
Select Advanced Tools
Select the Site Folder then on the right menu of wwwroot select the download icon and save the backup of the WebApp.
Expand the Deployment Script archive file from the first step above. The contents will look like those below.
In the Azure Portal select Create a Resource from the top of the menu list on the left hand side. Type Template in the search box and select Template Deployment then select Create. Select Build your own template in the editor. Select Load File and select the parameters.json file. Then select Load File again and select the template.json file. Select Save.
Make any changes to naming, and provide an existing or new Resource Group for the WebApp. Select Purchase.
The WebApp will be created. Once completed select it from the Resource Group you specified and select Advanced Tools. From the Tools menu select Azure Zip Push Deploy.
Drag and drop the Azure Zip Push Deploy zip file with the archive of the wwwroot folder you created earlier.
The Azure Zip Push Deploy zip file will be processed and the WebApp deployed.
Selecting the App in the new Tenant we can see it is deployed and running.
Hitting the App URL we can see that is being served.
This WebApp is the Microsoft Identity Manager User Object Report that I detailed in this post here.
In less that 10 minutes the WebApp is copied. No modifying JSON files, no long command lines, no FTP clients. Pretty simple. In the next post I’ll detail how I copied Azure Functions using a similar process.
Keep in mind if your WebApp is using Application Settings, KeyVaults, Managed Service Identity type options you’ll need to add those settings, certificates/credentials in the target environment.
A few weeks back the Microsoft AI Tour was in Sydney Australia. There was a…
If you're anything like me you always have PowerShell open, and often both PowerShell and…
Decentralised Identity is a technology I'm passionate about and have written many posts and tools…
Over two years ago I authored a PowerShell Module that enabled the automation of 1Password.…
Buried in my PowerShell Snippets Vol 4 post from 2021 is the PowerShell script and…
Short post on how to recovery from "The Windows Subsystem for Linux instance has terminated"…
This website uses cookies.
View Comments