Azure Stack Compute sample for managing virtual machines:
- Create a virtual machine with managed OS Disk
- Start a virtual machine
- Stop a virtual machine
- Restart a virtual machine
- Update a virtual machine
- Tag a virtual machine (there are many possible variations here)
- Attach data disks
- Detach data disks
- List virtual machines
- Delete a virtual machine
To run this sample:
-
Clone the repository using the following command:
$ git clone https://github.com/Azure-Samples/Hybrid-Java-Samples.git
-
Create an Azure service principal and assign a role to access the subscription. For instructions on creating a service principal in Azure Stack, see Create a service principal with an application secret.
-
Copy the settings file
azureSecretSpConfig.json.dist
toazureSecretSpConfig.json
and fill in the configuration settings from the service principal. -
Change directory to sample:
$ cd vm
-
Run the sample:
$ mvn clean compile $ mvn exec:java
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.