The parameter --source-addresses is not optional for NatRule, without it az network firewall policy rule-collection-group collection rule add command will fails with:
Operation returned an invalid status 'Bad Request'
Example failing command:
$ az network firewall policy rule-collection-group collection rule add \
> -g $RG \
> --policy-name fw-policy \
> --collection-name nat_collection \
> --rcg-name collection-1 \
> --name port-8082-to-spoke1-web-server \
> --rule-type NatRule \
> --description "port-8082-to-spoke1-web-server" \
> --destination-addresses "$fwpublicaddr" \
> --destination-ports 8082 \
> --translated-address "10.1.10.4" \
> --translated-port 80 \
> --ip-protocols TCP
Command group 'network firewall policy rule-collection-group collection rule' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Operation returned an invalid status 'Bad Request'
Example working command:
$ az network firewall policy rule-collection-group collection rule add \
> -g $RG \
> --policy-name fw-policy \
> --collection-name nat_collection \
> --rcg-name collection-1 \
> --name port-8082-to-spoke1-web-server \
> --rule-type NatRule \
> --source-addresses "*" \
> --description "port-8082-to-spoke1-web-server" \
> --destination-addresses "$fwpublicaddr" \
> --destination-ports 8082 \
> --translated-address "10.1.10.4" \
> --translated-port 80 \
> --ip-protocols TCP
Command group 'network firewall policy rule-collection-group collection rule' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstCommand group 'network firewall policy rule-collection-group collection rule' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
{
"etag": "953489d1-2b14-48f4-adfb-319c61f808e7",
... snipped ...
"type": "Microsoft.Network/FirewallPolicies/RuleCollectionGroups"
}
Please consider:
- Improving the documentation.
- Improving command validation and error messages returned to the client to avoid unhelpful "Bad request" messages.
- Adding several command examples for the various rule types.
Thanks!
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
The parameter
--source-addressesis not optional forNatRule, without itaz network firewall policy rule-collection-group collection rule addcommand will fails with:Example failing command:
Example working command:
Please consider:
Thanks!
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.