Thursday, 6 December 2018

Draft Pull Request in Azure Git Repos

Pull Request are the controlled way to bring in the changes to your stable branches in your Azure Git repos, or for that matter all Git providers support Pull Requests. In Azure DevOps now you can create Pull Request as a draft so that it is giving the ability to developers to getting it ready and prevent it from being completed accidently by the reviewers. Let’s look at simple steps involved in creating Pull Request as a draft in Azure Repos.

Monday, 3 December 2018

Steps to View Dashboard of Azure Kubernetes Cluster When RBAC Enabled

Azure Kubernetes Services offers you to host your containerized applications in Kubernetes without having to worry about getting the Kubernetes cluster infrastructure setting up and maintenance. Dashboard in Kubernetes helps you to monitor the status of services deployed as well as deployment states and health of the cluster etc. Let’s look at the steps required to perform to access the Kubernetes Dashboard once you have the Azure Kubernetes Service up and running with Role Base Access Control (RBAC) enabled.

Friday, 16 November 2018

Choosing Right Size for Windows 10 VM in Azure to Run Docker

The post “Setup Windows 10 VM in Azure to Develop with Docker CE” has a detailed walkthrough on setting up Docker CE in Azure VM, which is using Windows 10. While trying out the same, encountered an issue to start the Docker giving error message “Failed to start the virtual machine 'MobyLinuxVM' because one of the Hyper-V components is not running. 'MobyLinuxVM' failed to start.” It is interesting to inspect and find a fix to this issue.

Monday, 5 November 2018

Custom Control Conditions in Azure DevOps Pipeline Steps

Azure DevOps pipelines support default conditions allowing you to execute a step “Only when all previous tasks have succeeded”, “Even if a previous task has failed, unless the build was canceled”, “Even if a previous task has failed, even if the build was canceled” or “Only when a previous task has failed”. These conditions facilitate execution of  steps in a build or release pipeline to cater different scenarios. However, to support scenarios not covered by the default conditions you can implement custom control conditions in Azure DevOps pipeline steps. There is a good explanation of custom conditions in this article. Let’s explore two advance scenarios that can be handled with custom conditions, which are not explained in the article.

Tuesday, 23 October 2018

Inspecting Most Frequently Changed Files in Azure Git Repos

When analyzing an application with its telemetry data we would be looking at usage of the application, and would be able to identify which parts of the system is often used. Wouldn’t it be nice to compare that with the most frequently updated areas of the system? Let’s look at how we can get this information via Azure DevOps REST API.

Wednesday, 17 October 2018

Resigning and Deploying Xamarin iOS Apps with Azure DevOps

Creating iOS mobile application with Xamarin is a good option for developers who are familiar with Visual Studio family of products. Any project you create nowadays demand for CI/CD implementation as it is the first step towards enabling DevOps. Azure DevOps comes with feature rich set of tasks for building the iOS apps. Tasks that allows re-signing of packaged ipa (iOS deployment files) are available as Marketplace task. App Center allows you to do mobile application testing in much simpler way. Let’s look at steps required to resign and deploy iOS package to APP Center using Azure DevOps pipelines.

Monday, 1 October 2018

Azure DevOps Default Enabled Alert/Notification - Which Can be a Nightmare for an Admin

As an admin of an Azure DevOps account you may be creating sample environments to simulate production behaviors, before applying any process changes to a Team project. In this case your choice would be to create a new team project and try out a simulation first. However, you might want to do the simulation with close to production data, so you will try to find a mechanism to make a copy of work items etc. from your production to a simulation Team project. How to do this with various options available is not the discussion today (which we can discuss in another post), as this post  is to show you an alert that must be turned off, before you do any sort of work item data duplication as a bulk, to avoid spam emails to many users of your Azure DevOps account. A lesson learnt the hard way is shared with you to prevent you from falling to same pitfall.

Friday, 28 September 2018

Build and Deploy SSIS with Azure DevOps Pipelines

SQL Server Integration Services (SSIS) projects can be created to perform ETL (Extract Transform and Load) operations. As Implementing of Continuous Delivery becoming a mandatory aspect of any type of software project it is vital for SSIS projects to be able to implement CI/CD. With the availability of the extension “SSIS Build & Deploy” in Marketplace for Azure DevOps, the CI/CD implementation for SSIS has become straightforward to implement. Let’s look at a sample to understand how to get CI/CD implemented for SSIS project with Azure DevOps.

