Installing App Gateway Migration script "AzureAppGWClone" generates warning message

Ryan Strand 0 Reputation points
2026-06-18T08:17:43.26+00:00

Hi All,

I'm trying to migrate our Application Gateway V1 to V2.

I'm following the instruction based on the guide on how to install the script, but when I run the installation script in PowerShell, it generates the following warning messages below:

WARNING: The version '5.5.0' of module 'Az.Accounts' is currently in use. Retry the operation after closing the applications.

WARNING: The version '8.0.0' of module 'Az.Network' is currently in use. Retry the operation after closing the applications.

WARNING: The version '11.6.0' of module 'Az.Compute' is currently in use. Retry the operation after closing the applications.

WARNING: The version '10.0.0' of module 'Az.Resources' is currently in use. Retry the operation after closing the applications.

It looks like it does not install the script. Can anybody point me in the right direction to fix the issue ? I'm running the script below

               *Install-Script -Name AzureAppGWClone -Force*

Thank you very much

Azure Application Gateway
Azure Application Gateway

An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Vallepu Venkateswarlu 10,430 Reputation points Microsoft External Staff Moderator
    2026-06-18T09:38:54.6333333+00:00

    Hi Ryan Strand,

    Welcome to Microsoft Q&A Platform.

    As stated in the MS Doc if you are running the script from a local PowerShell session, please ensure that you are using the latest Azure PowerShell modules.

    My recommendation is to use Azure Cloud Shell. in the Azure Portal, as it comes preconfigured with the required modules and helps avoid version-related issues.

    Note: Before migrating V1 to V2 , please check the Prerequisites here

    You can follow the steps outlined in the Azure Cloud Shell documentation. Microsoft recommends using the Azure Az PowerShell module to interact with Azure resources.

    Install the script by following the steps in Installing the script later in this article

    If the above steps did not help resolve your issue, please feel free to share the details in a private message so we can proceed with further troubleshooting over a Teams call. I am happy to connect with you on Teams to investigate and resolve the issue.

    Please210246-screenshot-2021-12-10-121802.pngand “up-vote” wherever the information provided helps you, **this can be beneficial to other community members.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

  2. saleha mubeen 5 Reputation points
    2026-06-18T10:12:53.5566667+00:00

    Those warnings usually indicate that the required Azure PowerShell modules (Az.Accounts, Az.Network, Az.Compute, and Az.Resources) are currently loaded in your PowerShell session, so the installation script cannot update or reinstall them.

    A few things to try:

    Close all PowerShell, Windows Terminal, and Azure Cloud Shell sessions, then open a fresh PowerShell window as Administrator and rerun the script.

    Check which versions are installed:

    Get-InstalledModule Az*
    

    If needed, uninstall and reinstall the affected modules:

    Uninstall-Module Az -AllVersions -Force
    Install-Module Az -AllowClobber -Force
    

    Ensure you're using a supported version of PowerShell (PowerShell 7 is generally recommended for newer Az modules).

    Also, can you share the exact installation command/script you're running? The warnings alone don't necessarily mean the AzureAppGWClone script failed to install, so the full output would help identify the root cause.

    Was this answer helpful?

    0 comments No comments

  3. AI answer

    2026-06-18T08:18:09.8133333+00:00

    The warning messages indicate that Az modules (Az.Accounts, Az.Network, Az.Compute, Az.Resources) are currently loaded in the PowerShell session, so Install-Script -Name AzureAppGWClone -Force cannot update or install the dependencies it needs. This prevents the script from being installed correctly.

    To resolve this and install AzureAppGWClone, use one of these approaches:

    1. Use a fresh PowerShell session with no Az modules loaded
      • Close all existing PowerShell windows.
      • Open a new PowerShell session.
      • Before running any Connect-AzAccount or Import-Module Az commands, run:
             Install-Script -Name AzureAppGWClone -Force
        
      • This follows the documented recommendation to use Install-Script when Az modules are not already installed or loaded.
    2. If Az modules must remain installed/loaded – use the manual script download method
      • The documentation explicitly states that if Az modules are installed and cannot be uninstalled, the script should be downloaded and run directly instead of using Install-Script.
      • From the PowerShell Gallery page for AzureAppGWClone, use the Manual Download tab to download the .nupkg file.
      • Install the script from the .nupkg file as described in the “Manual Package Download” guidance.
      • Then, in PowerShell:
        1. Connect and import Az modules as usual:
                  Connect-AzAccount
                  Import-Module Az
          
        2. Set the correct subscription context:
                  Set-AzContext -Subscription '<V1 application gateway SubscriptionId>'
          
        3. Run Get-Help AzureAppGWClone (or the downloaded script) to review parameters and then execute the script with the required arguments.

    These approaches align with the documented options:

    • Use Install-Script only when Az modules are not already installed/loaded.
    • Otherwise, download and run the script directly.

    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.