Update Visual Studio template deployment script to use Az PowerShell module
Note
The Azure Resource Group project is now in extended support, meaning we will continue to support existing features and capabilities but won't prioritize adding new features.
Note
For the best and most secure experience, we strongly recommend updating your Visual Studio installation to the latest Long-Term Support (LTS) version. Upgrading will improve both the reliability and overall performance of your Visual Studio environment. If you choose not to upgrade, you may encounter the issues documented in Issues when creating and deploying Azure resource groups through Visual Studio.
Visual Studio 16.4 supports using the Az PowerShell module in the template deployment script. However, Visual Studio doesn't automatically install that module. To use the Az module, you need to take four steps:
- Uninstall AzureRM module
- Install Az module
- Update Visual Studio to 16.4
- Update the deployment script in your project.
Update your installation of Visual Studio to version 16.4 or later. During the upgrade, make sure the Azure PowerShell component isn't checked. Since you installed the Az module through the gallery, you don't want to reinstall the AzureRM module.
If you already upgraded to 16.4 and the Azure PowerShell component was checked, you can uninstall it by running the Visual Studio Installer. Don't select the Azure PowerShell component in the Azure Workload or on the individual components page.
Replace all occurrences of the string 'AzureRm' with 'Az' in your deployment script. You can refer to revisions in this gist to see the changes. For more information about upgrading scripts to the Az module, see Migrate Azure PowerShell from AzureRM to Az.
To learn about using the Visual Studio project, see Creating and deploying Azure resource group projects through Visual Studio.