DEV Community

Joe Glombek
Joe Glombek

Posted on • Originally published at joe.gl on

Azure DevOps Pipelines breaks my "additional arguments" when using Deploy to Azure

Recently, something in the Azure DevOps Pipelines "Deploy to Azure" flow has been messing up parameters in the "additional arguments" field under "Additional Deployment Options".

We historically had parameters to skip the umbraco and umbraco_client folders:

-skip:objectname=filePath,absolutepath="\\(umbraco|umbraco_client)\\" -skip:objectname=dirPath,absolutepath="\\(umbraco|umbraco_client)\\"

Enter fullscreen mode Exit fullscreen mode

However, somewhere along the lines, this was being corrupted to produce the following command:

msdeploy.exe [...] -skip:objectname=filePath,absolutepath="\\\(umbraco|umbraco_client)\\" -skip:objectname=dirPath\,absolutepath=\\(umbraco|umbraco_client)\\

Enter fullscreen mode Exit fullscreen mode

And thus, the error:

##[error]Error: 'umbraco_client)\\' is not recognized as an internal or external command, operable program or batch file.

Enter fullscreen mode Exit fullscreen mode

It looks like Pipelines is doing some of the work to escape backslashes (\) and double quotes (") itself but getting confused, removing some, and adding them back in all the wrong places!

We tried various variations of removing and escaping with different characters, trying to reverse-engineer what Pipelines was doing to our simple text string until Fernando suggested removing the (required) quotes altogether, which worked!

Additional arguments:

-skip:objectname=filePath,absolutepath=\\(umbraco|umbraco_client)\\ -skip:objectname=dirPath,absolutepath=\\(umbraco|umbraco_client)\\

Enter fullscreen mode Exit fullscreen mode

Generated command:

msdeploy.exe [...] -skip:objectname=filePath,absolutepath="\\(umbraco|umbraco_client)\\" -skip:objectname=dirPath,absolutepath="\\(umbraco|umbraco_client)\\"

Enter fullscreen mode Exit fullscreen mode

If anybody has any further insight into this, please do to get in touch via social media - I'd love to expand on the details here.

Top comments (0)