Bylaw

Gallery › Azure Load Testing › Azure built-in policies

Load tests using Azure Load Testing should be run only against private endpoints from within a virtual network.

Doesn't convert yet Policy Audit Deny Disabled Mode Microsoft.LoadTestService.Data Version 1.0.1

Azure Load Testing engine instances should use virtual network injection for the following purposes: 1. Isolate Azure Load Testing engines to a virtual network. 2. Enable Azure Load Testing engines to interact with systems in either on premises data centers or Azure service in other virtual networks. 3. Empower customers to control inbound and outbound network communications for Azure Load Testing engines.

ConvertTo-Bylaw can't convert this policy yet:

Azure Policy JSONLoadTestService_NetworkIsolation_Audit.json · 51 lines
{
  "properties": {
    "displayName": "Load tests using Azure Load Testing should be run only against private endpoints from within a virtual network.",
    "policyType": "BuiltIn",
    "mode": "Microsoft.LoadTestService.Data",
    "description": "Azure Load Testing engine instances should use virtual network injection for the following purposes: 1. Isolate Azure Load Testing engines to a virtual network. 2. Enable Azure Load Testing engines to interact with systems in either on premises data centers or Azure service in other virtual networks. 3. Empower customers to control inbound and outbound network communications for Azure Load Testing engines.",
    "metadata": {
      "version": "1.0.1",
      "category": "Azure Load Testing"
    },
    "version": "1.0.1",
    "parameters": {
      "effect": {
        "type": "String",
        "metadata": {
          "displayName": "Effect",
          "description": "Enable or disable the execution of the policy."
        },
        "allowedValues": [
          "Audit",
          "Deny",
          "Disabled"
        ],
        "defaultValue": "Audit"
      }
    },
    "policyRule": {
      "if": {
        "allOf": [
          {
            "field": "type",
            "equals": "Microsoft.LoadTestService.Data/loadTests/testRuns"
          },
          {
            "field": "Microsoft.LoadTestService.Data/loadTests/testRuns/subnetId",
            "equals": ""
          }
        ]
      },
      "then": {
        "effect": "[parameters('effect')]"
      }
    },
    "versions": [
      "1.0.1",
      "1.0.0-PREVIEW"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/d855fd7a-9be5-4d84-8b75-28d41aadc158",
  "name": "d855fd7a-9be5-4d84-8b75-28d41aadc158"
}

Source: built-in-policies/policyDefinitions/Azure Load Testing/LoadTestService_NetworkIsolation_Audit.json in Azure/azure-policy, under the MIT licence.