Showing posts with label Environment Variables. Show all posts
Showing posts with label Environment Variables. Show all posts

Wednesday, 2 December 2020

Azure Service Connection via Variable Group in YAML CD/Release Pipeline Templates

In application deployment we may use different Azure subscriptions to setup infrastructure for non-prod and production environment infrastructure most of the time. In classic release pipelines we could easily create a resource group to setup deployment task needs, which should be used in multiples stages/environments such as Dev, QA, staging or production. For such groups when the task group is using Azure App Service Deployment, Azure CLI tasks we could supply the service connection name via a variable that can be stored in a variable group relevant to the given stage/environment scope. In YAML we can use a template to define the common steps and it is ideal if we could refer to variable group, to hold the service connection information related to the relevant stage/environment. However, the possibility to use the variable group variable for service connection, regardless of whether using a template in YAML or Azure deploy steps used directly in pipeline YAML seems to be not working as expected. Let’s look at the problem and alternative solutions.

Tuesday, 28 June 2016

Environment Variables & TFS 2015 Build/Release Agents

If you install additional software in build server, or in a target server setup as a release server with build/release agent TFS 2015, you might run into the same issues specified below, which can be solved very easily.

The requirement

Need to run python and sphinx to generate documentation in the build server with the project.

The Issue

2016-06-28T08:56:24.4848312Z ##[error]The system cannot find the file specified.
2016-06-28T08:56:24.5316991Z The 'sphinx-build' command was not found. Make sure you have Sphinx
2016-06-28T08:56:24.5316991Z installed, then set the SPHINXBUILD environment variable to point
2016-06-28T08:56:24.5316991Z to the full path of the 'sphinx-build' executable. Alternatively you
2016-06-28T08:56:24.5316991Z may add the Sphinx directory to PATH.
2016-06-28T08:56:24.5316991Z If you don't have Sphinx installed, grab it from
2016-06-28T08:56:24.5316991Z http://sphinx-doc.org/

image

Checked environment variables for the build agent user and all were fine. All required python environment variables were there.image

But when printed the path in the powershell script running the command to generate help, it seems environment variable path, were not having python paths.image

The fix

It is just need a restart to build agents to reload environment variables.image

This was an easy fix, but many times it can be missed, and would waste time investigating many other options.image

Popular Posts