Monday, 17 September 2018

Making a Task Group Parameter Optional – Azure DevOps Pipelines

Task groups are really useful to share common actions with multiple build or release pipelines in Azure DevOps (VSTS). You can group multiple tasks ang create a task group forma build or release definition. then these task groups can be utilized in other build or release definitions in a given team project. Parameters in a task group help to pass values from build or release definition to the tasks in the task group. You can add a default value for these parameters or have to provide value from the build or release definition that is using the task group. Making a task group parameter optional is not straight forward and you need some do work around to get it working. Let’s look at how we can make a parameter optional for a task group in Azure DevOps pipelines.

Wednesday, 12 September 2018

Using Unified Agent for Executing Automated Tests Without Installing Visual Studio in Test Client–Azure DevOps/VSTS

As described in the post “Running UI Tests with Unified Agent” you can setup unified agent (same agent used for build/deployment in Azure DevOps/VSTS), in an application pool or in a deployment group to execute functional UI tests. The unified agent is really useful as it does not require to setup separate test agent using winRM based Deploy Test Agent task which is required if Run Functional Tests task is used for automated test execution.With unified agent you can use Visual Studio Test task, which is capable of running Selenium based UI tests as well, in addition to Coded UI tests. There was a dependency that you needed to have Visual Studio installed in the test client machine to get the Visual Studio Test task as it is packaged with Visual Studio. However, thanks to the NuGet package “Microsoft Test Platform”  you no longer need to install full Visual Studio in your test client machine to execute automated tests, with unified agent using Visual Studio Test task. Let’s look at how to use “Microsoft Test Platform”  and Visual Studio Test task in a test client using Azure DevOps Release Management.

Thursday, 6 September 2018

Getting Content of a File in VSTS Git Repo

GItHub has a easy way to get raw contents of a file by clicking on Raw button for any code file in GitHub, where it will redirect to url starting with ‘https://raw.githubusercontent.com/’. For example the PowerShell script here can be viewed as raw content or retrieved programmatically using PowerShell using Invoke-WebRequest with url  https://raw.githubusercontent.com/chamindac/VSTS_PS_Utils/master/CreateAzureWebApp/CreateAzureWebApp.ps1. Let’s look at possibility of retrieving raw content of a file in VSTS Git repo via VSTS REST API.

Tuesday, 28 August 2018

Check if a Build Definition Exists for a Given Repo in VSTS/TFS

In scenarios where you have many teams working in the same team project, you might have multiple TFS Git repos within a single team project. When you want to create a build definition for a given repo, you might be wondering what if there is a build definition already exists for the repo. Opening each build definition to find that out is a waste of time. Let’s look at a small utility script that can give you the information quickly using VSTS/TFS REST API.

Sunday, 26 August 2018

Values of repositoryType Parameter in VSTS REST API

VSTS REST API is really useful in achieving automations in many aspects of the software development process, and it can be used to write some handy utilities to obtain information quickly with appealing formats. However, sometimes you have to bit struggle to find out which are the correct values to pass for some parameters expected by VSTS REST API, where the documentation does not provide much of a valid information. One such parameter is ‘repositoryType’ in documentation found here for listing build definitions, which does not give any information what are the expected values for the parameter.Documentation here gives some hint on what could be the values but does not have information for REST API expected values.

Sunday, 19 August 2018

Setting VSTS Release Variable Values At the Time of Creating a Release

VSTS builds have the option to set build variable values at the time of queuing a build. You have to select option for build variable “Settable at queue time” to enable the variable to be set its value at the time of queuing  build. However, this feature was not available for VSTS Release and there was a user voice raised here requesting to allow setting release variables at the time of creating a release. As promised by MSFT, this feature is now available for VSTS Release. Let’s look at how to use it with VSTS web UI and with the VSTS REST API.

Wednesday, 8 August 2018

Developing Azure Functions in Visual Studio and Creating a Deployment Pipeline Using VSTS

