Azure DevOps: Release Variables

Поділитися
Вставка
  • Опубліковано 10 гру 2024

КОМЕНТАРІ • 118

  • @RahulNath
    @RahulNath  4 роки тому +4

    Source Code - rahulpnath.visualstudio.com/Variables
    Build Pipeline - rahulpnath.visualstudio.com/Variables/_build?definitionId=12
    Release Pipeline - rahulpnath.visualstudio.com/Variables/_release?_a=releases&view=mine&definitionId=1

    • @ramug2015
      @ramug2015 3 роки тому

      Hi Rahul how to create db release pipeline without passing login credentials

  • @sonjoysengupto
    @sonjoysengupto 2 роки тому +1

    Your demos and explanations are so lucid and sequential, even a relatively difficult and not so well understood topic like DevSecOps seems so easy. Thanks a lot for this phenomenal tutorial 🙏🏾

    • @RahulNath
      @RahulNath  2 роки тому +1

      Glad to hear that Sanjay! Especially that it's lucid and sequential - I spend time to ensure that the videos progressively build on the concepts and it flows nicely. My full DevOps series is here bit.ly/azure-devops-series

    • @MohamadSamerKouka
      @MohamadSamerKouka Рік тому

      I have question please, is it working with XML file like Web.config files? if the connectionString value inside Web.config ?
      @@RahulNath

  • @santoshkumar-sj6ef
    @santoshkumar-sj6ef 5 місяців тому

    Bhai Sahab! . This is what I am looking for. Big Thanks

    • @RahulNath
      @RahulNath  4 місяці тому

      Glad it helped Santosh!

  • @Kbalz
    @Kbalz 2 роки тому

    Your videos are so well done and the perfect speed to follow along, thank you much !!!!

    • @RahulNath
      @RahulNath  2 роки тому

      Glad to hear that, Thank you!

  • @User67578
    @User67578 Рік тому +1

    Thank you much for the simple explanation

  • @Vivek-wz3nk
    @Vivek-wz3nk 9 місяців тому +1

    Can you please tell that how can we implement this on node application with .env file

  • @shikha.r
    @shikha.r Рік тому +1

    @RahulNath, can you please tell us how to give list of string in release varialble, for ex i need list of string Role= ["web". "db", "app"] how to define this in release variable.please help

    • @RahulNath
      @RahulNath  Рік тому

      Does this issue talk about what you are trying to do? github.com/microsoft/azure-pipelines-tasks/issues/9257
      You can use specific index and override the values as well as mentioned here learn.microsoft.com/en-us/azure/devops/pipelines/tasks/transforms-variable-substitution?view=azure-devops&tabs=Classic#json-variable-substitution-notes
      Not sure if you can delimit the string and pass it, haven't tried that. Let me know if any of that helps

    • @shikha.r
      @shikha.r Рік тому

      Above links didn’t work,
      I am looking specifically provide the value in pipeline variable from UI . I am not using Yaml

    • @RahulNath
      @RahulNath  Рік тому

      @@shikha.r Did you try the below method from the link about?
      A JSON object may contain an array whose values can be referenced by their index. For example, to substitute the first value in the Users array shown above, use the variable name DBAccess.Users.0.
      Also it says "You can also use DBAccess.Users = ["NewUser1","NewUser2","NewUser3"]." Did you try setting a list of values like that in the variables? Will be great if you have a sample pipeline to share, I can take a look.

    • @shikha.r
      @shikha.r Рік тому

      @RahulNath yes I did, but showing error too many command line argument . I am deploying infra via terraform using azure devops pipeline. And publically I can’t share the pipeline access

    • @shikha.r
      @shikha.r Рік тому

      @@RahulNath yes but it didn’t work, I changed the code, now i am dynamically passing value in string only. I am using terraform for creating infra

  • @patrickharris9429
    @patrickharris9429 3 роки тому

    Thank you. Very concise, accurate, and helpful.

    • @RahulNath
      @RahulNath  3 роки тому

      Happy you liked it Patrick!

  • @jlpcpr
    @jlpcpr Рік тому

    Great video! Very succinct and nicely shown.

  • @NareshKumar-mc1lu
    @NareshKumar-mc1lu 6 місяців тому

    Hi Rahul - I am trying to use the pipeline variables to make apply changes to arm template settings. However, I am ##[error]Failed to check the resource group status. Error: {"statusCode":400}. Also I am not using any artifacts. Just using the arm templates in the release pipeline to deploy IAC. Any ideas?

  • @parinitajha9416
    @parinitajha9416 2 роки тому +1

    Hi rahul, the purpose of variable is to define for debugging the multiple stage in pipeline. can you please tell me.

    • @RahulNath
      @RahulNath  2 роки тому

      Variables can be used for setting your application configuration. There are also predefined variables that you can use to affect different configuration in the pipeline itself
      docs.microsoft.com/en-us/azure/devops/pipelines/build/variables
      Does that help? Feel free to reach out if you need more help

    • @parinitajha9416
      @parinitajha9416 2 роки тому +1

      Thanks Rahul...

    • @RahulNath
      @RahulNath  2 роки тому

      @@parinitajha9416 Hope that answered your question!

    • @parinitajha9416
      @parinitajha9416 2 роки тому

      @@RahulNath yes I understood..

    • @RahulNath
      @RahulNath  2 роки тому

      @@parinitajha9416 👍

  • @vamsidhanushvml501
    @vamsidhanushvml501 2 роки тому

    Excellent Explanation 🙂

    • @RahulNath
      @RahulNath  2 роки тому +1

      Glad it helps Vamsi!

  • @anirudhtalluri2798
    @anirudhtalluri2798 3 роки тому +1

    Thank you Rahul for the video,
    So the release variables will replace the value for respective keys in appsettings.json file after stage/release is deployed successfully?

    • @RahulNath
      @RahulNath  3 роки тому +1

      Yes that is correct - If you are on Azure there are other ways too to manage sensitive/app configuration. Check it out here www.rahulpnath.com/blog/handling-application-configuration/
      Let me know if you have additional questions.

    • @anirudhtalluri2798
      @anirudhtalluri2798 3 роки тому +1

      @@RahulNath thank you got the solution by adding the json path in json value substitution in task configuration

    • @RahulNath
      @RahulNath  3 роки тому

      @@anirudhtalluri2798 Great!

  • @11504104067
    @11504104067 4 роки тому +1

    Simple and clear :)

  • @pratikshinde1674
    @pratikshinde1674 2 роки тому +1

    I have my source code on GIT repo but for some reason the release variables created on Azure Devops are not getting picked & get the values replaced from appsetttings.json file. Is it that the source-code should be present on Azure Repos only?

    • @RahulNath
      @RahulNath  2 роки тому +1

      Should work regardless of where the source code is. What are you deploying? Make sure you have the configuration file path is correct in the task

    • @pratikshinde1674
      @pratikshinde1674 2 роки тому +1

      @@RahulNath Thanks for the prompt reply. working now.

    • @RahulNath
      @RahulNath  2 роки тому

      @@pratikshinde1674 Great let me know how it goes 👍

  • @MohamadSamerKouka
    @MohamadSamerKouka Рік тому

    I have question please, is it working with XML file like Web.config files? if the connectionString value inside Web.config ?

    • @RahulNath
      @RahulNath  Рік тому

      Yes it should be doing it learn.microsoft.com/en-us/azure/devops/pipelines/tasks/transforms-variable-substitution?view=azure-devops&tabs=Classic#xmltransform

  • @yurivarshavsky3165
    @yurivarshavsky3165 4 роки тому +1

    Thank you, Rahul for the video. Can you please point to the method you use to populate the IndexModel? How the code can read the variables defined in the release? Thanks

    • @RahulNath
      @RahulNath  4 роки тому +1

      You can find the source code and pipeline here rahulpnath.visualstudio.com/Variables
      Let know if that helps. The applications configuration gets replaced with the values from the release pipeline variables, when the release is created. This makes it available to the source code.
      Feel free to ask if you need more information.

  • @roopanagappa
    @roopanagappa Рік тому +1

    How to access these variables in nextjs code

    • @RahulNath
      @RahulNath  Рік тому

      You can use transformation in the build and replace the variables in your nextjs code files. I show some examples using react in this playlist videos ua-cam.com/play/PL59L9XrzUa-npmS1p7AIPOH7eZqzgMqV0.html
      Let me know if that helps you or if you have additional questions.

  • @KalChakV
    @KalChakV 4 роки тому +1

    Can we share Variable Groups across multiple projects as well? or Is it possible to share them just across multiple pipelines.

    • @RahulNath
      @RahulNath  4 роки тому

      I guess it is within a project since that is where it gets defined. You can using a key vault to externalize it and pull down in multiple projects. I have two videos that shows you how to do this
      ua-cam.com/video/1OAy3XOE3OY/v-deo.html
      ua-cam.com/video/r1rL_2isCWM/v-deo.html
      Let know if that helps and if you have additional questions.

  • @sltiktok24
    @sltiktok24 Рік тому

    Can you do a video about deploying ARM template to azure using devops with YAML

    • @RahulNath
      @RahulNath  Рік тому +1

      Good suggestion - I currently have two videos one where I use YAML pipeline and other using ARM templates. Should be mostly about using the ARM task in the yaml?
      ua-cam.com/video/F93dKycIqEM/v-deo.html and ua-cam.com/video/3IRwtbGlshk/v-deo.html Does that help? Are you stuck with anything specific?

  • @theAnkita33
    @theAnkita33 2 роки тому

    If some one wants the database from dev stage to get populated in test stage(dev stage tables ) database then this will work ? without creating the variable group?

    • @RahulNath
      @RahulNath  2 роки тому

      Sorry I did not understand the question. Can you detail out your scenario?

  • @Flipkurama
    @Flipkurama 3 роки тому +1

    Tnks for the video

  • @kaiviti2013
    @kaiviti2013 3 роки тому +1

    How do you access Variables defined in your library group into your release pipeline which is a Powershell inline Script task ? I am not sure if this is a Syntax issue or something else. If you can give some pointers on how to get Powershell script to reference library variables that would be great

    • @RahulNath
      @RahulNath  3 роки тому +1

      You will need to pass them as arguments to the powershell task as shown here daniel-krzyczkowski.github.io/Parameters-In-Azure-DevOps-Pipelines/
      Let know if that helps solve your problem

    • @kaiviti2013
      @kaiviti2013 3 роки тому +1

      @@RahulNath Thanks for the link. It was useful. I was able to resolve the issue. Very basic oversight of not linking variable group with the stage in release pipeline hence it was not seeing the variable references.

    • @RahulNath
      @RahulNath  3 роки тому

      @@kaiviti2013 Glad you sorted it out.

  • @dsosys
    @dsosys 2 роки тому

    With this variable van we change the web.config values?

    • @RahulNath
      @RahulNath  2 роки тому

      Yes you should be able to learn.microsoft.com/en-us/azure/devops/pipelines/tasks/transforms-variable-substitution?view=azure-devops&tabs=Classic&WT.mc_id=AZ-MVP-5003875
      Are you facing any issues?

  • @Copolie
    @Copolie Рік тому

    Thanks for the video, it is indeed informative and excellent. Can you create variables and use it in the web config - as aconnectionstring, for each stages in the release? cuz I have three stages and each of them have different credentials.

  • @abdouldia1605
    @abdouldia1605 4 роки тому +1

    Nice video. Thanks Rahul. I was wondering how I could apply this when I do have different locations, each one has 4 environments (QA1...QA3, Prod) and different versions could be deployed differently in each location+environment?

    • @RahulNath
      @RahulNath  4 роки тому +2

      This is the purpose of the release management and adding different stages in the release pipeline. So in your case you will have multiple stages QA1,...QA3, Prod etc. You can set triggers to deploy to these as manual and choose while build to deploy to each of these environments. Ideally you would have a Dev or CI environment where all builds get automatically deployed and from then on you can manually promote each release across the environments. Not all builds need to be released to every environment. So you might have 10 releases in CI environment out of which a couple of them gets promoted to QA and then maybe the final one to Prod.
      Here is a follow video to the current one where I add a new Stage to deploy to a Linux Web app for the same application ua-cam.com/video/HLhlKIIfaZs/v-deo.html
      Let know if you have any further questions.

  • @anirudhtalluri2798
    @anirudhtalluri2798 2 роки тому

    Hey Rahul,how to get folder path which is inside wwwroot for a linux web app in azure variables?

    • @RahulNath
      @RahulNath  2 роки тому

      What are you trying to achieve? I usually look at the logs to see the folder paths etc.

    • @anirudhtalluri2798
      @anirudhtalluri2798 2 роки тому

      @@RahulNath trying to achieve path from Linux web app eg: home/Output,here Output is the folder which I added,wanted to use this path in pipeline variables so how we can use?

  • @dsosys
    @dsosys 2 роки тому +1

    Thanks... subscribed...

  • @harishkolanu
    @harishkolanu 4 роки тому

    how can we change Agent.ReleaseDirectory path.. i want to deploy in custom directory. how to change default variables path

    • @RahulNath
      @RahulNath  4 роки тому

      Sorry, which step are you referring to?

    • @harishkolanu
      @harishkolanu 4 роки тому

      @@RahulNath i have one azure repo, my entire code deploy into custom directory in one of the agent. by default it will depoy into agent directory means Agent.ReleaseDirectory default variable path, how to change default Release Directory?

    • @RahulNath
      @RahulNath  4 роки тому

      Sorry missed replying to this comment.
      Usually when I build the packages I put it in the required folder structure, so when I deploy to the root of a server it has the required structure by default. I have used this technique in thsi video, where I deploy Azure Web Jobs and it requires it to be in a specific folder structure. ua-cam.com/video/HXZWvobMbo0/v-deo.html
      Let know if that answers your question.

  • @mothukurikrishnachaitanya2911
    @mothukurikrishnachaitanya2911 2 роки тому

    Hi Rahul,
    I have web config files for different environments, some values may change for next environments
    How can i change web config values while release pipeline to production

    • @RahulNath
      @RahulNath  2 роки тому

      For each environment you can use different configuration as I show in this video? Is it something else you are looking for? Also check this article if that helps www.rahulpnath.com/blog/handling-application-configuration/

  • @abhi13091985
    @abhi13091985 4 роки тому

    Nice video but i didnt understand how the pipeline variables passed down to the application and replace them. Since I am from java background, i didnt understand how using same variable names used in appsettings.json replaces the variable values.
    I want to achieve something similar in my springboot app. if I establish the analogy, if i user some variable in spring property file "abc" and use same variable name in my release pipeline then it would be replaced after release pipeline?

    • @RahulNath
      @RahulNath  4 роки тому

      Thank you. Variables are getting transformed in the release step using Variable transformation. You can read more about it here -docs.microsoft.com/en-us/azure/devops/pipelines/tasks/transforms-variable-substitution?view=azure-devops&tabs=Classic
      Yes, that is correct, this works for any app (including spring boot app). All it looks for is the file and matching variable names.
      Let me know if that helps.

  • @bryanfatjo3188
    @bryanfatjo3188 3 місяці тому

    Good content
    👍

  • @gauravjoshi5054
    @gauravjoshi5054 4 роки тому

    Infomative Rrahul.👍 Do you have any video on Output variable in devops..?

    • @RahulNath
      @RahulNath  4 роки тому

      Thanks Gaurav. Nothing on Output variable. Are you looking for anything in specific/stuck with anything?

  • @ohadsafra3969
    @ohadsafra3969 4 роки тому

    what if i want to set a value in stage 1 and use it in stage 2?

    • @RahulNath
      @RahulNath  4 роки тому +1

      Can you please provide more details on what you are trying to do ? If you want to reuse variables set it to Release scope and not to a particular stage

    • @ohadsafra3969
      @ohadsafra3969 4 роки тому

      @@RahulNath
      i need to create a Path for a release folder on Stage 1, and use this Path on Stage 2.
      i tried using Environment vars,
      on Stage 1 -
      [Environment]::SetEnvironmentVariable("VarName", $val, [EnvironmentVariableTarget]::Machine)
      on Stage 2-
      $rootPath = [Environment]::GetEnvironmentVariable("VarName", [EnvironmentVariableTarget]::Machine)
      thing is, i need "VarName" to be unique per Release and the same in both Stages. tried using Release.Variables, but none of the works the way i want.
      and as you said, pipline variables are set to Release scope. but assignment on stage 1 will not show on stage 2.

    • @RahulNath
      @RahulNath  4 роки тому

      ​@@ohadsafra3969 This blog post here walks you through this kind of a scenario if you haven't come across it already
      stefanstranger.github.io/2019/06/26/PassingVariablesfromStagetoStage/
      Let me know if that helps.
      Between, how are you generating the $val for the VarName? If it's something you can derive from the pipeline variables, like say using the BuildId, etc, to make unique, that might be a possible way as well.

  • @jagkoth
    @jagkoth 4 роки тому

    Hey Rahul can you tell me how to pass this variable dynamically using Azure CLI ?

    • @RahulNath
      @RahulNath  4 роки тому

      Can you provide more details on what you are trying to do? Are you invoking the devops release using the azure cli? what commands are you using for that?

    • @jagkoth
      @jagkoth 4 роки тому

      @@RahulNath yes I am trying to deploy arm template through ado. Am looking for a solutions to trigger a build and dynamically inject variable parameters.

    • @RahulNath
      @RahulNath  4 роки тому +1

      I have a video here on ARM templates and how to configure it in Azure DevOps. ua-cam.com/video/3IRwtbGlshk/v-deo.html
      Can you check and let know if that answers your question. If not feel please let know.

    • @jagkoth
      @jagkoth 4 роки тому +1

      @@RahulNath Great Session though. Appreciate it.

    • @jagkoth
      @jagkoth 4 роки тому

      @@RahulNath ​ Great Session though. Appreciate it. I am still looking solution on how to inject variable dynamically through CLI in build stage itself. so that I dont want to use any 3rd party tools. my req is simple, I have various templates, right now I am manually editing parameters and triggering release pipeline through cli. what I need is how to override the values during build and trigger the latest artifact.

  • @arupnaskar3818
    @arupnaskar3818 2 роки тому

    Excellent sir,
    Thank u for providing great tutorials...
    Sir, I am stuck in release process where prod adf pipelines are having different triggers(schedule, event based).. And if I do release I need to disable them first.. which I really don't want .. please, give a suggestion to overcome this 💐🍁🧚

    • @RahulNath
      @RahulNath  2 роки тому

      I am guessing you are having those triggers in place for a reason? I am not sure if there is a way to manually trigger the pipeline but there are some workarounds in here if that matches your need stackoverflow.com/questions/58667596/manual-trigger-on-azure-pipelines-stages-yaml
      Let me know if that helps.

    • @arupnaskar3818
      @arupnaskar3818 2 роки тому

      Hi @@RahulNath thank u for replying 💐.. the requirement is little different...
      I was referring to azure Adf pipeline triggers not the devos release trigger..
      I mean if I do a release from Dev to Prod ..
      All the existing triggers in azure adf prod pipelines need to disable 1st and then the Arm template can deploy and then I can start the triggers .. Now this process generally taking 40 min so, during this 40 min my all production azure adf pipeline triggers were Disabled ...
      So, is there any way to avoid this disabling existing azure adf pipeline triggers!!.. please, suggest will be really grateful 🙏🙏

  • @Upendra_Sai
    @Upendra_Sai 3 роки тому

    Thanks Rahul for the video.
    I was facing issues when I was trying to trim $Release.Deployment.Starttime Variable. I want the variable value to be only date without timestamp so I will be able to create a directory by using this trimmed variable value. I tried shell scripting/Cmd tasks in release pipelines nothing is working out. Will you be able to help me out in this!

    • @RahulNath
      @RahulNath  3 роки тому +1

      Maybe this stackoverflow.com/questions/25917637/create-folder-with-current-date-as-name-in-powershell
      Let me know if that helps.

    • @Upendra_Sai
      @Upendra_Sai 3 роки тому

      @@RahulNath Thanks Rahul, With this I was able to create the directory in the required formate but how do I assign this directory value to a variable in Release Pipeline. By using classic editor(without yaml) while creating a variable in Release Pipeline intially I was assigning Null value to it. Later I was unable to modify value of the variable!

  • @abdullanalappad4997
    @abdullanalappad4997 3 роки тому

    Thanks Rahul for the video. I'm trying to deploy my web app on to an Azure VM with the pipeline variables however the variables appear to be empty when the app runs. Do you know if it works with VM as well? Or could you offer any kind of help to get this working? Thanks!

    • @RahulNath
      @RahulNath  3 роки тому

      Glad you liked it Abdulla. I had done a video on deploying to VM here using custom agents. ua-cam.com/video/uSEx5QiuOCw/v-deo.html
      Does that help you? Let me know in case not.

    • @abdullanalappad4997
      @abdullanalappad4997 3 роки тому

      @@RahulNath Thank you for the response. Much appreciated. I watched the linked video. Great job explaining the desktop pipeline.
      My scenario appears to be different. My app is built on asp.net core (.net 5) & I'm trying to deploy the app on to IIS on an Azure VM. Should I be creating additional tasks to add the release variables to IIS environment variables? If yes, do you have any tutorial for that? Also how the release variables are fetching without any extra tasks/steps in this "Azure DevOps: Release Variables" tutorial? Is that because you are using AppService? Or do you have a File Transform task for json file (eg: appsettings.json)? Any help on this regard would be very much appreciated. Thanks a bunch!

    • @RahulNath
      @RahulNath  3 роки тому +1

      @@abdullanalappad4997 Yes it is because of the built-in file transform task as part of the App Service. If that does not exist for the task you are using you can explicitly replace it before releasing like I do here ua-cam.com/video/uSEx5QiuOCw/v-deo.html
      Let me know if that helps.

    • @abdullanalappad4997
      @abdullanalappad4997 3 роки тому

      @@RahulNath Yes that indeed helps. I used a "File Transform" task and that worked. Thanks a bunch. Keep up the good work with the amazing and concise tutorial.
      It's great that you just stick to the point and get going clearly & smoothly. Thanks again!

    • @RahulNath
      @RahulNath  3 роки тому

      @@abdullanalappad4997 Awesome that's cool. Glad you sorted it out!

  • @robertgreen5333
    @robertgreen5333 4 роки тому +3

    Thanks so much bro!!! Do you have an email, I have a project I'd like to see if you would like to work on.

    • @RahulNath
      @RahulNath  4 роки тому

      Glad that it helped. Yes, my contact details are in the about page and here www.rahulpnath.com/about.

  • @User67578
    @User67578 2 роки тому

    Thanks

    • @RahulNath
      @RahulNath  2 роки тому

      Welcome Vipin. If you are building applications on Azure check out 5 Ways to Handle Application Configuration & Secrets With Azure 🔐
      www.rahulpnath.com/blog/handling-application-configuration/

  • @My_Rythm
    @My_Rythm 2 роки тому

    Please smile while speaking.. It's so dull

    • @RahulNath
      @RahulNath  2 роки тому

      Thank you for the feedback Kshitij - trying to work on my camera presence 🙂