The sequence "\ugdp$" is not a valid escape sequence in JSON. It seems there might be a typo or a character encoding issue.
Solutions:
- Verify the Actual Hostname:
- Double-check the source of the hostname value (
connection_json
from "Get Non-Zip Configurations"). - Ensure there are no typos or extra characters in the actual hostname. It should be something like "\atlnetast004\uxyz$" (assuming "uxyz" is the correct value).
- Double-check the source of the hostname value (
- Handle Encoding Issues (if applicable):
- If the source data containing the hostname has a different encoding than UTF-8, you might need to convert it before using it in the JSON body.
- Azure Data Factory offers functions like
convertToString
with appropriate encoding options to handle this.
- Remove Unnecessary Escape Sequence (if applicable):
- If "\u" is not intended as an escape sequence, simply remove it from the hostname value before constructing the JSON.
Here are two possible approaches depending on the cause:
Scenario 1: Typo or Extra Characters
- If the issue is a typo or extra characters, correct the value in the source data (
connection_json
). - This ensures the correct hostname is used in the JSON body without any invalid escape sequences.
Scenario 2: Encoding Issue
- If there's an encoding issue, use
convertToString
in ADF to convert the source data to UTF-8 before accessing the hostname:
'host': '@{convertToString(activity('Get Non-Zip Configurations').output['firstRow']['connection_json'], 'UTF-8')['host_name']}'
Remember to test your changes thoroughly after implementing one of these solutions.
By addressing the root cause of the invalid escape sequence, you should be able to successfully pass the correct hostname with backslashes in your ADF REST API call.