Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
5,259 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am developing a program that retrieve vm information using java sdk.
i can retrieve vm by resource id as below,
but i don't know, how to retrieve vm by vm id(uuid).
Thanks.
TokenCredential tokenCredential = new EnvironmentCredentialBuilder()
.authorityHost(AzureAuthorityHosts.AZURE_PUBLIC_CLOUD)
.build();
AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
AzureResourceManager azureResourceManager = AzureResourceManager.configure()
.withLogLevel(HttpLogDetailLevel.BASIC)
.authenticate(tokenCredential, profile)
.withDefaultSubscription();
VirtualMachines virtualMachines = azureResourceManager.virtualMachines();
VirtualMachine vm = virtualMachines.getById("/subscriptions/*************/resourceGroups/*****/providers/Microsoft.Compute/virtualMachines/vm2");