Pull and Run a Linux docker image on an azure pipeline - azure

When pulling and running a Linux docker based image in AZURE PIPELINE, I get this error:
"image operating system "Linux" cannot be used on this platform"
I create a Linux docker image
I pushed the image to azure registry
I setup the azure pipeline as follow:
Docker CLI
Azure CLI:
I login to registry
Command Line:
I do: docker pull image
I do: docker run -it image
When I run the pipeline, I get this error:
"image operating system "Linux" cannot be used on this platform"
Script output:
2019-03-25T21:23:03.4513990Z ##[section]Starting: Command Line Script
2019-03-25T21:23:03.4616971Z ==============================================================================
2019-03-25T21:23:03.4617284Z Task : Command Line
2019-03-25T21:23:03.4617442Z Description : Run a command line script using cmd.exe on Windows and bash on macOS and Linux.
2019-03-25T21:23:03.4617592Z Version : 2.146.1
2019-03-25T21:23:03.4617715Z Author : Microsoft Corporation
2019-03-25T21:23:03.4618046Z ==============================================================================
2019-03-25T21:23:04.8241638Z Generating script.
2019-03-25T21:23:04.9020040Z ##[command]"C:\windows\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "D:\a\_temp\157d3a61-fe5f-46b2-b74e-1082d4532014.cmd""
2019-03-25T21:23:05.7814076Z v1: Pulling from hubb-api-tests
2019-03-25T21:23:06.2370457Z image operating system "linux" cannot be used on this platform
2019-03-25T21:23:06.2872386Z the input device is not a TTY. If you are using mintty, try prefixing the command with 'winpty'
2019-03-25T21:23:06.3934386Z ##[error]Cmd.exe exited with code '1'.
2019-03-25T21:23:06.4549404Z ##[section]Finishing: Command Line Script
I expect to be able to pull the image and run it on Azure DevOps pipeline since I tested the same steps on my local computer with no problems.
Thank you so very much

You can only achieve this using your own windows agent configured to allow to run linux containers on windows. hosted agents wont allow that.

Related

i am trying to use local power shell as cloud power shell (azure power shell vs local power shell )

i am new
I am trying to use local pc power shell to execute commands like on azure portal power shell.
enter image description here
in my local power shell
i can login to azure using az login.
az commands are running but i am trying to execute pg_dump --help but it say cannot recognize this command. but az commands are working fine.
enter image description here
on azure power shell cli
i can execute all the pg_dumb commands without issue.
please answer.
I think you need to install Azure CLI in order to use the same commands on local powershell:
https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-windows?tabs=azure-cli
you need to have also pg_dump and pg_restore command-line utilities installed.
pg_dump is not part of the Azure CLI but is a PostgreSQL client application.
Cloud Shell happens to have a lot of packages installed already (i.E. terraform) and apparently pg_dump.
If you want to use it locally on your client you might want to look at installing the corresponding client tools. Maybe this SO thread helps (if you are running Windows): How do I install just the client tools for PostgreSQL on Windows?

Azure CLI command on powershell is giving '"c:\\\"Program' is not recognized as an internal or external command,

Az CLI is working on windows cmd prompt but they i am trying to execute the same on powershell or ISE it is giving above message and then execute the command.
I guess you need to install
https://learn.microsoft.com/en-us/powershell/azure/new-azureps-module-az?view=azps-4.5.0&viewFallbackFrom=azps-2.6.0
as i see Azure CLI is already installed.

electron-winstaller throws The system cannot find the path specified. at Squirrel.Utility.<CreateZipFromDirectory>d__23.MoveNext()<---

I am trying to build a electron installer for windows platform in Azure DevOps. I have successfully ran the electron-package command with npm run build (look at my package.json). After that when I try to run the command to create the RELEASES, .msi, .exe and .nupkg files with electron-winstaller it throws an error saying:
The system cannot find the path specified.
at Squirrel.Utility.d__23.MoveNext()<---
The command that I executed was npm run create-installer-win which executes the command node build.js.
The build runs in a on-premises agent with windows server 2014.
Locally everything works fine.
Image of my build.js
Image of my package.json
enter image description here
The was with Squirrel.
My agent is running with NT AUTHORITY\System user which does not have permission to create the SquirrelTemp folder in %appdata%. When it try to create de folder in current folder it throws the error because it does not find the SquirrelTemp folder.
The solution I have found was to set a environment variable SQUIRREL_TEMP in the build pipeline with the value to %currentfolder%\SquirrelTemp and it works.
Thanks to https://github.com/Squirrel/Squirrel.Windows/issues/1081#issuecomment-340958128

Cannot install Azure Dev Spaces using cloud shell in AKS

When i run the below command in cloud shell.
az aks use-dev-spaces -g aksrgrp -n akscluster
I get the below error. Any help will be highly appreciated
You may be prompted for your administrator password to authorize the installation process.
/tmp/tmpy1vng2we/azds-linux-setup.sh: line 84: sudo: command not found
/tmp/tmpy1vng2we/azds-linux-setup.sh: line 112: sudo: command not found
[INFO] Failed to install dotnet core dependencies.
[INFO] You can manually install all required dependencies based on the following documentation:
[FATAL] https://www.microsoft.com/net/download/dotnet-core/2.1
Azure Dev Spaces CLI not installed properly. Visit 'https://aka.ms/get-azds' for Azure Dev Spaces.
The error shows why the issue happens. It cannot find the command azds. Because the cloud shell does not install the command tool. You can find all the command tools installed in the cloud shell here.
I suggest you can install the tool which you need in the Azure VM of the azure Kubernetes, if you do not find the tool what you want.
It's a better way for you. By the way, the Cloud Shell just enables access to a browser-based command-line experience built with Azure management tasks in mind. So install the Azure CLI in the VM is a better experience.
To add to Charles's answer: the Azure Dev Spaces CLI currently does not support running in the Cloud Shell. Its functionality is designed more for running on your local dev machine where you application's source code is.

How to install azCopy on linux in vsts online build task?

My goal is, on hosted linux preview, copy built/archived zip file to azure storage file system.
On Hosted linux preview , I would like to copy build archive (single zip file) from VSTS build to azure storage file using azCopy. I've tried both flavors of instructions for install for linux. Both fail with
2018-05-06T23:59:51.7967023Z 2018-05-06 23:59:50 (53.5 MB/s) - ‘azcopy.tar.gz’ saved [68428738/68428738]
2018-05-06T23:59:51.7975469Z
2018-05-06T23:59:52.8481973Z ./install.sh: line 20: rsync: command not found
Everything before and after this error is correct. How do I install azCopy into Hosted linux preview.
The build task runs a script. The variables in the script echo correctly.
EDITS :
When I try to use the command line to use azCopy directly, I get
******************************************************************************
Starting: Run azCopy
******************************************************************************
==============================================================================
Task : Command Line
Description : Run a command line with arguments
Version : 1.1.3
Author : Microsoft Corporation
Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613735)
==============================================================================
Failed which: Not found azCopy: null
undefined failed with error: Failed which: Not found azCopy: null
******************************************************************************
Finishing: Run azCopy
******************************************************************************
The azCopy is available on Hosted linux preview agent, so call azcopy command directly (e.g. Command line, azure cli tasks)

Resources