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 Creates or updates a remediation at subscription scope.
   *
   * @summary Creates or updates a remediation at subscription scope.
   * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateSubscriptionScope.json
   */
  const { PolicyInsightsClient } = require("@azure/arm-policyinsights");
  const { DefaultAzureCredential } = require("@azure/identity");
  
  async function createRemediationAtSubscriptionScope() {
    const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2";
    const remediationName = "storageRemediation";
    const parameters = {
      policyAssignmentId:
        "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5",
    };
    const credential = new DefaultAzureCredential();
    const client = new PolicyInsightsClient(credential, subscriptionId);
    const result = await client.remediations.createOrUpdateAtSubscription(
      remediationName,
      parameters
    );
    console.log(result);
  }
  
  createRemediationAtSubscriptionScope().catch(console.error);
  