Capture a Linux VM with Azure CLI 2.0

How to capture and generalize an image of a Linux-based Azure virtual machine (VM) using managed disks created with the Azure CLI 2.0