Serverless computing has become a hot topic these days. It is providing you with paying only for the actual time your code is running and resources you are consuming without any worries about infrastructure. Azure functions let you build functions that can scale dynamically based on the needs, with a languages of your choice. When you install Visual Studio Azure Development workload you get templates for developing Azure Functions. Let’s look at how to create a simple Azure Function “Hello World” in Visual Studio and most importantly how to get your CI/CD pipeline ready within couple of minutes.

Thursday, 2 August 2018

Solving OutOfMemoryException and Getting NUnit Tests on Visual Studio Test Explorer

It is fun to work with latest tools and frameworks but sometimes errors are bit confusing and searching for fix is not that easy. One team worked with NUnit and .NET 471 and complaint that the when compiling they get outofmemory exception “ NUnit Adapter 3.7.0.0: Test discovery starting Exception System.OutOfMemoryException, Exception converting mytest” . Searching pointed to few links in GitHub issues as shown below but those workarounds seem to be not applicable as .NET framework change back to 462 is not an option.Fix was really simple but looking for a solution sometimes takes time. So let’s explore the problem and the simple fix.

Friday, 27 July 2018

Finding Membership Information of a User/Group/Team in VSTS/TFS

Managing permissions of a VSTS/TFS sometimes become a nightmare specially if you have many teams groups etc. created in your account and in team projects. It is important to have a way to find group membership of an individual or group, so that you can analyze where the memberships are assigned in order to make required maintenance or change permission activities. Lets look at a command which can help you find that information quickly.

Saturday, 14 July 2018

Controlling Octopus Releases with VSTS Release Management

You may be using Octopus deploy for your deployment automation pipeline needs while you are having your builds and work items managed in VSTS. It is a good idea to manage the Octopus release pipeline via VSTS release management so that you have the opportunity to use automated test execution and capturing of test results, as well as easily generate release notes using the VSTS work items, using feature rich tasks and automation test results views in VSTS release management. Let’s look at the important steps required to make VSTS release management to successfully utilize your existing Octopus deploy process steps.

Wednesday, 11 July 2018

Securing Release Definitions When Multiple Teams Work on a Single Team Project

We have explored “Securing Build Definitions When Multiple Teams Work on a Single Team Project” in a previous post. Now the folders to group release definitions and applying permissions to isolate each team’s release definitions is also a possibility in VSTS. As we discussed in the “Securing Build Definitions When Multiple Teams Work on a Single Team Project” it is important to create the Build/Release admins VSTS permission group for each of the teams in the team project. Using the same admins group and the team we can setup permissions for release definitions folders. Let’s look at the steps in detail.

Tuesday, 3 July 2018

Integrating VSTS Package Feed to Octopus

Octopus deploy is used by many organizations as their continuous deployment tool. You can send a package to Octopus deploy server via VSTS build or release step, using  “Push Packages to Octopus” task comes with VSTS Marketplace extension named Octopus integration. However, if you prefer to use VSTS Package Management to store your packages, you can now consume them in Octopus by integrating with the VSTS Package Management feed. Let’s look at how to setup Octopus to consume VSTS Package Management feed packages. (We have discussed how to use VSTS Package Management feed as artifact source in VSTS Release Management in a previous post “Using NuGet Packages as VSTS Release Artifact Source”)

Thursday, 28 June 2018

Building and Deploying Windows Services with VSTS/TFS

Generally windows services are deployed by creating an msi installer. It is possible to deploy msi via VSTS/TFS release management using the extension available in the marketplace. Packaging the windows as non msi would give opportunity to have more control on the configurations etc, when deployment and let’s see how to package a windows service and then get it deployed via VSTS/TFS release management.

Monday, 25 June 2018

Packaging "Assemblies in GAC Installed with SDKs" in Build and Getting Deployed to Target Machine GAC

There can be projects depending on assemblies in Global Assembly Cache installed with may be a internal company SDK, which would even be installed in developer machines and in build servers. These assemblies should be packaged with the project and deployed to the GAC of target machines such as QA,staging and Production etc.  as well. Since the code repo does not include such assemblies in the build server it may be required to extract those assemblies from GAC and packaged with the builds. Let’s see how we can get the assemblies in GAC packaged and get deployed to targets, using VSTS build and release management.

Friday, 22 June 2018

Using NuGet Packages as VSTS Release Artifact Source

