I'm using the Azure ARM API and I'm trying to list all publishers by location through the Azure Java SDK, by executing the following code:
import com.microsoft.azure.management.compute.ComputeManagementClient;
import com.microsoft.azure.management.compute.ComputeManagementService;
import com.microsoft.azure.management.compute.models.VirtualMachineImageListPublishersParameters;
import com.microsoft.azure.management.compute.models.VirtualMachineImageResourceList;
@Test
public void testListPublishers() {
ComputeManagementClient client = ComputeManagementService.create(createConfiguration());
VirtualMachineImageListPublishersParameters params = new VirtualMachineImageListPublishersParameters();
params.setLocation("westus");
VirtualMachineImageResourceList response = client.getVirtualMachineImagesOperations().listPublishers(params);
ArrayList<VirtualMachineImageResource> resources = response.getResources();
System.out.println("Found publishers: " + resources.size());
}
This results in the following request:
GET /subscriptions/{some-subscription}/providers/Microsoft.Compute/locations/westus/publishers?api-version=2015-06-15
However, I always get and empty list, no matter the location I put in the publisher parameters. I am able to list other resources with the same client, so it is not an issue in creating the client.
Do you have any suggestions of what I might be doing wrong? Perhaps there is a permission that I don't have?
Thanks!