text: /*
   * Copyright (c) Microsoft Corporation.
   * Licensed under the MIT License.
   *
   * Code generated by Microsoft (R) AutoRest Code Generator.
   * Changes may cause incorrect behavior and will be lost if the code is regenerated.
   */
  
  // Copyright (c) Microsoft Corporation.
  // Licensed under the MIT License.
  /**
   * This sample demonstrates how to Gets the status of a virtual machine from a VM scale set.
   *
   * @summary Gets the status of a virtual machine from a VM scale set.
   * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetVMInstanceViewAutoPlacedOnDedicatedHostGroup.json
   */
  const { ComputeManagementClient } = require("@azure/arm-compute");
  const { DefaultAzureCredential } = require("@azure/identity");
  
  async function getInstanceViewOfAVirtualMachineFromAVMScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement() {
    const subscriptionId = "{subscription-id}";
    const resourceGroupName = "myResourceGroup";
    const vmScaleSetName = "myVirtualMachineScaleSet";
    const instanceId = "0";
    const credential = new DefaultAzureCredential();
    const client = new ComputeManagementClient(credential, subscriptionId);
    const result = await client.virtualMachineScaleSetVMs.getInstanceView(
      resourceGroupName,
      vmScaleSetName,
      instanceId
    );
    console.log(result);
  }
  
  getInstanceViewOfAVirtualMachineFromAVMScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement().catch(
    console.error
  );
  