If you are used to deploy your solutions with Octopus deploy which a re built with VSTS/TFS, you are used to package your build output as a NuGet package and use it in Octopus. Now you can use the NuGet packages with VSTS release management as well for deployment. For this you have to have the package management feature in VSTS enabled. As VSTS builds and their artifacts are discarded in a configured time period and the maximum time and  number of builds is limited, keeping artifacts as NuGet packages would be useful you to keep your deployed artifacts for a longer period. Let’s explore how to use NuGet packages for deployment in VSTS release management.

Monday, 28 May 2018

VSTS Build, node-sass and HTTP 404

When you are building node js projects with VSTS you may encounter some strange errors which are very hard to diagnose due to misleading error messages. node-sass and Http 404 error is one such error making it really hard to fix the issue misleading error message.

2018-05-28T02:44:19.0012193Z npm info lifecycle node-sass@3.13.1~install: node-sass@3.13.1
2018-05-28T02:44:19.0012339Z Cannot download "
https://github.com/sass/node-sass/releases/download/v3.13.1/win32-x64-57_binding.node":
2018-05-28T02:44:19.0012428Z
2018-05-28T02:44:19.0012528Z HTTP error 404 Not Found


2018-05-28T02:44:19.0012596Z
2018-05-28T02:44:19.0012713Z Hint: If github.com is not accessible in your location
2018-05-28T02:44:19.0012897Z       try setting a proxy via HTTP_PROXY, e.g.
2018-05-28T02:44:19.0012971Z
2018-05-28T02:44:19.0013081Z       export HTTP_PROXY=
http://example.com:1234
2018-05-28T02:44:19.0013160Z
2018-05-28T02:44:19.0013266Z or configure npm proxy via
2018-05-28T02:44:19.0013335Z
2018-05-28T02:44:19.0013442Z       npm config set proxy
http://example.com:8080
2018-05-28T02:44:19.0013573Z npm verb lifecycle node-sass@3.13.1~install: unsafe-perm in lifecycle true
2018-05-28T02:44:19.0014185Z npm verb lifecycle node-sass@3.13.1~install: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;F:\agent\_work\32\s\node_modules\gulp-sass\node_modules\node-sass\node_modules\.bin;F:\agent\_work\32\s\node_modules\gulp-sass\node_modules\.bin;F:\agent\_work\32\s\node_modules\.bin;F:\agent\externals\git\cmd;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramData\chocolatey\bin;C:\Users\svccor_phoenix\AppData\Roaming\npm;c:\tools\nuget;C:\Program Files\dotnet\;F:\agent\Microsoft.Data.Tools.Msbuild\lib\net46;C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Users\svccor_phoenix\AppData\Roaming\npm;c:\tools\ssdtbuild;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\Program Files (x86)\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;
2018-05-28T02:44:19.0014766Z npm verb lifecycle node-sass@3.13.1~install: CWD: F:\agent\_work\32\s\node_modules\gulp-sass\node_modules\node-sass

