Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure Resource Group Deployment task can't handle space in parameter override value #4864

Closed
gregjhogan opened this issue Jul 25, 2017 · 4 comments
Assignees

Comments

@gregjhogan
Copy link
Contributor

I am trying to pass a SQL connection string from a variable into a template override parameter for the Azure Resource Group Deployment task v2.* and the connection string has a space in the value.

image

I get this error when the deployment executes

2017-07-24T06:28:31.3651327Z ##[debug]Overriding Parameters..
2017-07-24T06:28:31.3651327Z ##[debug]Overriding key: pfxBlob
2017-07-24T06:28:31.3651327Z ##[debug]Overriding key: ConnectionString
2017-07-24T06:28:31.3651327Z ##[debug]Overriding key: 
2017-07-24T06:28:31.3661320Z ##[debug]There was an error while overriding '' parameter because of 'TypeError: Cannot read property 'type' of undefined'.

If I take the space out of the SQL connection string the issue goes away. Even though I was able to work around this (change "User ID=..." in my connection string to "UID=..."), but it seems like a bug.

@thesattiraju
Copy link
Contributor

Enclose the value in quotes, if it has spaces.
You should supply parameters in override parameters as -ConnectionString "$(ConnectionString)".

This is because, the agent upon execution replaces the $(ConnectionString) with the actual value.
For example, if your connectionString was "abc def" the string we receive upon execution would be
-ConnectionString abc def. Our parser would consider abc and def to be 2 different literals and we end up assigning only the first literal to this key. Upon execution, the value of the connectionString would be only abc when you're expecting abc def. When you enclose it within quotes, abc def would be treated as a single literal.

@gregjhogan
Copy link
Contributor Author

@dm-ms I tried putting single quotes around it and the single quotes went into the value. Are double quotes handled differently than single quotes?

@thesattiraju
Copy link
Contributor

Yes. We only assume double quotes for strings; Although this is a use case we can take care of in the task. But it's not handled as of now.

@gregjhogan
Copy link
Contributor Author

I think how it works now is ridiculously confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants