Access packer variables

Is there a way to access azure-arm packer variables Like Managed os disk ID, Resource Id of the VM being built etc…

My use case is, once the base image is built, I need to scan it using some 3rd party security scanner. This requires the os disk to be preserved. ( I can set this using, keep_os_disk = true). Once the scanning is completed, I need to delete this os disk.

How do I access this disk resource ID? (say from an jenkins pipeline)