2018-05-28T02:44:19.6231401Z 38604 info lifecycle node-sass@3.13.1~postinstall: Failed to exec postinstall script
2018-05-28T02:44:19.6231571Z 38605 verbose unlock done using C:\Users\svccor_phoenix\AppData\Roaming\npm-cache\_locks\staging-ceadb4797f66e355.lock for F:\agent\_work\32\s\node_modules\.staging
2018-05-28T02:44:19.6231735Z 38606 warn s No repository field.
2018-05-28T02:44:19.6231846Z 38607 warn s No license field.
2018-05-28T02:44:19.6231973Z 38608 verbose stack Error: node-sass@3.13.1 postinstall: `node scripts/build.js`
2018-05-28T02:44:19.6232111Z 38608 verbose stack Exit status 1
2018-05-28T02:44:19.6232266Z 38608 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:280:16)
2018-05-28T02:44:19.6232742Z 38608 verbose stack     at emitTwo (events.js:126:13)
2018-05-28T02:44:19.6232869Z 38608 verbose stack     at EventEmitter.emit (events.js:214:7)
2018-05-28T02:44:19.6233040Z 38608 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
2018-05-28T02:44:19.6233187Z 38608 verbose stack     at emitTwo (events.js:126:13)
2018-05-28T02:44:19.6233312Z 38608 verbose stack     at ChildProcess.emit (events.js:214:7)
2018-05-28T02:44:19.6233456Z 38608 verbose stack     at maybeClose (internal/child_process.js:925:16)
2018-05-28T02:44:19.6233598Z 38608 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
2018-05-28T02:44:19.6233728Z 38609 verbose pkgid node-sass@3.13.1
2018-05-28T02:44:19.6233855Z 38610 verbose cwd F:\agent\_work\32\s
2018-05-28T02:44:19.6233975Z 38611 verbose Windows_NT 6.3.9600
2018-05-28T02:44:19.6234132Z 38612 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
2018-05-28T02:44:19.6234286Z 38613 verbose node v8.9.3
2018-05-28T02:44:19.6234393Z 38614 verbose npm  v5.5.1
2018-05-28T02:44:19.6234499Z 38615 error code ELIFECYCLE
2018-05-28T02:44:19.6234606Z 38616 error errno 1
2018-05-28T02:44:19.6234736Z 38617 error node-sass@3.13.1 postinstall: `node scripts/build.js`
2018-05-28T02:44:19.6234854Z 38617 error Exit status 1
2018-05-28T02:44:19.6234972Z 38618 error Failed at the node-sass@3.13.1 postinstall script.
2018-05-28T02:44:19.6235125Z 38618 error This is probably not a problem with npm. There is likely additional logging output above.
2018-05-28T02:44:19.6235254Z 38619 verbose exit [ 1, true ]

After investigating the issue for several hours and running the build and trying out options in below links did not help much.


Putting npm install task to provide verbose information helped to identify the possible cause of error which is linked to missing python files.

