Activating and Deactivating Auth Codes for PAN-OS via API

One the benefits of Palo Alto Networks' VM-Series is that licences can be moved between deployment scenarios; from private cloud to public cloud, between different public cloud providers, and many other scenarios. The process for this requires activation and deactivation of licences. This article describes the steps to activate and deactivate licence auth codes using the PAN-OS API. This is useful for programmatically provisioning VM-Series via scripting or automation toolsets. Details are correct as of PAN-OS 8.1.3, and whilst the examples shown are for a VM-Series running in Microsoft Azure, they should be generally applicable to other deployment scenarios.

Note: replace all {{variables}} with your own values.

In the Customer Support Portal we have an auth code for VM-300 with no VM-Series provisioned:

The VM-Series virtual appliance is currently unlicensed:

The VM-Series therefore also has no serial number:

The following API call installs the auth code on the VM-Series:


The expected response is:

VM Device License installed. Restarting pan services.

Following the activation, the Customer Support Portal should show a VM-Series has been provisioned:

The VM-Series is now licensed:

The VM-Series also now has a serial number:

The VM-Series is now ready for use.

To decommission the VM-Series and release the licence, a licence deactivation API key is required. This can be obtained from the Customer Support Portal, go to Assets->Licensing API:

The following API call installs the licence deactivation API key on the VM-Series:


The expected response is:

API Key is successfully set

The next API call deactivates the VM-Series licenses:


The expected response is:

serial-number Success
serial-number Success
serial-number Success
serial-number Success
serial-number Success
Successfully deactivated old keys.

Note that the number of lines within the response showing successful licence deactivation will depend on the number of feature licences activated on the VM-Series.

The VM-Series is not successfully deactivated. The Customer Support Portal will also update to show a VM-Series has be de-provisioned:

--- home --- twitter --- linkedin ---