An Azure service that provides a cloud content delivery network with threat protection.
Hello @Ramanarajan D
Yes, what you're seeing is related to the Azure CLI CDN migration introduced with Azure CLI 2.88.0. Microsoft’s 2.88.0 release notes specifically state that the entire CDN module was migrated to azure-cli-extensions.
Your previous command used the older flattened parameters:
--action-name UrlRewrite
--source-pattern /
--destination '/web-com-staticassets/'
--preserve-unmatched-path true
With the current implementation, az afd rule create exposes the rule actions through the structured --actions parameter instead. The current documentation confirms that --actions accepts shorthand syntax, JSON, or YAML.
For your particular case, though, I would avoid putting the complete action definition into az afd rule create. A cleaner approach with the new command structure is to create the rule first and then add the UrlRewrite action separately.
For example:
az afd rule create
--name "BlobContainer$(ticketID)" \
--resource-group "$(resourceGroupName)" \
--profile-name "$(afdProfileName)" \
--rule-set-name "staticassetsstorage$(ticketID)" \
--order 0
Then add the URL rewrite action:
az afd rule action add
--resource-group "$(resourceGroupName)" \
--profile-name "$(afdProfileName)" \
--rule-set-name "staticassetsstorage$(ticketID)" \
--rule-name "BlobContainer$(ticketID)" \
--action-name UrlRewrite \
--url-rewrite "{sourcePattern:/,destination:/web-com-staticassets/,preserveUnmatchedPath:true}"
The current CLI exposes az afd rule action add specifically for adding actions to an existing delivery rule, and UrlRewrite is one of the supported action types.
Also note that order 0 has special behavior. Microsoft documents order 0 as a rule that does not require a condition, and its actions are always applied. Since your original rule doesn't contain a match condition, this is appropriate if the rewrite is intended to apply unconditionally.
Regarding Try "??" to show more
That message in the documentation isn't an error.
It means that --actions, --conditions, --url-rewrite, and similar parameters are structured arguments rather than simple string parameters. Azure CLI's generated help can display the structure expected by these arguments.
For example, try:
az afd rule action add --action-name UrlRewrite --url-rewrite "??"
This should show the fields accepted by the --url-rewrite object for the version of the CDN extension installed in your environment.
I would also check the versions being used by the pipeline:
az version
az extension show --name cdn
This is particularly important now because az afd is provided through the CDN extension. The current Microsoft documentation identifies az afd rule as part of that extension.
If the command syntax still differs from the above, please post the output of:
az version
az extension show --name cdn
az afd rule action add --help
That will help determine whether the pipeline is loading a different CDN extension version than the documentation.
Please "Accept the Answer" if this information helped you. This will help us and others in the community as well.