2018-05-28T02:44:19.0239281Z gyp verb check python checking for Python executable "python2" in the PATH
2018-05-28T02:44:19.0239410Z gyp verb `which` failed Error: not found: python2
2018-05-28T02:44:19.0239557Z gyp verb `which` failed     at getNotFoundError (F:\agent\_work\32\s\node_modules\which\which.js:13:12)
2018-05-28T02:44:19.0239714Z gyp verb `which` failed     at F (F:\agent\_work\32\s\node_modules\which\which.js:68:19)
2018-05-28T02:44:19.0239859Z gyp verb `which` failed     at E (F:\agent\_work\32\s\node_modules\which\which.js:80:29)
2018-05-28T02:44:19.0240001Z gyp verb `which` failed     at F:\agent\_work\32\s\node_modules\which\which.js:89:16
2018-05-28T02:44:19.0240149Z gyp verb `which` failed     at F:\agent\_work\32\s\node_modules\isexe\index.js:42:5
2018-05-28T02:44:19.0240290Z gyp verb `which` failed     at F:\agent\_work\32\s\node_modules\isexe\windows.js:36:5
2018-05-28T02:44:19.0240426Z gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:152:21)
2018-05-28T02:44:19.0240561Z gyp verb `which` failed  python2 { Error: not found: python2
2018-05-28T02:44:19.0240770Z gyp verb `which` failed     at getNotFoundError (F:\agent\_work\32\s\node_modules\which\which.js:13:12)
2018-05-28T02:44:19.0240927Z gyp verb `which` failed     at F (F:\agent\_work\32\s\node_modules\which\which.js:68:19)
2018-05-28T02:44:19.0241078Z gyp verb `which` failed     at E (F:\agent\_work\32\s\node_modules\which\which.js:80:29)
2018-05-28T02:44:19.0241221Z gyp verb `which` failed     at F:\agent\_work\32\s\node_modules\which\which.js:89:16
2018-05-28T02:44:19.0241362Z gyp verb `which` failed     at F:\agent\_work\32\s\node_modules\isexe\index.js:42:5
2018-05-28T02:44:19.0241508Z gyp verb `which` failed     at F:\agent\_work\32\s\node_modules\isexe\windows.js:36:5
2018-05-28T02:44:19.0241643Z gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:152:21)
2018-05-28T02:44:19.0241950Z gyp verb `which` failed   stack: 'Error: not found: python2\n    at getNotFoundError (F:\\agent\\_work\\32\\s\\node_modules\\which\\which.js:13:12)\n    at F (F:\\agent\\_work\\32\\s\\node_modules\\which\\which.js:68:19)\n    at E (F:\\agent\\_work\\32\\s\\node_modules\\which\\which.js:80:29)\n    at F:\\agent\\_work\\32\\s\\node_modules\\which\\which.js:89:16\n    at F:\\agent\\_work\\32\\s\\node_modules\\isexe\\index.js:42:5\n    at F:\\agent\\_work\\32\\s\\node_modules\\isexe\\windows.js:36:5\n    at FSReqWrap.oncomplete (fs.js:152:21)',
2018-05-28T02:44:19.0242632Z gyp verb `which` failed   code: 'ENOENT' }
2018-05-28T02:44:19.0242771Z gyp verb check python checking for Python executable "python" in the PATH
2018-05-28T02:44:19.0242910Z gyp verb `which` failed Error: not found: python
2018-05-28T02:44:19.0243049Z gyp verb `which` failed     at getNotFoundError (F:\agent\_work\32\s\node_modules\which\which.js:13:12)
2018-05-28T02:44:19.0243198Z gyp verb `which` failed     at F (F:\agent\_work\32\s\node_modules\which\which.js:68:19)
2018-05-28T02:44:19.0243343Z gyp verb `which` failed     at E (F:\agent\_work\32\s\node_modules\which\which.js:80:29)
2018-05-28T02:44:19.0243500Z gyp verb `which` failed     at F:\agent\_work\32\s\node_modules\which\which.js:89:16
2018-05-28T02:44:19.0243648Z gyp verb `which` failed     at F:\agent\_work\32\s\node_modules\isexe\index.js:42:5
2018-05-28T02:44:19.0243789Z gyp verb `which` failed     at F:\agent\_work\32\s\node_modules\isexe\windows.js:36:5
2018-05-28T02:44:19.0243933Z gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:152:21)
2018-05-28T02:44:19.0244060Z gyp verb `which` failed  python { Error: not found: python
2018-05-28T02:44:19.0244201Z gyp verb `which` failed     at getNotFoundError (F:\agent\_work\32\s\node_modules\which\which.js:13:12)
2018-05-28T02:44:19.0244356Z gyp verb `which` failed     at F (F:\agent\_work\32\s\node_modules\which\which.js:68:19)
2018-05-28T02:44:19.0244499Z gyp verb `which` failed     at E (F:\agent\_work\32\s\node_modules\which\which.js:80:29)
2018-05-28T02:44:19.0244641Z gyp verb `which` failed     at F:\agent\_work\32\s\node_modules\which\which.js:89:16
2018-05-28T02:44:19.0244796Z gyp verb `which` failed     at F:\agent\_work\32\s\node_modules\isexe\index.js:42:5
2018-05-28T02:44:19.0244944Z gyp verb `which` failed     at F:\agent\_work\32\s\node_modules\isexe\windows.js:36:5
2018-05-28T02:44:19.0245079Z gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:152:21)
2018-05-28T02:44:19.0245379Z gyp verb `which` failed   stack: 'Error: not found: python\n    at getNotFoundError (F:\\agent\\_work\\32\\s\\node_modules\\which\\which.js:13:12)\n    at F (F:\\agent\\_work\\32\\s\\node_modules\\which\\which.js:68:19)\n    at E (F:\\agent\\_work\\32\\s\\node_modules\\which\\which.js:80:29)\n    at F:\\agent\\_work\\32\\s\\node_modules\\which\\which.js:89:16\n    at F:\\agent\\_work\\32\\s\\node_modules\\isexe\\index.js:42:5\n    at F:\\agent\\_work\\32\\s\\node_modules\\isexe\\windows.js:36:5\n    at FSReqWrap.oncomplete (fs.js:152:21)',
2018-05-28T02:44:19.0245651Z gyp verb `which` failed   code: 'ENOENT' }
2018-05-28T02:44:19.0245779Z gyp verb could not find "python". checking python launcher
2018-05-28T02:44:19.0245997Z gyp verb could not find "python". guessing location
2018-05-28T02:44:19.0246134Z gyp verb ensuring that file exists: C:\Python27\python.exe
2018-05-28T02:44:19.0246273Z gyp ERR! configure error
2018-05-28T02:44:19.0246415Z gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
2018-05-28T02:44:19.0246574Z gyp ERR! stack     at PythonFinder.failNoPython (F:\agent\_work\32\s\node_modules\node-gyp\lib\configure.js:483:19)
2018-05-28T02:44:19.0246736Z gyp ERR! stack     at PythonFinder.<anonymous> (F:\agent\_work\32\s\node_modules\node-gyp\lib\configure.js:508:16)

