private static void SetTagsOnVm() { //make sure vm exists CreateSingleVmExample(); AzureResourceGroup rg = AzureClient.GetResourceGroup(subscriptionId, rgName); AzureVm vm = rg.Vms()[vmName]; vm.AddTag("tagkey", "tagvalue"); }
private static void StartFromVm() { // TODO: Look at VM nic/nsg operations on VM //make sure vm exists CreateSingleVmExample(); //retrieve from lowest level, doesn't give ability to walk up and down the container structure AzureVm vm = VmCollection.GetVm(subscriptionId, rgName, vmName); Console.WriteLine("Found VM {0}", vm.Id); //retrieve from lowest level inside management package gives ability to walk up and down AzureResourceGroup rg = AzureClient.GetResourceGroup(subscriptionId, rgName); AzureVm vm2 = rg.Vms()[vmName]; Console.WriteLine("Found VM {0}", vm2.Id); }