code: func findSecurityRule(rules []network.SecurityRule, rule network.SecurityRule) bool {
  	for _, existingRule := range rules {
  		if !strings.EqualFold(to.String(existingRule.Name), to.String(rule.Name)) {
  			continue
  		}
  		if existingRule.Protocol != rule.Protocol {
  			continue
  		}
  		if !strings.EqualFold(to.String(existingRule.SourcePortRange), to.String(rule.SourcePortRange)) {
  			continue
  		}
  		if !strings.EqualFold(to.String(existingRule.DestinationPortRange), to.String(rule.DestinationPortRange)) {
  			continue
  		}
  		if !strings.EqualFold(to.String(existingRule.SourceAddressPrefix), to.String(rule.SourceAddressPrefix)) {
  			continue
  		}
  		if !allowsConsolidation(existingRule) && !allowsConsolidation(rule) {
  			if !strings.EqualFold(to.String(existingRule.DestinationAddressPrefix), to.String(rule.DestinationAddressPrefix)) {
  				continue
  			}
  		}
  		if existingRule.Access != rule.Access {
  			continue
  		}
  		if existingRule.Direction != rule.Direction {
  			continue
  		}
  		return true
  	}
  	return false
  }
docs: // This compares rule's Name, Protocol, SourcePortRange, DestinationPortRange, SourceAddressPrefix, Access, and Direction.
  // Note that it compares rule's DestinationAddressPrefix only when it's not consolidated rule as such rule does not have DestinationAddressPrefix defined.
  // We intentionally do not compare DestinationAddressPrefixes in consolidated case because reconcileSecurityRule has to consider the two rules equal,
  // despite different DestinationAddressPrefixes, in order to give it a chance to consolidate the two rules.