I'm trying to manipulate Azure security groups in Python. The big picture works.
But,Attempts to add a rule to an existing security group.
network_client.security_rules.create_or_update('resourcesname',"nsg-name","secure-name",SecurityRule(
protocol='Tcp',
source_address_prefix='*',
destination_address_prefix='*',
access='Allow',
direction='Inbound', description=name+' use rules',source_port_range='*',
#destination_port_range="1000,2000",
#destination_port_range=["1000","2000"],
destination_port_range=[1000,2000],
priority=100, name="secure-name"))
I get the following error when I specify multiple ports
msrestazure.azure_exceptions.CloudError: Azure Error: SecurityRuleInvalidPortRange
Message: Security rule has invalid Port range. Value provided: [1000,2000]. Value should be an integer OR integer range with '-' delimiter. Valid range 0-65535.
I've also tried string arrays and simple strings. But it fails. Can anyone solve the problem?
