Create NSG Rule in Azure using Java

Sara 1 Reputation point
2021-07-14T23:26:22.99+00:00

I am trying to create NSG Rules in Microsoft Azure using their API, does anyone know if this is fine to create a Rule?

NetworkSecurityGroup.Update update = networkSecurityGroup.update();
update.defineRule(name)
                        .allowInbound()
                        .fromAddresses("")
                        .fromPortRanges()
                        .toAddresses("")
                        .toPortRanges("")
                        .withProtocol(SecurityRuleProtocol.UDP)
                        .withPriority(ruleRepresentation.getPriority())
                        .attach();
Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,202 questions
{count} votes