Repository navigation
Resolve Azure Service Bus Geo-Recovery aliases through ARM - #6197
Open
johnsimons wants to merge 1 commit into
Open
johnsimons wants to merge 1 commit into
johnsimons wants to merge 1 commit into
Conversation
… lookup Replaces the DnsClient-based CNAME lookup used to match namespace aliases with a direct ARM query that checks each namespace's disaster recovery aliases. This finds the primary namespace when the configured name is a Geo-Recovery alias, including after a failover, and surfaces a clear error when the required disasterRecoveryConfigs/read permission is missing. Drops the now-unused DnsClient dependency.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Usage collection now resolves an Azure Service Bus Geo-Recovery alias through Azure Resource Manager (ARM) instead of a DNS lookup. Microsoft is moving Service Bus to partitioned DNS, and the DNS lookup fails for any alias that has no
servicebus.windows.netrecord.Microsoft announced the move in Upcoming DNS changes for Azure Event Hubs and Azure Service Bus, with details in Partitioned DNS. New namespaces get a hostname such as
<namespace>.z<N>.servicebus.azure.net. In the final stage, new namespaces get no<namespace>.servicebus.windows.netrecord. Existing namespaces keep their legacy hostname until they are deleted. Microsoft gives no dates for the stages.Why only the alias lookup needs a change
ServiceControl hardcodes the legacy Service Bus domain for each Azure cloud in
AzureQuery, and sample connection strings useservicebus.windows.net. Apart from the alias lookup, the code works with partitioned hostnames:The alias lookup queried
<alias>.servicebus.windows.net, or the sovereign domain picked fromASB/ManagementUrl, for a CNAME. It accepted the target only if it ended in that same legacy domain. An alias with only a partitioned record resolves to nothing, soGetQueueNamesthrowsCould not find a Azure Service Bus namespace named "<alias>"and usage collection fails.The change
FindNamespacefirst matches the configured name against the namespaces in the subscription. If none matches, it reads each namespace's disaster recovery configurations. It picks the namespace that holds the alias with the rolePrimary, orPrimaryNotReplicatingafter a failover, and never the secondary. The lookup no longer depends on DNS or on the cloud, so the domain table and theDnsClientpackage are removed.Constraints
Microsoft.ServiceBus/namespaces/disasterRecoveryConfigs/read. The Monitoring Reader role that the docs recommend includes it. The minimal custom role on the usage reporting setup page does not, and an alias user with that role gets an error that names the missing permission. The docs change is in Add disasterRecoveryConfigs permission for Geo-Recovery alias support docs.particular.net#8715.Could not find an Azure Service Bus namespace or Geo-Recovery alias named "<name>".Alternatives considered
Verification
FindNamespaceTestsfakes the SDK resources. It covers a name match, an alias before and after a failover, an alias seen only on the secondary, and forbidden reads. Against master's lookup, the three alias resolution tests failed with the error above. They pass with this change.RunScenarioandTestConnectionWithValidSettingscover the name match against a real namespace.