Azure / Azure/azure-cli

az network nsg rule create incorrect syntax

Open
#31,033 12 comments 0 reactions 1 assignee Claimed by @necusjz View on GitHub
act-quality-productivity-squad Auto-Assign customer-reported Network Possible-Solution question Service Attention Similar-Issue
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### 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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.