How to pass Azure Storage connection string to Container Instance - azure-container-service

I have an application that uses Azure Storage Tables that I would like to run in an Azure Container Instance. The Container Instance environment variables (my only option for passing configuration to the application running in the container) only allow alphanumeric and underscores in the quoted string values, and a connection string has things like semicolons and equals. I thought a Key Vault would work, but then I can't pass an application ID either. I can't pass:
Connection String
URL
AppID - UUID
base64 data
The only thing I can even think of would be to encode these strings to bytes (UTF-8) and convert the bytes to a hex string, but that's a messy workaround. What is the recommended means of passingconfiguration to an Azure Container Instance?

Update 11/6: We've updated the Azure portal to be more lenient on env var input so strings with special characters like connection strings should work now. Thanks!
This is currently a constraint of the Azure portal. Please try this deployment via az cli, which should support special characters in env var values.

Related

ms sql connection string with semi colon in password failing to connect

Am working on anypoint studio 6.6.8 with runtime 3.9.4EE.
I have the following mssql generic database connection string.
jdbc:sqlserver://ABC.org:59000;databaseName=master;username=nrp;password=*37n%3b#wu;5r:;_1z~(f{1y{j
Test connection gives me the following error:
Test connection failed:
org.mule.module.db.internal.domain.connection.ConnectionCreationException: Cannot get connection for URL jdbc:sqlserver://ABC.org:59000;databaseName=master;username=nrp;password=<<credentials>>;5r:;_1z~(f{1y{j: The connection string contains a badly formed name or value
PS: I have 2 semi colons in password
I have seen similar question raised here earlier a few times, hence my question might look repetitive.
however I tried the following solutions given in the replies. none of them worked. Please let me know if you have any alternate solution.
Enclosing the password in single quotes.
adding \ in front of ;
Enclosing password within double quotes or {}
Am not the admin hence removing ; from password cannot be done.
The connection string is in a format known as JAVA JDBC URL. It is similar to a normal URL. Many characters are not allowed in URLs and have to be encoded with the URL encoding method. Try using URL encoding for the entire URL. You can do it with most languages or online pages, though you might want to avoid public pages for sensitive information like passwords.
Example in Groovy: https://stackoverflow.com/a/10187493/721855.
Example in Python: https://stackoverflow.com/a/5607708/721855.
Thank you #aled
So the {} did work. I was doing it the wrong way.
I was encrypting the password & later concatenating {} to the decrypted password right b4 passing the connection string.
What worked was that I enclosed the password in {} first & then encrypted it.

Update secret parameter in Jenkins Job

I have a lot of free-style jobs in my Jenkins instance. I create them with Jenkins API (generate XML-file with configuration and post them by "http://my-jenkins-instance:8080/createItem?name=JobName").
There is one problem - I can not generate value in secret fields. For example, I want such a config:
Inject passwords to the build as environment variables -> Job passwords.
And I need to set 123 to Password field.
I can not do this through XML because it appears decoded in XML. Something like this: {AQAAABAAAANwHq0hsSF6...}
I want to set the value to this parameter
So my questions are:
Can I get the decoded value of a plain password through some API? So I could send 123 and get {AQAAABAAAANwHq0hsSF6...} back.
If not, can I set secret value some other way? I can only think of using Selenium but it is too slow (comparing to API).
I have found the solution.
I can set the value as a plain text: <value>123</value>, create or update a job. Then I need to disable and enable the job.

What is available for Roundhouse Token Replacement?

We're using Roundhouse to deploy our databases and keep versions for SQL Server (2008+)
I have a script which grants permissions and needs to have a username passed in. I know there is support for token replacement in Roundhouse, but the only token I've seen mentioned is {{database}}.
What built-in tokens are available?
Can users define their own tokens? Is so how?
At this time ONLY the items in the configuration - https://github.com/chucknorris/roundhouse/wiki/ConfigurationOptions
Note the full name of the option when using token replacement:
-d, --db, --database, --databasename=VALUE | REQUIRED: DatabaseName - The database you want to create/migrate.
-c, --cs, --connstring, --connectionstring=VALUE | REQUIRED: ConnectionString - As an alternative to ServerName and Database - You
can provide an entire connection string instead.
It's the bolded name, e.g. "{{DatabaseName}}" or "{{ConnectionString}}" from the examples above.

Passing multiple values between ThreadGroups - Jmeter

I have ThreadGroup1 which performs login operation where it is getting Credentials from CSV file using CSV Dataset Config and saves username and password in two different variables like:
${__setProperty(USERNAMEGlobal, ${USERNAME})}
${__setProperty(PASSWORDGlobal, ${PASSWORD})}
Now in ThreadGroup2 I use these credentials using:
${__property()}
it works fine for a single user, but if I try multiple users (requests) last value overrides the previous all values and ThreadGroup2 receives only the last credentials defined.
I want all the credentials to be passed one by one to ThreadGroup2 and then the requests present in ThreadGroup2 should work according to all those credentials respectively.
How this can be done?
PS: I defined ramp-up period=1, Number of Users=3, loop=1.
There are some options:
Inter-Thread Communication.
Put them to different properties:
${__setProperty(USERNAMEGlobal1, ${USERNAME1})}
${__setProperty(USERNAMEGlobal2, ${USERNAME2})}
etc.
Initialize array with all usernames, stringify it and then put to property. However, it looks like a hack that will slow your plan.
Looks like you can save all the username-password pairs into file csv-file in ThreadGroup1 and then re-use they in ThreadGroup2 via e.g. reading with CSV Data Set Config.
I'm wondering if you really need two separate ThreadGroups?
It seems like you need only one ThreadGroup inside which you should perform your login actions and then save user/pass parameters in vars, not in props. Vars are thread local, so values of one thread won't override values of another.
You can set variable within the script: vars.put("var_name", "var_value"), and then use it like ${var_name}. Another option to set variable.

Insert chinese using odata client to azure sql

I am using azure aql as a backend for a windows phone app I am writing. I expose the db using odata protocol, and using the odata client library to read and write db. I am having a problem to insert Chinese strings. Each chinese charatcter will show up as "?" in the db.
The following is the code. Using the debugger, i can tell, the chinese character is still in the write format before the BeginSaveChanges call. The according field in the db is defined as nvarchar. I can put chinese no problem from the web management portal.
NewJoke.Title = Regex.Replace(NewJoke.Title, "'", "''");
NewJoke.Content = Regex.Replace(NewJoke.Content, "'", "''");
dsc = new DataServiceContext(funnyJokesUri);
try
{
//Name of the entity goes into the first attribute of the AddObject method followed by the entity itself
//INSERTING
dsc.AddObject("Jokes", NewJoke);
dsc.BeginSaveChanges(insertJoke_Completed, dsc);
}
You have to set the collation for Chinese on the column, I think. More... http://blogs.msdn.com/b/sqlazure/archive/2010/06/11/10023650.aspx
BTW -- I wasn't clear on reading your question -- it sounds like you're saying the db stores the chinese fine when you use the web portal to insert it; but presumably, it does not store the chinese when you use some other method for inserting it. (?) Is that what you're saying?