The Azure Code Samples are currently available in English
This sample uses certificate based service principal authentication to work with VMs.
Azure Compute sample for managing virtual machines - - Create a virtual machine - Update a virtual machine - Tag a virtual machine - Attach data disks - Detach data disks - Restart a virtual machine - Stop(Poweroff) virtual machine - Delete a virtual machine.
Running this Sample
To run this sample:
Clone the repository using the following command:
git clone https://github.com/Azure-Samples/Hybrid-Compute-Java-Manage-VM-Certificate-Based-Auth.git
Create an Azure service principal and assign a role to access the subscription. For instructions on creating a service principal, see Use Azure PowerShell to create a service principal with a certificate.
Export the service principal certificate as a pfx file.
Set the following required environment variable values:
Change directory to Hybrid sample:
- cd Hybrid-Compute-Java-Manage-VM-Certificate-Based-Auth
Run the sample:
- mvn clean compile exec:java