Hi guys,
I'm working with a Power Automate flow and am trying to send a private key retrieved from an Azure Key Vault in an HTTP request. However, the private key includes newline characters (represented as \n
), and when I pass it through the HTTP request, Power Automate automatically escapes these newline characters (turning \n
into \\n
). I want to ensure that the key remains unchanged and the newlines are preserved as they are.
Example:
"-----BEGIN ENCRYPTED PRIVATE KEY-----\<REMOVED CONTENT>\n..."
."-----BEGIN ENCRYPTED PRIVATE KEY-----\\<REMOVED CONTENT>\\n..."
.Steps I’ve tried:
I attempted to use the replace()
function to remove the backslashes:
replace(outputs('AirhartKey')?['body/value'], '\\n', '\n')
, but this doesn't seem to work.
I tried passing the key directly in the HTTP request, but it still gets altered with extra backslashes.
I’ve also verified that the key is being retrieved correctly from the Azure Key Vault, but when it's used in the HTTP request, the newlines are altered. How can I prevent this transformation and send the key without it being changed?
Any help would be appreciated! Thanks!
stampcoin
61
Michael E. Gernaey
47
Super User 2025 Season 1
rzaneti
29
Super User 2025 Season 1