❔ Is there a way to set environment name in dotnet core without publishing for each environment?
From what I understand I need to pass environment name to dotnet task in yaml for each environment I need. Sample below. Which means build the same source code multiple times just to set the environment name. So if I have dev, qa, train and prod, I publish it 4 times and the artifacts are then extracted and deployed.
Is there a way I build ones and set environment name in azure yaml based on where its being deployed to
- task: DotNetCoreCLI@2
displayName: 'Build/Publish WebApi.${{ parameters.projectName }} ${{ parameters.framework }}${{ parameters.environmentName }}'
inputs:
command: publish
...
...
arguments: '-c ${{ parameters.configuration }} -o $(Build.ArtifactStagingDirectory)/WebApi -f ${{ parameters.framework }} **-p:EnvironmentName=${{ parameters.environmentName }} **--no-restore --verbosity minimal'
...
1 Reply
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.