Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

az network nsg rule create incorrect syntax #31033

Open
stevehardenCBR opened this issue Mar 14, 2025 · 2 comments
Open

az network nsg rule create incorrect syntax #31033

stevehardenCBR opened this issue Mar 14, 2025 · 2 comments
Assignees
Labels
Auto-Assign Auto assign by bot Azure CLI Team The command of the issue is owned by Azure CLI team customer-reported Issues that are reported by GitHub users external to the Azure organization. Network az network vnet/lb/nic/dns/etc... Possible-Solution question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Similar-Issue
Milestone

Comments

@stevehardenCBR
Copy link

Describe the bug

When using az network nsg rule create command and using either of the following parameters the syntax for entering the data is incorrect (this should be updated in the ?? command:

--destination-address-prefixes
--destination-port-ranges
--source-address-prefixes
--source-port-ranges

when using these with multiple CIDR or ip addresses is says to pass them as "space separated strings" but when you pass --destination-address-prefixes 10.1.1.0/24 10.2.1.0/24 for example, you will receive an "incorrect parameter" message.

what you need to pass to these parameters is a splatted string such as

--destination-address-prefixes @("10.1.1.0/24","10.2.1.0/24")

Related command

az network nsg rule create

Errors

incorrect parameters passed

Issue script & Debug output

it simply errors with incorrect parameters

Expected behavior

it should be able to complete correctly

Environment Summary

azure cli latest

Additional context

No response

@stevehardenCBR stevehardenCBR added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Mar 14, 2025
@yonzhan
Copy link
Collaborator

yonzhan commented Mar 14, 2025

Thank you for opening this issue, we will look into it.

Copy link

Here are some similar issues that might help you. Please check if they can solve your problem.


Possible solution (Extracted from existing issue, might be incorrect; please verify carefully)

Solution 1:

Space-separated list (should work): --ports 80 443

Reference:

Solution 2:

Judging by the weird error message and the fact that you are on Linux, my first thought is you need to quote the stars "*"

Reference:

Powered by issue-sentinel

@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. Network az network vnet/lb/nic/dns/etc... labels Mar 14, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added Auto-Assign Auto assign by bot Azure CLI Team The command of the issue is owned by Azure CLI team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Mar 14, 2025
@yonzhan yonzhan added this to the Backlog milestone Mar 14, 2025
@yonzhan yonzhan removed the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Mar 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot Azure CLI Team The command of the issue is owned by Azure CLI team customer-reported Issues that are reported by GitHub users external to the Azure organization. Network az network vnet/lb/nic/dns/etc... Possible-Solution question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Similar-Issue
Projects
None yet
Development

No branches or pull requests

3 participants