Searching along that pointed to the GitHub issue here and using the command below before firing “npm install” in the repo folder using command prompt fixed the issue.

npm --add-python-to-path='true' --debug install --global windows-build-tools

But, when executing with the VSTS the error pops up again due to the user of the VSTS agent is not the same user that executed the above command manually. This could be fixed with the addition of command line step to build which execute the same command before the npm install. Once this additional npm command line “npm --add-python-to-path='true' --debug install --global windows-build-tools” run  it can be disabled from the build definition to save build time, as long as same agent is used for the build for next time.

UPDATE – 24 Oct 2018

If new version of node is installed make sure to run all of below commands before npm install.

npm rebuild node-sass
npm --add-python-to-path='true' --debug install --global windows-build-tools
npm install --global node-gyp

image

Tuesday, 22 May 2018

Securing Build Definitions When Multiple Teams Work on a Single Team Project

Securing a build definition is quite straight forward when an organization uses multiple team projects in VSTS/TFS to handle different applications they develop. Each team project build administration can be assigned to different individuals easily. There are organizations using a single team project to manage all of their applications, dividing them into teams inside a single team project. Let's look at possibilities of securing each application teams' builds in single team project for organization scenario.

Sunday, 29 April 2018

Visual Source Safe (VSS) to TFS Migration

In modern software development usage of only a source control mechanism would not add value to the software delivery process. However, some organizations still using Visual Source Safe (VSS) to manage their source code, but it is unsupported tool as of now and they should consider moving their code bases to a different tool. As a fully DevOps capable ALM tool TFS is a good choice to move the code from VSS. Let’s look at the steps required to perform such a migration of VSS code, including history.

Thursday, 12 April 2018

Finding Active Team Projects Based on Code CheckIns/Commits

When you have many team projects in your TFS instance or in your team services account (VSTS), manually finding out what are the active projects is not going to be an easy task, by looking at each code repository in each of the projects to determine whether project is getting updated with code changes. TFS/VSTS REST API can be used in this scenario to obtain the projects that have any code commits/checkins from a given date using the script available here.

Tuesday, 27 February 2018

Cloning TFS 2018

How to clone TFS before TSF 2018 is explained in posts, Backing Up and Restoring Databases, Prepare Restored Databases and Configuring the AT. Out of these steps Backing Up and Restoring Databases is valid for TFS 2018. But you do not have to perform the Prepare Restored Databases as it can be done while configuring the Application Tier of the cloned TFS instance. Let’s look at valid steps for cloning TFS 2018.

Thursday, 8 February 2018

Resolving “The SDK 'Microsoft.NET.Sdk.Web' specified could not be found”

While using .NET Core 2.0 you may run into errors which may not be clear. “The SDK 'Microsoft.NET.Sdk.Web' specified could not be found.” is one such error which appears, when trying to load .NET Core 2.0 Web projects, and Let’s understand the reason behind this error to get it resolved.

Monday, 8 January 2018

Wednesday, 3 January 2018

Trigger Build Based on Label/Tag – VSTS/TFS

You might want to trigger a build for a team foundation version control (TFVC) Label applied previously or if you are using Git version control for a Tag. Git tags are quite nicely supported in TFS/VSTS web Interface, but Label in TFVC is still only manageable with the  Source Control explorer of Visual Studio. There is a user voice request to enable web experience for TFVC Labels, which you can also vote for Smile. Let’s explore how to trigger build based on Tag or Label with VSTS/TFS.

Monday, 1 January 2018

Configure Search Service for TFS 2018 in a Separate Server to Enable Work Item & Code Search

Work Item Search & Code Search allow TFS users to do advanced and dynamic way of quick searching on code or work items, with drill down etc. To enable Code Search in VSTS you have to install the Marketplace extension for code search, work item search is default enabled for VSTS. You can configure search for on-premises TFS in TFS AT (described here), itself. But if you want to setup search service in a separate box from your TFS AT, you can follow the steps described in this post.

Popular Posts