Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
388 views
in Technique[技术] by (71.8m points)

sandbox - I am trying to create Azure Data Factory and getting error: RequestDisallowedByPolicy

The error that I found is:

{
  "code": "InvalidTemplateDeployment",
  "details": [
    {
      "code": "RequestDisallowedByPolicy",
      "target": "adeebadflearning",
      "message": "Resource 'adeebadflearning' was disallowed by policy. Policy identifiers: '[{"policyAssignment":{"name":"sqlserver","id":"/providers/Microsoft.Management/managementGroups/triplecrown1/providers/Microsoft.Authorization/policyAssignments/4d7e23dc76164960b2c974ac"},"policyDefinition":{"name":"Allowed resource types","id":"/providers/Microsoft.Authorization/policyDefinitions/a08ec900-254a-4555-9bf5-e42af04b5c5c"},"policySetDefinition":{"name":"sqlserver","id":"/providers/Microsoft.Management/managementGroups/triplecrown1/providers/Microsoft.Authorization/policySetDefinitions/d5a5d5bb-91e0-4a17-9894-25d0f73aa09f"}}]'.",
      "additionalInfo": [
        {
          "type": "PolicyViolation",
          "info": {
            "policyDefinitionDisplayName": "Allowed resource types",
            "policySetDefinitionDisplayName": "sqlserver",
            "evaluationDetails": {
              "evaluatedExpressions": [
                {
                  "result": "False",
                  "expressionKind": "Field",
                  "expression": "type",
                  "path": "type",
                  "expressionValue": "Microsoft.DataFactory/factories",
                  "targetValue": [
                    "microsoft.resources/resourcegroups",
                    "microsoft.storage/storageaccounts",
                    "microsoft.dbforpostgresql/servers",
                    "microsoft.sql/servers",
                    "microsoft.sql/servers/databases",
                    "microsoft.documentdb/databaseaccounts",
                    "microsoft.sql/servers/elasticpools",
                    "microsoft.dbformysql/servers",
                    "microsoft.operationalinsights/workspaces",
                    "microsoft.operationsmanagement/solutions",
                    "microsoft.insights/actiongroups",
                    "microsoft.insights/activitylogalerts",
                    "microsoft.insights/autoscalesettings",
                    "microsoft.insights/metricalerts"
                  ],
                  "operator": "In"
                }
              ]
            },
            "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a08ec900-254a-4555-9bf5-e42af04b5c5c",
            "policySetDefinitionId": "/providers/Microsoft.Management/managementGroups/triplecrown1/providers/Microsoft.Authorization/policySetDefinitions/d5a5d5bb-91e0-4a17-9894-25d0f73aa09f",
            "policyDefinitionReferenceId": "11619501722087078793",
            "policySetDefinitionName": "d5a5d5bb-91e0-4a17-9894-25d0f73aa09f",
            "policyDefinitionName": "a08ec900-254a-4555-9bf5-e42af04b5c5c",
            "policyDefinitionEffect": "deny",
            "policyAssignmentId": "/providers/Microsoft.Management/managementGroups/triplecrown1/providers/Microsoft.Authorization/policyAssignments/4d7e23dc76164960b2c974ac",
            "policyAssignmentName": "4d7e23dc76164960b2c974ac",
            "policyAssignmentDisplayName": "sqlserver",
            "policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/triplecrown1",
            "policyAssignmentParameters": {}
          }
        }
      ]
    }
  ],
  "message": "The template deployment failed because of policy violation. Please see details for more information."
}
question from:https://stackoverflow.com/questions/65865801/i-am-trying-to-create-azure-data-factory-and-getting-error-requestdisallowedbyp

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This means that there was a policy set for your resource which blocked the deployment, various policies are set for a project for security reasons, you can check which policy blocked your deployment using below PowerShell query:

(Get-AzPolicyDefinition -Id "/subscriptions/{guid}/providers/Microsoft.Authorization/policyDefinitions/regionPolicyDefinition").Properties.policyRule | ConvertTo-Json

For security or compliance, your subscription administrators might assign policies that limit how resources are deployed. For example, your subscription might have a policy that prevents creating Public IP addresses, Network Security Groups, User-Defined Routes, or route tables. The error message in the Symptoms section shows the name of the policy. To resolve this problem, review the resource policies, and determine how to deploy resources that comply with those policies.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...