Azure Datafactory Web Activity - azure

I have developed an Function app and published the same via Azure APIM. I am trying to call the API(APIM) from Data factory Web Activity, which fails with the below. However when I use the Azure function URL + Function key directly in WebActivity this works fine.
So I want to be able to call a REST endpoint internal to my organization from Azure Data Factory using Web Activity. Appreciate any directions on this.
{
"errorCode": "2108",
"message": "Error calling the endpoint. Response status code: ",
"failureType": "UserError
}

Related

How can I view logs from Azure REST API requests?

Assume I send a request to the Azure REST API:
az rest
--method GET
--uri 'https://graph.microsoft.com/v1.0/applications/000000-00000-00000-00000'
| ConvertFrom-Json
If a request fail I get an error message:
{
"error":
{
"code": "Request_BadRequest",
"message": "One or more properties contains invalid values.",
"innerError":
{
"date": "2022-10-07T06:12:04",
"request-id": "111111-2222-3333-4444-5555555",
"client-request-id": "12345-1234-1234-1234-12345678"
}
}
}
How can I view the log that is referenced with "request-id":"111111-2222-3333-4444-5555555" or "client-request-id":"12345-1234-1234-1234-12345678"?
There is no inbuilt resource to log the requests coming to Azure rest api.
Refer to one of the similar issues regarding REST APIs using in Azure.
Application insights can be used for tracking purpose if your application is deployed in azure.
Created the Web App > created & configured application insights resource:
Go to Overview blade of Web App > requests coming to web app in a graphical representation:
To view logs of webapp, go to web app and click on Logs in Monitoring session.
Example: Below is one failed request to web app can be seen in logs,
Refer to this MS Doc for more information on Azure Monitor App Insight Logging.

Error on source dataset with REST Connector in Azure Synapse pipeline

I am using Copy and transform data from and to a REST endpoint by using Azure Data Factory to load a file from my Box.com account to an Azure Data Lake Gen2 (ADLSGen2) container. I'm using Synapse pipeline with source as the REST connector where I've identified the Base URL in step3 of the tutorial to be https://api.box.com/2.0/files/:file_id/content where file_id is the id of my file stored in Box.com (ref: here).
When I run the pipeline, I get the following error. Question: What I may be doing wrong and how can the issue be resolved?
"errorCode": "2200",
"message": "Failure happened on 'Source' side. ErrorCode=RestSourceCallFailed,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=The HttpStatusCode 401 indicates failure.\nRequest URL: https://api.box.com/2.0/files/:984786751561/content\nResponse payload:,Source=Microsoft.DataTransfer.ClientLibrary,'",
"failureType": "UserError",
"target": "Copy data1",
"details": []
I'm from the Microsoft for Founders Hub team. A 401 could be due to an unauthorized access. In your tutorial, on step 3, as you mentioned, there is a test connection button. Please click it to make sure you are authorized.

How do I access Azure Storage container from Azure Cognitive services

I am having an issue with transcribing (Speech-To-Text) an audio file hosted on Azure Storage container from the Cognitive Services API.
The services are of the same resource (and I created a VNet and they are part of the same subnet).
After I take the response from there the contentUrl:
The error I get is:
{
"successfulTranscriptionsCount": 0,
"failedTranscriptionsCount": 1,
"details": [
{
"source":"https://{service-name}.blob.core.windows.net/meetingnotes/Meeting82035.wav",
"status": "Failed",
"errorMessage": "Error when downloading the recording URI. StatusCode: Conflict.",
"errorKind": "DownloadRecordingsUrisUnknownError"
}
]
}
I tested in my environment and was getting the same error as you.
To resolve the issue, you need to append the SAS Token with bloUrl in contentUrls field.
For Generating the SAS token allowed all the permission as I have done in below picture.
Generated Transcript report
Final OutPut Once Clicked on ContentUrl
I contacted Azure support and they provided the correct solution, which is to add the Role “Storage Blob Data Contributor” to the speech services resources.
Go to IAM of your storage account
Go to Role Assignments
click "Add", then add your speech service in Managed Identities.
That should fix it.

Error calling the azure function endpoint from azure data factory

I have linked azure function in data factory pipeline which writes the text file to blob storage
The azure function works fine when executed independently and writes the file to blob storage
But i am facing below mentioned error when i run the azure function from data factory
{
"errorCode": "3600",
"message": "Error calling the endpoint.",
"failureType": "UserError",
"target": "Azure Function1"
}
I have configured the azure fucntion to access the blob with blobendpoint and shared access signature as mentioned below
"AzureWebJobsStorage": "DefaultEndpointsProtocol=https;AccountName=XYZ;AccountKey=XYZ;BlobEndpoint=ABC;SharedAccessSignature=AAA"
Please let me know if i need to make some additional properties changes in blob storage to access azure function successfully from data factory
What is the trigger in your azure function? http trigger?
Also how is your azure function protected?
if protected using AAD you need Bearer token.
if you are using keys you need x-function key.
https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-http-webhook#authorization-keys
Here is a video from channel9 that might help:
Run Azure Functions from Azure Data Factory pipelines
https://channel9.msdn.com/Shows/Azure-Friday/Run-Azure-Functions-from-Azure-Data-Factory-pipelines
The Azure Function Activity in the ADF pipeline expects the Azure Function to return a JSON object instead of an HttpResponseMessage.
Here is how we solved it:
https://microsoft-bitools.blogspot.com/2019/01/introducing-azure-function-activity-to.html

Is it possible to access Docker containers living in Azure Container Instance(s) via RESTful endpoints?

I am trying to proof out the ability to store my Docker container in Azure Container Instance. I currently have my container in Azure Container Instance but I am trying to access it via RESTful endpoints.
I have currently configured my Azure AD account to grant my application access to the Windows Azure Service Management API with the delegate access.
I am also using Postman to create the Bearer token to then pass down to my URL:
POST
https://management.azure.com/subscriptions/<SUBSCRIPTION_ID>/resourceGroups/slack-bots-v2/providers/Microsoft.ContainerInstance/containerGroups/testing/exec?api-version=2018-04-01
I am however getting an error of:
{
"error": {
"code": "AuthorizationFailed",
"message": "The client '<CLIENT_ID>' with object id '<OBJECT_ID>' does not have authorization to perform action 'Microsoft.ContainerInstance/containerGroups/exec/action' over scope '/subscriptions/<SUBSCRIPTION_ID>/resourceGroups/slack-bots-v2/providers/Microsoft.ContainerInstance/containerGroups/testing'."
}
}
Question(s):
is it possible to access my container instance via RESTful API?
is there a different Azure AD permission that needs to be set in order to access this?
has anyone solved a similar problem outside of Azure but maybe with another public cloud provider, (AWS, GCP, and etc)?

Resources