Azure NetAppFiles Script Sample - Pool Change for PowerShell

This project demonstrates how to use PowerShell sample application to perform a pool change on a Volume for the Microsoft.NetApp resource provider.

In this sample application we perform the following operations:

  • Creations
    • Azure NetApp Files Account
    • Primary Capacity Pool in service level Premium
    • Secondary Capacity Pool in service level Standard
    • Volume in the Primary pool
  • Updates
    • Perform pool change, moving Volume from Primary capacity pool to Secondary capacity pool
  • Deletions
    • Volume
    • Primary Capacity Pool
    • Secondary Capacity Pool
    • Azure NetApp Files Account

Note: The cleanup execution is disabled by default. If you want to run this end to end with the cleanup, please change value of boolean variable 'CleanupResources' in ANFPoolChange.ps1

If you don't already have a Microsoft Azure subscription, you can get a FREE trial account here.


  1. Azure Subscription
  2. Subscription needs to be enabled for Azure NetApp Files. For more information, please refer to this document.
  3. (Valid only while Pool Change feature is in preview state) Request preview access for Azure NetApp Files Pool Change. For more information, please refer to this document.
  4. Resource Group created
  5. Virtual Network with a delegated subnet to Microsoft.Netapp/volumes resource. For more information, please refer to Guidelines for Azure NetApp Files network planning

What is netappfiles-powershell-pool-change-script-sample doing?

This sample is dedicated to demonstrating how to perform a pool change on a Volume in Azure NetApp Files. This project will first create an ANF Account and then two Capacity Pools, one at a Premium service level tier, and another at a Standard service level tier. Then it will create a single Volume in the Premium tier Capacity Pool. Finally, the sample will perform the pool change operation on the Volume by moving it to the Standard tier Capacity Pool.

There is a section in the code dedicated to remove created resources. By default this sample will not remove all created resources; this behavior is controlled by a boolean variable called 'CleanupResources' in the ANFPoolChange.ps1 class. If you want to erase all resources right after the creation operations, set this variable to 'true'.

How the project is structured

The following table describes all files within this solution:

Folder FileName Description
Root ANFPoolChange.ps1 Authenticates and executes all operations

How to run the script sample application

  1. Clone it locally
    git clone
  2. Change folder to netappfiles-powershell-Pool-Change-script-sample\src
  3. Open ANFPoolChange.ps1 and edit all the parameters
  4. Save and close
  5. Run the following command

Sample output e2e execution