  def GetInstance(
      self,
      instance_name: str,
      resource_group_name: Optional[str] = None) -> 'AZComputeVirtualMachine':
    """Get instance from AZ subscription / resource group.

    Args:
      instance_name (str): The instance name.
      resource_group_name (str): Optional. The resource group name to look
          the instance in. If none specified, then the instance will be fetched
          from the AZ subscription.

    Returns:
      AZComputeVirtualMachine: An Azure virtual machine object.

    Raises:
      ResourceNotFoundError: If the instance was not found in the subscription/
          resource group.
    """
    instances = self.ListInstances(resource_group_name=resource_group_name)
    if instance_name not in instances:
      raise errors.ResourceNotFoundError(
          'Instance {0:s} was not found in subscription {1:s}'.format(
              instance_name, self.az_account.subscription_id), __name__)
    return instances[instance_name]
Get instance from AZ subscription / resource group.

Args:
instance_name (str): The instance name.
resource_group_name (str): Optional. The resource group name to look
the instance in. If none specified, then the instance will be fetched
from the AZ subscription.

Returns:
AZComputeVirtualMachine: An Azure virtual machine object.

Raises:
ResourceNotFoundError: If the instance was not found in the subscription/
resource group.
libcloudforensics/providers/azure/internal/compute.py