【发布时间】:2016-08-28 02:33:47
【问题描述】:
理想情况下,我希望使用构建变量(在 VSTS 上)配置我们的 Azure Web App 应用程序设置,例如:
我们使用 Powershell 脚本执行发布任务。为了设置应用程序设置,可以使用以下脚本:
param($websiteName, $appSettings)
Set-AzureWebsite -Name $websiteName -AppSettings $appSettings
我可以将这些构建变量手动传递到 Powershell 脚本构建任务中,如下所示:
PrepareAppSettings.ps1 -websiteName "MyWebApp" -appsettings @{"MyConnectionString" = $(MyConnectionString);"MyRandomService" = $(MyRandomService);"MyRandomServiceClient"=$(MyRandomServiceClient);"MyRandomServicePassword"=$(MyRandomServicePassword)}
有没有一种方法可以将所有构建变量传递到脚本中,而无需在哈希表中明确指定每个变量?
【问题讨论】:
标签: powershell tfs azure-devops azure-web-app-service azure-pipelines