Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unexpected token #118

Open
Emmanuel35 opened this issue Sep 29, 2021 · 0 comments
Open

unexpected token #118

Emmanuel35 opened this issue Sep 29, 2021 · 0 comments

Comments

@Emmanuel35
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant