Azure Functions Deployment Error
October 10, 2019
I was deploying a test azure function using the tutorial at https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-first-java-maven and it was failing with the following error:
[ERROR] Failed to execute goal com.microsoft.azure:azure-functions-maven-plugin:1.3.4:deploy (default-cli) on project azure-functions: 2 exceptions occurred. :
Chain of Causes for CompositeException In Order Received =>
: Unrecognized field "evaluationDetails" (class com.microsoft.azure.PolicyViolationErrorInfo), not marked as ignorable (13 known properties: "policyDefinitionId",
"policyDefinitionReferenceId", "policyDefinitionDisplayName", "policyAssignmentParameters", "policyAssignmentName", "policySetDefinitionName", "policyDefinitionName",
"policyAssignmentScope", "policyDefinitionEffect", "policyAssignmentId", "policySetDefinitionId", "policySetDefinitionDisplayName", "policyAssignmentDisplayName"])
[ERROR] at [Source: (String)"{"policyDefinitionDisplayName":"Allowed locations","evaluationDetails":{"evaluatedExpressions":
{"result":"True","expressionKind":"Field","expression":"location","path":"location","expressionValue":"westus","targetValue":["northeurope","westeurope"],"operator":"NotIn"},
{"result":"True","expressionKind":"Field","expression":"location","path":"location","expressionValue":"westus","targetValue":"global","operator":"NotEquals"},
{"result":"True","expressionKind":"Field","expression":"type","path":"ty"[truncated 904 chars]; line: 1, column: 73] (through reference chain:
com.microsoft.azure.CloudError["additionalInfo"]->java.util.ArrayList[0]->com.microsoft.azure.PolicyViolationErrorInfo["evaluationDetails"])
: Unrecognized field "evaluationDetails" (class com.microsoft.azure.PolicyViolationErrorInfo), not marked as ignorable (13 known properties: "policyDefinitionId",
"policyDefinitionReferenceId", "policyDefinitionDisplayName", "policyAssignmentParameters", "policyAssignmentName", "policySetDefinitionName", "policyDefinitionName",
"policyAssignmentScope", "policyDefinitionEffect", "policyAssignmentId", "policySetDefinitionId", "policySetDefinitionDisplayName", "policyAssignmentDisplayName"])
[ERROR] at [Source: (String)"{"policyDefinitionDisplayName":"Allowed locations","evaluationDetails":{"evaluatedExpressions":
[{"result":"True","expressionKind":"Field","expression":"location","path":"location","expressionValue":"westus","targetValue": ["northeurope","westeurope"],"operator":"NotIn"},
{"result":"True","expressionKind":"Field","expression":"location","path":"location","expressionValue":"westus","targetValue":"global","operator":"NotEquals"},
{"result":"True","expressionKind":"Field","expression":"type","path":"ty"[truncated 912 chars]; line: 1, column: 73] (through reference chain:
com.microsoft.azure.CloudError["additionalInfo"]->java.util.ArrayList[0]->com.microsoft.azure.PolicyViolationErrorInfo["evaluationDetails"])
Googling the headline error Unrecognized field "evaluationDetails" (class com.microsoft.azure.PolicyViolationErrorInfo) gave me no matches at all.
I worked out that the problem was due to the region I was deploying into - I had set in my pom.xml. Changing this to made the problem go away and I successfully deployed the function.
In writing this up, I've noticed a hint of this in the error message:
"expressionValue":"westus","targetValue":["northeurope","westeurope"]
but it was somewhat obscure!


