  def __init__(self,
               az_account: 'account.AZAccount',
               resource_id: str,
               name: str,
               region: str,
               zones: Optional[List[str]] = None) -> None:
    """Initialize the AZComputeResource class.

    Args:
      az_account (AZAccount): An Azure account object.
      resource_id (str): The Azure resource ID.
      name (str): The resource's name.
      region (str): The region in which the resource is located.
      zones (List[str]): Optional. Availability zones within the region where
          the resource is located.

    Raises:
      InvalidNameError: If the resource ID is malformed.
    """

    if not common.REGEX_COMPUTE_RESOURCE_ID.match(resource_id):
      raise errors.InvalidNameError(
          'Malformed resource ID: expected {0:s}, got {1:s}'.format(
              common.REGEX_COMPUTE_RESOURCE_ID.pattern, resource_id), __name__)

    self.az_account = az_account
    # Format of resource_id: /subscriptions/{id}/resourceGroups/{
    # resource_group_name}/providers/Microsoft.Compute/{resourceType}/{resource}
    self.resource_group_name = resource_id.split('/')[4]
    self.resource_id = resource_id
    self.name = name
    self.region = region
    self.zones = zones
Initialize the AZComputeResource class.

Args:
az_account (AZAccount): An Azure account object.
resource_id (str): The Azure resource ID.
name (str): The resource's name.
region (str): The region in which the resource is located.
zones (List[str]): Optional. Availability zones within the region where
the resource is located.

Raises:
InvalidNameError: If the resource ID is malformed.
libcloudforensics/providers/azure/internal/compute_base_resource.py