Skip to content

az afd update disassociates custom domains when adding a new one #31638

@lenniehwtw-new

Description

@lenniehwtw-new

Describe the bug

I have a pipeline that adds a custom domain to front door and associates them with the default route.

This was working fine but now is behaving strangely.

When the az afd update command executes it disassociates all of the existing custom domains and the ruleset.

Related command

az afd update

Errors

There is no error reported, the command executes with unexpected behaviours

Issue script & Debug output

NOTE This executes via an AzureCLI@2 task in an ADO pipeline

$domainsIds = az afd route
show --endpoint-name $(endpointName)
--route-name ${{parameters.azure.frontDoorRouteName}} --resource-group ${{parameters.azure.frontDoorProfileResourceGroup}}
--profile-name ${{parameters.azure.frontDoorProfileName}} `
--query "customDomains[].id" --debug | ConvertFrom-Json

      Write-Host "Existing DomainIds : " $domainsIds
      $domainsIds += "$(domainId)"
      Write-Host "New DomainIds : " $domainsIds

      $ruleSetIds = az afd `
      route `
      show `
      --endpoint-name $(endpointName) `
      --route-name ${{parameters.azure.frontDoorRouteName}} `
      --resource-group ${{parameters.azure.frontDoorProfileResourceGroup}} `
      --profile-name ${{parameters.azure.frontDoorProfileName}} `
      --query "ruleSets[].id" --debug | ConvertFrom-Json

      Write-Host "RuleSetId: " $ruleSetIds

      az afd `
      route `
      update `
      --resource-group ${{parameters.azure.frontDoorProfileResourceGroup}} `
      --endpoint-name $(endpointName) `
      --profile-name ${{parameters.azure.frontDoorProfileName}} `
      --route-name ${{parameters.azure.frontDoorRouteName}} `
      --patterns-to-match /* `
      --origin-group DefaultBackend `
      --supported-protocols Https `
      --custom-domains $domainsIds `
      --forwarding-protocol MatchRequest `
      --origin-path "${{parameters.azure.originPath}}" `
      --rule-sets $ruleSetIds `
      --https-redirect Enabled `
      --debug

frontdoor-route-update-logs.txt

The result is that
All the existing custom domains logged at line 118 in attached file are disassociated from the route
The ruleset logged at line 203 is disassociated from the route

Expected behavior

I would expect the existing custom domains to be unaffected and the ruleset to remain associated with the route
I would expect the new custom domain to be associated with the route

Environment Summary

azure-cli 2.67.0 *

core 2.67.0 *
telemetry 1.1.0
Dependencies:
msal 1.31.0
azure-mgmt-resource 23.1.1

Python location 'C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\sveAzRCSBLD.azure\cliextensions'
Python (Windows) 3.12.7 (tags/v3.12.7:0b05ead, Oct 1 2024, 03:06:41) [MSC v.1941 64 bit (AMD64)]

Additional context

The last time this pipeline was run was in Nov 2024 - the env looked like this

azure-cli 2.52.0 *

core 2.52.0 *
telemetry 1.1.0

Extensions:
azure-devops 1.0.1

Dependencies:
msal 1.24.0b1
azure-mgmt-resource 23.1.0b2

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\sveAzRCSBLD.azure\cliextensions'

Python (Windows) 3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:05:00) [MSC v.1929 32 bit (Intel)]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Auto-AssignAuto assign by botAuto-ResolveAuto resolve by botNetwork - Front DoorService AttentionThis issue is responsible by Azure service team.bugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions