func ValidateProviderSubAndRg()

in pkg/config/config.go [157:171]


func ValidateProviderSubAndRg(parsedZone azure.Resource, subscription, resourceGroup string) error {
	if !strings.EqualFold(parsedZone.Provider, "Microsoft.Network") {
		return fmt.Errorf("invalid resource provider %s from zone %s: resource ID must be a public or private DNS Zone resource ID from provider Microsoft.Network", parsedZone.Provider, parsedZone.String())
	}

	if subscription != "" && !strings.EqualFold(parsedZone.SubscriptionID, subscription) {
		return fmt.Errorf("while parsing resource IDs for %s: detected multiple subscriptions %s and %s", parsedZone.ResourceType, parsedZone.SubscriptionID, subscription)
	}

	if resourceGroup != "" && !strings.EqualFold(parsedZone.ResourceGroup, resourceGroup) {
		return fmt.Errorf("while parsing resource IDs for %s: detected multiple resource groups %s and %s", parsedZone.ResourceType, parsedZone.ResourceGroup, resourceGroup)
	}

	return nil
}