Hello BarbaraO,
Thank you for your question and for reaching out with your question today.
When migrating from AzureRM to Az, I recommend that you use the ConvertTo-Az cmdlets provided by the Az Migration module. The New-AzUpgradeModulePlan cmdlet is part of the migration process, but it doesn't automatically convert your existing AzureRM scripts to Az. The New-AzUpgradeModulePlan cmdlet is used to plan the migration process and generate a report, but it doesn't perform the actual conversion. The ConvertTo-Az cmdlets are responsible for the migration itself. You need to follow the additional steps listed below to complete the actual migration:
- Ensure that you have the Az Migration module installed. You can install it using the following powershell command:
Install-Module -Name Az.Migration
- Import the module into your PowerShell session:
Import-Module Az.Migration
- Use the ConvertTo-Az cmdlets to convert your AzureRM scripts to Az. You need to provide the input file containing your AzureRM script and specify the output file for the converted script:
ConvertTo-Az -InputFile 'C:\test\templateCreateResources.ps1' -OutputFile 'C:\test\convertedScript.ps1'
This command will analyze your AzureRM script and convert AzureRM cmdlets to their equivalent Az cmdlets. It will create a new script with the converted code.
- After the conversion, review the converted script to ensure that everything has been migrated correctly. Pay special attention to any AzureRM-specific features that may require adjustments in the converted script.
- Execute the converted script using PowerShell. Ensure that it works as expected and performs the necessary Azure operations.
If the reply was helpful, please don’t forget to upvote or accept as answer.