使用Azure DevOps YAML任务“ Invoke-HTTP”,我不断
Exception message 'Exception Message: Invalid JavaScript property identifier character: -. Path '', line 1, position 8. (type JsonReaderException)'
这是任务的文档:
脚本如下:
jobs:
# Publish resource group artifact
- job: invoke_http_for_ase
pool: server
continueOnError: true
steps:
# Invoke REST API
# Invoke a REST API as a part of your pipeline.
- task: InvokeRESTAPI@1
displayName: 'GET Member'
inputs:
connectionType: 'connectedServiceNameARM'
azureServiceConnection: 'ARM-Service-Connection'
method: 'GET'
headers: '{Content-Type:application/json}'
urlSuffix: "subscriptions/xxx/resourceGroups/xxx?api-version=2018-05-01"
waitForCompletion: 'true'
设计人员在发布管道中使用发布任务进行的相同工作。
答案 0 :(得分:0)
缩进是您的问题。在“ jobs:”下方向左移动每行,即:
jobs:
- job: invoke_http_for_ase
pool: server
continueOnError: true
steps:
# Invoke REST API
# Invoke a REST API as a part of your pipeline.
- task: InvokeRESTAPI@1
displayName: 'GET Member'
inputs:
connectionType: 'connectedServiceNameARM'
azureServiceConnection: 'ARM-Service-Connection'
method: 'GET'
headers: '{Content-Type:application/json}'
urlSuffix: "subscriptions/xxx/resourceGroups/xxx?api-version=2018-05-01"
waitForCompletion: 'true'