ASP. Net web app Migration to Azure App Service using PowerShell Scripts
Published Oct 05 2021 08:13 PM 4,472 Views
Microsoft

Azure Migrate is your central place in the Azure portal that provides a unified experience to discover, assess, and migrate your servers, databases, and web apps to Azure. Azure Migrate has a feature in preview that allows at scale discovery, assessment and migration of ASP.NET web apps to Azure App Service.

 

To read more about this feature please visit:

 

 

App Service continues to invest in migration tooling to allow customers to easily migrate their web apps to App Service. In this regard Azure App Service team is excited to announce GA of PowerShell scripts-based discovery, assessment and migration of single or multiple ASP. Net web apps hosted on an IIS web server.

 

PowerShell scripts for migration ASP .NET web apps to Azure App Service provides following key capabilities: 

 

  • Support for ASP.NET web apps hosted on IIS 7.5+ web servers with no product installation needed, just copy the scripts. 
  • These PowerShell scripts can be used to migrate ASP. Net web apps to App service from a variety of virtualized or physical infrastructure platforms ex:  VMWare & Hyper-V environments, web role (Azure Cloud Services Extended Support), Azure VM's (Windows OS), Physical servers
  • Perform bulk migration of ASP.NET web apps from a single IIS web server to Azure App service.
  • Option to package sites and move them to an alternate server for a subsequent deployment step. This mechanism enables support for part offline & online migration scenarios. 
  • Easy customization of these scripts to suit your migration requirements.

For more information about the PowerShell Scripts please refer to: 

 

Prerequisites for Using PowerShell Scripts:

  • Make sure the server on which IIS web server is deployed meets the following requirements: Administrator permissions, IIS Server v7.5 or higher with IIS Management Console component enabled.
  • The IIS server needs PowerShell 2.0 or above for web app discovery if doing remote discovery from another machine. Please ensure PowerShell remoting is enabled on the target IIS web server.
  • To package web app content and config for migration to App Service the source IIS web server must have at least PowerShell 4.0.
  • For generating settings and migration we require PowerShell 5.1 and above. PowerShell V5.1 and above is required for Azure PowerShell. You may execute migration from a machine which is different from the machine hosting IIS web server. 

 

To use PowerShell Scripts for migration of ASP.NET web to App Services follow the below steps: 

 

  • Download the PowerShell scripts and place in a location accessible to the IIS server:  Download 
  • Open an Administrator PowerShell prompt and enable script execution as needed (using Set-ExecutionPolicy) and/or adding the Microsoft Corporation certificate used to sign the scripts to the servers Trusted Publishers store (by default PowerShell will not consider any signing cert as trusted until added to Trusted Publishers even if signing certificate parent is already part of Trusted Root Certificate Authorities store. For more information on PowerShell execution policy and signing see: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_p...). 
  • Generate discovery and readiness information using Get-SiteReadiness.ps1 
  • Create migration packages using Get-SitePackage.ps1. This uses readiness information generated from Get-SiteReadiness to determine sites to package. The packages created in this step may then be migrated directly or copied and migrated from an alternate server. 
  • Create a migration settings file for one or more packages created with Get-SitePackage. This may be done manually using TemplateMigrationSettings.json template or by using Generate-MigrationSettings.ps1 to quickly create a functional settings file that may then be modified as desired, such as for specifying target App Service site names (“AzureSiteName” values). 
  • Use Invoke-SiteMigration.ps1 with a migration settings file to migrate the packaged sites to App Service 

For additional help on execution of these PowerShell scripts please refer to PowerShell Scripts · PowerShell Scripts · Azure/App-Service-Migration-Assistant Wiki (github.com)

 

Migrate ASP. Net Apps from Web Role or Azure VM to Azure App Services:

 

If you have ASP. Net web apps deployed on Azure VM's (Windows) or web roles (Azure Cloud Services extended support) you can use these PowerShell Migration scripts as explained above or use the standalone App Services Migration Assistant Tool to migrate your ASP. Net web apps to App service.

 

You start the migration by downloading PowerShell script or the standalone App Services Migration Assistant Tool. Once the installation is complete then for the PowerShell scripts follow the steps explained above or follow the on-screen instructions for App Services Migration Assistant Tool

 

Please note that both these options will only migrate your web app content and supported configurations to App Service. The scripts & tool will not migrate COM\COM+ components, GAC assemblies, SSL certificates etc...

 

Also, in case of migration from a web role neither of these migration options will be able to directly consume the Azure Cloud Services (classic) Definition Schema (.cscfg File) or Azure Cloud Services (classic) Def. WebRole Schema. You are required to RDP into the web role and execute either the PowerShell scripts or App Services migration assistant tool to migrate your ASP. Net web apps to App Services.

 

At-Scale discovery for .NET apps on Azure VMs:
We are excited to share automation scripts to perform at-scale discovery and assessment of ASP.NET Web Application readiness on Azure VMs (Windows). These automation scripts can quickly assess hundreds of VMs remotely in just minutes.


Learn more about accelerating your cloud migration strategy by visiting: aka.ms/Azure-VMs/bulk-assess/ASP.NET/Next. To try this preview feature, visit aka.ms/Azure-VMs/bulk-assess/ASP.NET.

Version history
Last update:
‎Feb 02 2023 01:34 PM
Updated by: