小编ser*_*hon的帖子

使用保管库机密进行 Azure DevOps 文件转换

我需要通过 azure devops 部署 linux azure 应用程序服务。我的配置存储在 appsettings 文件中,我需要将配置值替换为存储在 azure Vault 中的值。

因此,我在工件中创建了变量组,将其链接到管道中的变量,并使用 FileTransform@2 替换 appsettings 值。

但它会替换为空值。如果我通过分配一些字符串值在管道中显式定义变量值 - 它工作正常。

另外,我无法将 AzureRmWebAppDeployment@4 与 JSONFiles 一起使用,它不适用于 Linux 部署

解决这个问题的方法是什么?

这是管道代码:

trigger:
  branches:
    include:
    - master
    - develop
    - release/*
  paths:
    include:
    - src/ConsumerBackEnd/*
    - src/ConsumerShared/*

variables:
  - name: poolName
    value: 'Private-Windows10'
  - name: azureRegisteredApp
    value: 'portal-devops'
  - name: workingDirectory
    value: '$(System.DefaultWorkingDirectory)/src/ConsumerBackEnd'
  - name: solutionDirectory
    value: '$(System.DefaultWorkingDirectory)/src'

stages:
- stage: Build
  displayName: Build stage

  jobs:
  - job: Build
    displayName: Build
    pool:
      name: …
Run Code Online (Sandbox Code Playgroud)

azure-web-app-service azure-devops

2
推荐指数
1
解决办法
3273
查看次数