Bylaw

Gallery › BuiltInPolicyTest › Azure built-in policies

[Deprecated]: Load tests should be run only against private endpoints from within a virtual network. Versioning Test BuiltIn.

Doesn't convert yet Policy Audit Deny Disabled Mode Microsoft.LoadTestService.Data Version 1.1.0-deprecated Deprecated

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_Versioning_Test.json · 64 lines
{
  "properties": {
    "displayName": "[Deprecated]: Load tests should be run only against private endpoints from within a virtual network. Versioning Test BuiltIn.",
    "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.1.0-deprecated",
      "category": "BuiltInPolicyTest",
      "deprecated": true
    },
    "version": "1.1.0",
    "parameters": {
      "effect": {
        "type": "String",
        "metadata": {
          "displayName": "Effect",
          "description": "Enable or disable the execution of the policy."
        },
        "allowedValues": [
          "Audit",
          "Deny",
          "Disabled"
        ],
        "defaultValue": "Audit"
      },
      "testString": {
        "metadata": {
          "displayName": "Test string",
          "description": "A string to be compared against 'test' in the policy rule to generate the desired compliance result."
        },
        "type": "string",
        "defaultValue": "test"
      }
    },
    "policyRule": {
      "if": {
        "allOf": [
          {
            "value": "[parameters('testString')]",
            "equals": "test"
          },
          {
            "field": "type",
            "equals": "Microsoft.LoadTestService.Data/loadTests/testRuns"
          },
          {
            "field": "Microsoft.LoadTestService.Data/loadTests/testRuns/subnetId",
            "equals": ""
          }
        ]
      },
      "then": {
        "effect": "[parameters('effect')]"
      }
    },
    "versions": [
      "1.1.0",
      "1.0.0"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/033f1f0f-0eff-42f0-85aa-f79b78e59a40",
  "name": "033f1f0f-0eff-42f0-85aa-f79b78e59a40"
}

Source: built-in-policies/policyDefinitions/BuiltInPolicyTest/LoadTestService_NetworkIsolation_Audit_Versioning_Test.json in Azure/azure-policy, under the MIT licence.