Search code examples
azure-devopsazure-artifacts

Build one generic artifacts in Azure Devops and inject certain variables based on different environments on release


Is it possible to build a generic artifact for different environment where I can inject/replace certain variables when publishing the artifact to specific environment? If it is possible, what are the configuration to make this works?


Solution

  • Is it possible to build a generic artifact for different environment where I can inject/replace certain variables when publishing the artifact to specific environment?

    I am afraid there is no such way to build a generic artifact for different environment.

    As we know, the Azure artifact support multiple types, like build artifacts, NuGet, npm and so on. So there is no one way to satisfy all types of artifacts for different environment by injecting certain variables based on different environments.

    Azure devops is more about generating or publishing artifacts, rather than operating the internals of the artifacts. This is achieved by the tools of the artifacts themselves. For example, the nuget packages, we use the nuget task or nuget.exe to handle inside of the artifacts.

    To publish the artifact to specific environment, we could try to create the different artifacts when we build the pipeline:

    enter image description here