Update Visual Studio template deployment script to use Az PowerShell module
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 Visual Studio to 16.4
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.
Update the deployment script in your project
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.