Exercise - Set up host environment

Completed

In this module, we want to containerize and migrate the PartsUnlimited application. PartsUnlimited is an eCommerce storefront for the PartsUnlimited store for automobile parts. We deploy PartsUnlimited in a two-tier configuration: The application front end built on .NET Framework running on a Windows Server, and the application backend running on Microsoft Azure SQL Database

Prepare your Azure account

If you don't have an Azure subscription, create a free account before you begin.

Once your subscription is set up, you need an Azure user account with:

  • Owner permissions on the Azure subscription.
  • Permissions to register Microsoft Entra apps.

If you just created a free Azure account, you're the owner of your subscription. If you're not the subscription owner, work with the owner to assign the permissions as follows:

  1. In the Azure portal, search for "subscriptions", and under Services, select Subscriptions.

    Search box to search for the Azure subscription.

  2. In the Subscriptions page, select the subscription in which you want to create an Azure Migrate project.

  3. In the subscription, select Access control (IAM) > Check access.

  4. In Check access, search for the relevant user account.

  5. In Add a role assignment, select Add.

    Search for a user account to check access and assign a role.

  6. In Add role assignment, select the Owner role, and select the account (azmigrateuser in our example). Then select Save.

    Opens the Add Role assignment page to assign a role to the account.

  7. Your Azure account also needs permissions to register Microsoft Entra apps.

  8. In Azure portal, navigate to Microsoft Entra ID > Users > User Settings.

  9. In User settings, verify that Microsoft Entra users can register applications (set to Yes by default).

    Verify in User Settings that users can register Active Directory apps.

  10. If Users can register applications is set to No, request the tenant/global admin to assign the required permission. Alternately, the tenant/global admin can assign the Application Developer role to an account to allow the registration of a Microsoft Entra App.

Setup PartsUnlimited application

  1. To deploy the workshop environment, begin by navigating to the Azure portal.

  2. In your Azure subscription, create a new resource group LearnAppContainerization.

  3. Select the Deploy to Azure button to deploy the resources for the application. Selecting this button takes you to the Azure portal to deploy a custom template.

    Deploy to Azure

  4. Once the deployment is complete, you see the following resources in your resource group.

    Two-tier ASP.NET application deployed for workshop

  5. Create the SQL database that the migrated application connects to. Follow these steps to create the SQL database.

    1. Open PowerShell on your local machine and download the SQL database file using the following command.

      invoke-webrequest -uri "https://appcontainerizationlearn.blob.core.windows.net/partsappdatabasemslearn/partsunlimiteddb.bacpac" -outfile./partsunlimited.bacpac
      
    2. Create a storage account called appcontainerizationsa.

    3. Add a container partsunlimiteddbcontainer to the storage account. Select the Blob option for the public access level setting.

    4. In the container, select the upload option and select the downloaded file.

    5. Go to the SQL Server resource created in the LearnAppContainerization resource group. The SQL Server has a name similar to appcontainerization-lab0000.

    6. Select the import database option and enter the following values.

      1. Database name: partsunlimiteddb
      2. Server admin login: adminuser
      3. Password: Password@123
  6. To browse the application, select vm-aspserver virtual machine resource, copy the public IP address of the server and paste it in a browser window.

    Parts Unlimited application to be containerized and migrated

Download and install Azure Migrate: App Containerization tool

  1. In your resource group, select the vm-toolclient virtual machine resource and log in to it using bastion. Use adminuser as the username and Password@123 for the password. You use this machine to run the Azure Migrate: App Containerization tool to migrate the Parts Unlimited application hosted on vm-aspserver.

  2. After logging in, download the Azure Migrate: App Containerization installer on the Windows machine.

  3. Launch PowerShell in administrator mode and run the following commands to install the tool.

    cd Downloads
    .\AppContainerizationInstaller.ps1
    
  4. Open Microsoft Edge browser and launch the tool by browsing to https://toolclient:44369. If you encounter a warning, select Advanced and Continue to toolclient.