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.
  const { SynapseManagementClient } = require("@azure/arm-synapse");
  const { DefaultAzureCredential } = require("@azure/identity");
  
  /**
   * This sample demonstrates how to Returns a list of workspaces in a subscription
   *
   * @summary Returns a list of workspaces in a subscription
   * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListWorkspacesInSubscription.json
   */
  async function listWorkspacesInSubscription() {
    const subscriptionId = "00000000-1111-2222-3333-444444444444";
    const credential = new DefaultAzureCredential();
    const client = new SynapseManagementClient(credential, subscriptionId);
    const resArray = new Array();
    for await (let item of client.workspaces.list()) {
      resArray.push(item);
    }
    console.log(resArray);
  }
  
  listWorkspacesInSubscription().catch(console.error);
  