Azure Devops unable to populate picklist - azure

I followed the tutorial found at
https://learn.microsoft.com/en-us/azure/devops/extend/develop/service-endpoints?view=azure-devops
The api call is right because if I don't authenticate it shows the correct path in the error message. Entering the url that it shows in the message in a browser gives the correct json.
The picklist object will act like it is trying to load but will end up showing no results found.
Can you use a personal company api to load a picklist using server endpoint?
How do you debug this. All I see in the network tab on debugging tools is the 200 from azure making the post.
This is the JSON
{
"meta": {
"record_count": 5,
"source": "mongodb",
"searchParams": {
"versions.start_date": {
"$gte": "2019-08-30T00:11:55.329Z"
}
},
"paging": {
"num": 10,
"start": 0
}
},
"screenshots": [
{
"screenshot_test_id": 3946619,
"url": "https://www.google.com",
"test_name": null,
"created_date": "2019-10-27T21:26:32.0 ```
This is the datasources from the vss.extension
"dataSources": [
{
"name": "CBTAPIReturn",
"endpointUrl": "{{endpoint.url}}",
"resultSelector": "jsonpath:$[*].screenshots"
}
]
inputs and bindings from the task
"inputs": [
{
"name": "CBTService",
"type": "connectedService:CBTServiceEndpoint",
"label": "CBT service/server end point",
"defaultValue": "",
"required": true,
"helpMarkDown": "Select the CBT end point to use. If needed,selecton 'manage', and add a new service endpoint of type 'CBT server connection'"
},
{
"name": "CBT API Response",
"type": "pickList",
"label": "CBT API Response",
"required": true,
"helpMarkDown": "Select the name combination that you want to use.",
"properties": {
"EditableOptions": "True"
}
}
],
"dataSourceBindings": [
{
"target": "CBT API Response",
"endpointId": "$(CBTService)",
"dataSourceName": "CBTAPIReturn"
```

Related

Azure Devops Create Pipeline (Classic way) REST API

I am migrating an Azure devops organization to another organization,
I ran into a problem where i can not create a pipeline which created in the classic way (NOT A YAML).
This is the JSON
{
"name": "PP_NAME",
"folder": "",
"configuration": {
"designerJson": {
"options": [
{
"enabled": false,
"definition": {
"id": "DEF_ID"
},
"inputs": {
"branchFilters": "[\"+refs/heads/*\"]",
"additionalFields": "{}"
}
},
{
"enabled": false,
"definition": {
"id": "DEF_ID"
},
"inputs": {
"workItemType": "Task",
"assignToRequestor": "true",
"additionalFields": "{}"
}
}
],
"variables": {
"system.debug": {
"value": "false",
"allowOverride": true
}
},
"tags": [],
"process": {
"phases": [
{
"name": "Agent job 1",
"refName": "Job_1",
"condition": "succeeded()",
"target": {
"executionOptions": {
"type": 0
},
"allowScriptsAuthAccessOption": false,
"type": 1
},
"jobAuthorizationScope": "project"
}
],
"target": {
"agentSpecification": {
"identifier": "windows-2019"
}
},
"type": 1
},
"quality": "definition",
"path": "\\",
"repository": {
"id": "REPOSITORY_ID",
"name": "test 1",
"type": "TfsGit"
}
},
"path": "\\",
"type": "designerJson"
}
}
The output :
{
"$id": "1",
"innerException": null,
"message": "This API does not support creating pipelines of configuration type DesignerJson.",
"typeName": "Microsoft.Azure.Pipelines.WebApi.UnsupportedConfigurationTypeException, Microsoft.Azure.Pipelines.WebApi",
"typeKey": "UnsupportedConfigurationTypeException",
"errorCode": 0,
"eventId": 3000
}
According the the AZDO documentation, it is possible to create a pipeline with the classic way.
Thanks !
To create a classic pipeline, you can use this REST API Definitions - Create.
If you are not sure about the request body, you can use REST API Definitions - Get to get the definition of a classic pipeline as a reference.

API for Getting ADF pipeline details

I was looking for an API which gives me the details of a Azure Datafactory Pipeline
including start time,end time, duration etc. This is required to generate a report without manually looking into the ADF monitoring window
You can get a list of pipeline runs using Pipeline Runs - Query By Factory and then for each result run [Pipeline Runs - Query By Factory]
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/queryPipelineRuns?api-version=2018-06-01
Checkout the sample request here
You can pick the necessary fields from the response body.
{
"value": [
{
"runId": "2f7fdb90-5df1-4b8e-ac2f-064cfa58202b",
"pipelineName": "examplePipeline",
"parameters": {
"OutputBlobNameList": "[\"exampleoutput.csv\"]"
},
"invokedBy": {
"id": "80a01654a9d34ad18b3fcac5d5d76b67",
"name": "Manual"
},
"runStart": "2018-06-16T00:37:44.6257014Z",
"runEnd": "2018-06-16T00:38:12.7314495Z",
"durationInMs": 28105,
"status": "Succeeded",
"message": "",
"lastUpdated": "2018-06-16T00:38:12.7314495Z",
"annotations": [],
"runDimension": {
"JobId": "79c1cc52-265f-41a5-9553-be65e736fbd3"
}
},
{
"runId": "16ac5348-ff82-4f95-a80d-638c1d47b721",
"pipelineName": "examplePipeline",
"parameters": {
"OutputBlobNameList": "[\"exampleoutput.csv\"]"
},
"invokedBy": {
"id": "7c5fd7ef7e8a464b98b931cf15fcac66",
"name": "Manual"
},
"runStart": "2018-06-16T00:39:49.2745128Z",
"runEnd": null,
"durationInMs": null,
"status": "Cancelled",
"message": "",
"lastUpdated": "2018-06-16T00:39:51.216097Z",
"annotations": [],
"runDimension": {
"JobId": "84a3c493-0628-4b44-852f-ef5b3a11bdab"
}
}
]
}
And here is a simple WebActivity setup:
Further, you can find similar queries answered by me here and here

How to add a new top-level entity (to rest web service endpoint) using acumatica screenID?

Acumatica cloud ERP has a screen that displays failed push notifications (screenID = SM502000). I have created a new Web Services Endpoint, and added a new top-level entity from that screenID. However, no matter what fields I try to add, I get a variation on this error:
Optimization cannot be performed.The following fields cause the error:\r\nSelected: View FailedToSend has BQL delegate\r\n
Edit. I was able to create a REST end-point to fetch the results using a generic inquiry. Here is the JSON returned:
{
"id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"rowNumber": 1,
"note": null,
"Result": [
{
"id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"rowNumber": 1,
"note": null,
"Date": {
"value": 637167021636873690
},
"DateTimeStamp": {
"value": "2020-02-07T19:56:03.687369+00:00"
},
"DestinationNamePushNotifications_hookId": {
"value": "test"
},
"DestinationNamePushNotifications_hookId_description": {
"value": "test"
},
"Error": {
"value": "Send to target test failed. Message: WebHook returns not success code: NotFound; Message: Tunnel webhook.local not found"
},
"NotificationBody": {
"value": "..."
},
"PushNotifications_selected": {},
"Selected": {
"value": false
},
"SourceName": {
"value": "SO-SalesOrder"
},
"TransactionId": {
"value": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
},
"custom": {},
"files": []
},
{
"id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"rowNumber": 2,
"note": null,
"Date": {
"value": 637167021636873690
},
"DateTimeStamp": {
"value": "2020-02-07T19:56:03.687369+00:00"
},
"DestinationNamePushNotifications_hookId": {
"value": "test"
},
"DestinationNamePushNotifications_hookId_description": {
"value": "test"
},
"Error": {
"value": "Send to target test failed. Message: WebHook returns not success code: NotFound; Message: Tunnel webhook.local not found"
},
"NotificationBody": {
"value": "..."
},
"PushNotifications_selected": {},
"Selected": {
"value": false
},
"SourceName": {
"value": "SO-SalesOrder"
},
"TransactionId": {
"value": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
},
"custom": {},
"files": []
}
]
}
Here's a good tutorial for using GI to access data via API:
https://www.acumatica.com/blog/contract-based-apis-in-generic-inquiries/
Try retrieving the records one by one with a REST filter in the URL. The issue is that the target graph you added has a data view (FailedToSend) which uses a data view delegate.
Because data view delegates can be slower than no delegates the API refuses to return more than one record as an optimization.

Resource not found in PowerApps when connecting to API?

I am trying to send some images to power app using a custom connector.
My OpenAPI file looks this -
{
"swagger": "2.0",
"info": {
"version": "1.0.0",
"title": "Upload To Function"
},
"host": "XXXXXXXXXXXXX/.azurewebsites.net",
"paths": {
"/api/HttpTriggerCSharp/name/{name}": {
"post": {
"tags": [
"HttpTriggerCSharp"
],
"operationId": "UploadImage",
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json",
"text/json",
"application/xml",
"text/xml"
],
"parameters": [
{
"name": "file",
"in": "formData",
"required": true,
"type": "file",
"x-ms-media-kind": "image"
},
{
"name": "name",
"in": "path",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Saved successfully"
},
"400": {
"description": "Could not find file to upload"
}
},
"summary": "Image Upload",
"description": "Image Upload"
}
}
},
"definitions": {}
}
My function works as I have tested it out using POSTMAN, and also within the Azure function portal. But when I test it out on Powerapps using this swagger file, I get Status code 404, Resource not found error.
I call my function like this in Powerapps -
Uploadtofunction.uploadimage(MainimageView.image,{filename:"test")
Any idea, on why it's not working?
Edit: Here is how I tested it out on POSTMAN. I think its also related to the filename in swagger. Because when I add name/filename in the body, I get 500 internal server issue.

Discovery Document for Google Email Migration API v2?

Today Google announced a new version of the Email Migration API. The API appears to follow Google's normal REST format but I've been unable to determine the service name and version information for the API in order to use it with the google-api-python-client.
Is there a discovery document for the new API and if so what is the service name and version?
The discovery document was slightly delayed from the actual release, but it's now available through the discovery service or directly here.
For now, I've been able to write my own non-standard discovery document. It's probably buggy/incomplete but it's working for me for test messages and the Python API Client.
{
"kind": "discovery#restDescription",
"etag": "\"BgGz67p-6wsAbOn4St98QhtBGbA/blODPd9XLaVQKZp7pexaIpilnaw\"",
"discoveryVersion": "v1",
"id": "emailmigration:v2",
"name": "emailmigration",
"version": "v2",
"revision": "20130717",
"title": "Email Migration API",
"description": "API to migrate messages to Google Apps Gmail Accounts",
"ownerDomain": "google.com",
"ownerName": "Google",
"documentationLink": "https://developers.google.com/admin-sdk/email-migration/",
"protocol": "rest",
"baseUrl": "https://www.googleapis.com/email/v2/",
"basePath": "/email/v2/users/",
"rootUrl": "https://www.googleapis.com/",
"servicePath": "email/v2/users/",
"batchPath": "batch",
"parameters": {
"alt": {
"type": "string",
"description": "Data format for the response.",
"default": "json",
"enum": [
"json"
],
"enumDescriptions": [
"Responses with Content-Type of application/json"
],
"location": "query"
},
"fields": {
"type": "string",
"description": "Selector specifying which fields to include in a partial response.",
"location": "query"
},
"key": {
"type": "string",
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"location": "query"
},
"oauth_token": {
"type": "string",
"description": "OAuth 2.0 token for the current user.",
"location": "query"
},
"prettyPrint": {
"type": "boolean",
"description": "Returns response with indentations and line breaks.",
"default": "true",
"location": "query"
},
"quotaUser": {
"type": "string",
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.",
"location": "query"
},
"userIp": {
"type": "string",
"description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.",
"location": "query"
}
},
"auth": {
"oauth2": {
"scopes": {
"https://www.googleapis.com/auth/email.migration": {
"description": "Write access to Email Migration API v2."
}
}
}
},
"schemas": {
"Mail": {
"id": "Mail",
"type": "object",
"description": "The metadata for a mail message.",
"properties": {
"isDraft": {
"type": "boolean",
"description": "The message is marked as a draft when migrated to the Gmail mailbox."
},
"isInbox": {
"type": "boolean",
"description": "The message should appear in the Inbox, regardless of its labels. By default, a migrated mail message will appear in the Inbox only if it has no labels."
},
"isSent": {
"type": "boolean",
"description": "The message is marked as \"Sent Mail\" when migrated to the Gmail mailbox."
},
"isStarred": {
"type": "boolean",
"description": "The message is starred when migrated."
},
"isTrash": {
"type": "boolean",
"description": "The message is marked as \"Trash\" when migrated."
},
"isUnread": {
"type": "boolean",
"description": "The message is marked as unread when migrated. Without this property, a migrated mail message is marked as read."
},
"isDeleted": {
"type": "boolean",
"description": "The message is migrated directly into Google Vault. Once archived in Google Vault, the message is only visible to a Vault administrator."
},
"labels": {
"type": "array",
"description": "The labels applied to the message when migrated.",
"items": {
"type": "string"
}
}
}
}
},
"resources": {
"mail": {
"methods": {
"insert": {
"id": "emailmigration.mail.insert",
"path": "{userKey}/mail",
"httpMethod": "POST",
"description": "Insert a Mail resource into a user's Gmail account.",
"parameters": {
"userKey": {
"type": "string",
"description": "The email address or email alias of the user's mailbox to migrate the message to.",
"required": true,
"location": "path"
}
},
"request": {
"$ref": "Mail"
},
"scopes": [
"https://www.googleapis.com/auth/email.migration"
],
"supportsMediaUpload": true,
"mediaUpload": {
"accept": [
"message/rfc822"
],
"maxSize": "32MB",
"protocols": {
"simple": {
"multipart": true,
"path": "/upload/email/v2/users/{userKey}/mail"
},
"resumable": {
"multipart": true,
"path": "/upload/email/v2/users/{userKey}/mail"
}
}
}
}
}
}
}
}

Resources