lms-server | NODEJS backend server for LMS project | Runtime Evironment library
kandi X-RAY | lms-server Summary
kandi X-RAY | lms-server Summary
NODEJS backend server for LMS project.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of lms-server
lms-server Key Features
lms-server Examples and Code Snippets
Community Discussions
Trending Discussions on lms-server
QUESTION
I have a pipeline in ADF that goes to a REST API endpoint which returns a string enclosed in double quotes ("). It looks like this: "xyz123fj=="
What I'm trying to do is store the string value in a variable called AuthKey
. Originally I just stored it "as is" but the pipeline failed with the following error: The variable 'AuthKey' of type 'String' cannot be initialized or updated with value of type 'Object'. The variable 'AuthKey' only supports values of types 'String'.
So naturally I thought I would try converting to a string like this: string(@activity('Get Token').output)
which actually allows the variable to be stored successfully, but the next step fails with the message: Error calling the endpoint 'https://'. Response status code: ''. More details:Exception message: 'The format of value 'string(@activity('Get Token').output)' is invalid.'. No response from the endpoint. Possible causes: network connectivity, DNS failure, server certificate validation or timeout.
Which I suspect means that it didn't actually store the original 'xyz123fj=='
string, but rather the unevaluated function itself as a string (so it stored string(@activity('Get Token').output)
which is invalid when sent to the API.
I also tried @string(activity('Get Token').output)
which resulted in a slightly different error message of: More details:Exception message: 'The format of value '{"Response":"\"xyz123fj==\"","ADFWebActivityResponseHeaders":{"Pragma":"no-cache","Strict-Transport-Security":"max-age=31536000","X-Absorb-Correlation-Id":"c937fab2-3e6c-4d92-8b28-5375fb2d5721","X-Content-Type-Options":"nosniff","X-Frame-Options":"SAMEORIGIN","X-LMS-Server":"USE1-PRD-WEB-A3","X-Response-For":"/api/Rest/v1/Authenticate","X-XSS-Protection":"1; mode=block","Connection":"keep-alive","Cache-Control":"no-cache","Date":"Mon, 03 May 2021 15:53:01 GMT","Content-Length":"178","Content-Type":"application/json; charset=utf-8","Expires":"-1"},"effectiveIntegrationRuntime":"DefaultIntegrationRuntime (East US)","executionDuration":0,"durationInQueue":{"integrationRuntimeQueue":0},"billingReference":{"activityType":"ExternalActivity","billableDuration":[{"meterType":"AzureIR","duration":0.016666666666666666,"unit":"Hours"}]}}' is invalid.'. No response from the endpoint.
In the last example, it looks like the step that is using the variable is receiving the full output object from the "Set variable" activity rather than just the simple string as intended. Any insight as to what I'm doing wrong here would be much appreciated.
I also tried only trimming the single quotes (so no string conversion function), but couldn't get that to work either. All I'm trying to do is store this string by itself :(
...ANSWER
Answered 2021-May-03 at 22:05You should just be able to write @activity('Get Token').output.Response
in the assignement of your variable
It seems like your Response value is enclosed in double-quotes so you may have to do this instead to strip the quotes: @replace(activity('Get Token').output.Response,'\"','')
activity('Get Token').output is type object - this is why the first error occurs (you cannot assign it to a string variable).
In the second case, your expression has to start with @ to be interpreted as such.
In the final case you are sending the entire output from the REST activity (which you can see in the monitor) as the token, which has a format the endpoint doesn't expect.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install lms-server
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page