I am working on a small project to list all the VirtualNetworks details under a subscription. In our subscription we have both classic and ARM Virtual networks. I am using Azure latest Java SDK(1.1.2) to pull the info. I am using the below API call and it is returning only the VNets from ARM, not from classic. Please see the code snippet.
ApplicationTokenCredentials credentials = new ApplicationTokenCredentials(
clientId, tenantId, clientKey, AzureEnvironment.AZURE);
Azure azure = Azure.authenticate(credentials).withSubscription(subscriptionId);
for (Network virtualNetwork : azure.networks().list()){
Utils.print(virtualNetwork);
}
How can I get both ARM and classic VNets?