azure-apim-extension
azure-apim-extension copied to clipboard
unexpected token
I use a pipeline declaration to modify an operation
- task: apimoperationpolicies@5
displayName: 'listGammes'
inputs:
ConnectedServiceNameARM: 'xxx'
ResourceGroupName: '$(APIM.resourceGroupName)'
ApiPortalName: '$(APIM.portalName)'
ApiName: '$(ApiKey)$(ApiVersion)'
OperationName: 'listGammes'
CurrentRevision: true
MicrosoftApiManagementAPIVersion: '$(MicrosoftApiVersion)'
TemplateSelector: 'Artifact'
policyArtifact: '$(System.DefaultWorkingDirectory)/$(ApiKey)/policies/listGammes.xml'
My policies file, listGammes.xml, contains:
<set-variable name="code"
value="@(
context.Request.Url.Query.GetValueOrDefault("code", "")
)"/>
Deploiment block with an error:
...
<set-variable name=\"code\"
value=\"@(
context.Request.Url.Query.GetValueOrDefault(\"code\", \"\")
)\"/>
...
@{code=ValidationError; target=representation; message='code' is an unexpected token. Expecting white space. Line 24, position 50.}
##[error]The remote server returned an error: (400) Bad Request.
So, I have checked and verify my policies. It is accepted with a manual deployment.