question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AzureCLIV1 with variable values containing %X

See original GitHub issue

AzureCLIV1

When a variable value used in the inline script, contains %X it results in weird output.

Required Information

Entering this information will route you directly to the right team and expedite traction.

Question, Bug, or Feature?
Type: Bug

Enter Task Name: AzureCLIV1

Environment

  • Server - Azure Pipelines or TFS on-premises?

    • If using Azure Pipelines, provide the account name, team project name, build definition name/build number:
      • uniun
      • uniun
        • Uniun Website : 0.12.3-2-master
  • Agent - Hosted or Private:

    • If using Hosted agent, provide agent queue name: windows-latest

Issue Description

I use this task in a classing Release pipeline with the following inline script:

az webapp config appsettings set --name foo --resource-group foo --slot-settings Foo="$(foo)" 
Bar="$(bar)"

There are two variables there (I actually use a lot more but I have shortened for brevity).

When the value of $(foo) contains %X I see weird output. So suppose the value of $(foo) is “Hi%X” I then see this as the final az cli call being made:

az webapp config appsettings set --name foo --resource-group foo --slot-settings Foo="HiOTHER VARIABLE VALUES HERE"

In this case the value I am setting is a password, so it does contain symbols and in this case it happens to contain %X which is breaking the script.

Task logs

[Enable debug logging and please provide the zip file containing all the logs for a speedy resolution]

Troubleshooting

Checkout how to troubleshoot failures and collect debug logs: https://docs.microsoft.com/en-us/vsts/build-release/actions/troubleshooting

Error logs

[Insert error from the logs here for a quick overview]

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
anuragc617commented, Jun 29, 2020

@dazinator AzureCLIV1 uses batch files, so to escape them you can follow esacping guidelines for batch. I found this link useful for escaping batch files. For escaping % you need to give %%. You can also use AzureCLIV2 that supports various scripting languages. There also you will need to escape based on the language selected

0reactions
dazinatorcommented, Aug 6, 2020

I’ll create a new issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Class Notes: Variables and Functions
A variable is a named value that references or stores a piece of data. # we put a value in a variable using...
Read more >
How Do You Find f(x) When the Value for x Contains Other ...
See how to plug an expression with variables into a function! This tutorial will show you! ... Every see 'f(x)' in your math?...
Read more >
13 Functions and expressions - Stata
Missing values may appear in relational expressions. If x were a numeric variable, the expression x>=. is true if x is missing and...
Read more >
Display value of variable - MATLAB disp - MathWorks
This MATLAB function displays the value of variable X without printing ... If a variable contains an empty array, disp returns without displaying...
Read more >
How can I subset a data set? | R FAQ - OARC Stats - UCLA
The data frame x.sub2 contains only the variables V1 and V4 and then only the observations of these two variables where the values...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found