Enter a valid URI error in Azure Logic Apps - azure

I am currently trying out Azure Logic Apps and am now trying to create
a first simple flow that acquires data from an external REST API.
I'm using FRED, a hosted Node-Red instance, to create an REST API end-point.
In FRED you use https://x_y.fred.sensetecnic.com/api/hello to access my mock API (where x_y is my user name).
Accessing "https://x_y.fred.sensetecnic.com/api/hello" in a browser returns the intended data as specified in the Node-Red flow. Same thing goes when accessing
"https://x_y.fred.sensetecnic.com/api/hello" using GET in Postman (then adding two required Headers, required by FRED).
The strange thing is that in my Azure Logic App, I am not able to even save the flow with my URI stated as "https://x_y.fred.sensetecnic.com/api/hello". It states "Enter a valid URI". I enter the headers as was required.
So I can get to the REST API directly from a browser or using Postman, but are not able to access it from within an Azure Logic App.

I test the problem is there is a special characters _ in your URI. You could have a try if you delete _ then it won't state error.
So you coudl Initialize a variable to store your name x_y, then insert the variable in the URI. The flow would be like this. If you don't find the name in Dynamic content, you could use variables('name') this expression to insert it.
With this way the GET method will run correctly.

Related

What is the "Resource" when setting up a call to REST API from ADF with Managed Indentity

I have created an Azure Function App and I can call it from browser with a URL similar to this:
https://myfunctionblahblh.appserviceenvironment.net/api/names/Peter/TGIF?code=my_function_app_key_Goes_Here
Now I want to call it from my ADF pipeline: So I dropped a Web activity and set it up like this so far:
So my question is what is the "Resource" that it is asking for? Also in the URL that for company reasons I have blacked out, imagine I have copied the URL of the function I pasted above, is that correct ?
The Resource field is where you specify the uri for the service that you want to send the token to. In the case of authenticating with managed identities, you will want to send it to "https://management.azure.com/". However, if your function is already authenticating with the "code" query string parameter, you may be able to set the Authentication field to "None".

Querying multiple application insights resources with REST API

I'm trying to query two different application insight instances (instance A and B) trough the REST API. I'm using postman to send a GET http request to the API and followed the answer in this post, which was aiming towards the same goal, join request data from different applications insights: https://stackoverflow.com/a/52248597/17161618
Just as it says in the above mentioned post I'm acessing the instance A and passed the authentication through the request header in the format keyA:appIdA,KeyB:appIdB.
I'm sending the following query:" union app("AppIdA").traces,app("AppIdB").traces " and receive the following error: enter image description here
Does anyone know how can I get access to read logs in resource B ?
I don't think you can run cross-component queries using API keys. You should use AAD (Azure Active Directory) auth. Give AAD app access to both resources. Then you should be able to run such queries.

Azure LogicApp for files migration

I am trying to figure out if Azure LogicApp can be used for files/documents migration from Azure Blob Storage to a custom service, where we have REST API. Here is the shortlist of requirements I have right now:
Files/documents must be uploaded into Azure Storage weekly or daily, which means that we need to migrate only new items. The amount of files/documents per week is about hundreds of thousands
The custom service REST API is secured and any interaction with endpoints should have JWT passed in the headers
I did the following exercise according to tutorials:
Everything seems fine, but the following 2 requirements make me worry:
Getting only new files and not migrate those that already moved
Getting JWT to pass security checks in REST
For the first point, I think that I can introduce a DB instance (for example Azure Table Storage) to track files that have been already moved, and for the second one I have an idea to use Azure Function instead of HTTP Action. But everything looks quite complicated and I believe that there might be better and easier options.
Could you please advise what else I can use for my case?
For the first point, you can use "When a blob is added or modified" trigger as the logic app's trigger. Then it will just do operation on the new blob item.
For the second point, just provide some steps for your reference:
1. Below is a screenshot that I request for the token in logic app in the past.
2. Then use "Parse JSON" action to parse the response body from the "HTTP" action above.
3. After that, your can request your rest api (with the access token from "Parse JSON" above)

In Azure Cognitive Services Text Translation what is the endpoint `https://<resource name>.cognitiveservices.azure.com/sts/v1.0/issuetoken` for?

Want to try out the Text Translation API from , I created my text translation resource, as described at https://www.microsoft.com/en-us/translator/business/trial/#get-started, and was presented with a subscription key and an endpoint https://<resource name>.cognitiveservices.azure.com/sts/v1.0/issuetoken.
I proceeded to replicate the sample code from https://learn.microsoft.com/en-us/azure/cognitive-services/translator/quickstart-translate?pivots=programming-language-csharp (also on Github).
That code wants the subscription key and endpoint added as environment variables, and I did so, using the strings provided to me when creating the resource. However, trying to run the sample code it fails with a 404 when going to the endpoint. Looking more carefully at https://learn.microsoft.com/en-us/azure/cognitive-services/translator/quickstart-translate?pivots=programming-language-csharp, I noticed that it told me to use https://api.cognitive.microsofttranslator.com/ as endpoint, not the URL above. After that change, the code worked.
So what is the https://<resource name>.cognitiveservices.azure.com/sts/v1.0/issuetoken endpoint for? Certainly one gets the impression it's the endpoint to use for translation requests, so maybe clarify the documentation there?

Pass extra parameters in ADAL return URL

I am using ADAL to authenticate a web app registered in Azure. Basically I am following this link
Is there any way I can pass additional parameters to CatchCode function. For example, lets say I need to provide CatchCode with ID of the currently selected item in database.
Any idea?
In your sign-in request URL, there's a state querystring parameter which gets returned along with the response. You can use this to pass the information your application needs when a user is returned back to your application after signing in. You can read more about this here: https://msdn.microsoft.com/en-us/library/azure/dn645542.aspx.

Resources