【发布时间】:2021-03-26 17:21:01
【问题描述】:
---
variables:
azureSubscription: 'Visual Studio Professional Subscription (237bc9da-22ad-49ea-8411-6cf6a190c18f)'
RG: ClassroomInTheCloud
jobs:
- job: 1
steps:
- task: AzureCLI@1
dislayName: 'Azure CLI '
inputs:
azureSubscription: $(azureSubscription)
scriptLocation: inlineScript
inlineScript: |
mkdir $(Pipeline.Workspace)\BlobFile
az storage blob download --container-name $(containername) --file '$(Pipeline.Workspace)/s/student.json' --name 'student.json' --connection-string 'VALUE IN HERE'
- pwsh: |
cd '/home/vsts/work/1/s/'
ls
$armOutput = Get-Content '/home/vsts/work/1/s/student.json' | convertfrom-json
$studentvalue = $armOutput.studentvalue
$type = $armOutput.type
Write-Host "The value of [$studentvalue] is [$type]"
Write-Output "##vso[task.setvariable variable=$studentvalue;]$type"
Write-Output "##vso[task.setvariable variable=$studentvalue;isOutput=true]$studentvalue"
Write-Output "The Value of studentvalue is [$studentvalue]"
name: setvarStep
- script: |
echo $(studentvalue)
- job: 2
displayName: Create Web App
dependsOn: 1
variables:
webappname: $[studentvalue]
steps:
- task: AzureWebApp@1
inputs:
azureSubscription: $(azureSubscription)
resourceGroupName: $(RG)
appName: $(webappname)
package: $(System.DefaultWorkingDirectory)**/*.csproj
- task: AzureAppServiceSettings@1
displayName: Azure App Service Settings
inputs:
azureSubscription: $(azureSubscription)
appName: $(webappname)
# To deploy the settings on a slot, provide slot name as below. By default, the settings would be applied to the actual Web App (Production slot)
# slotName: staging
appSettings: |
[
{
"name": "DIAGNOSTICS_AZUREBLOBCONTAINERSASURL",
"value": "VALUEINHERE",
"slotSetting": false
},
{
"name": "DIAGNOSTICS_AZUREBLOBRETENTIONINDAYS",
"value": "365",
"slotSetting": false
},
{
"name": "OEM",
"value": "netsupport",
"slotSetting": false
},
{
"name": "SCM_REPOSITORY_PATH",
"value": "d:\\home\\respository",
"slotSetting": false
},
{
"name": "VIDEO_CLIENT_URL",
"value": "https://signal-uks.classroom.cloud",
"slotSetting": false
},
{
"name": "WEBSITE_NODE_DEFAULT_VERSION",
"value": "10.15.2",
"slotSetting": false
}
]
谁能告诉我为什么在将此 YAML 文件放入管道时出现以下错误?
Line 14, Col 7: Unexpected Value Display Name
Line 45, Col 6: A sequence was not expected
【问题讨论】:
-
我可能会从修改你的缩进开始。然后,由于您显示的是 YAML 的 sn-p,因此我会突出显示它抱怨的特定行,因为您的示例中没有行号。
标签: azure azure-devops