This schema is perfectly json-validated but does not work in Bot-Framework-Composer. To be exact, when "has" is "true" the "secondFace" object MUST be set, when "has" is "false" it must be absent.
The Bot Framework Composer validates correctly if "has" is true, while if "has" is "false" it continues to request to set the "secondFace" object. Is it a composer bug or is there anything to do, perhaps at the composer's form-UI level?
"hasSecondFace": {
"type": "object",
"title": "Has second face for comparison ?",
"additionaProperties": true,
"properties": {
"has": {
"type": "boolean",
"default": true,
"title": "Has Second Face",
"description": "If true ha second face else No"
},
"secondFace": {
"title": "Second face to be compared",
"additionalProperties": true,
"required": [
"type",
"param"
],
"oneOf": [
{
"type": "object",
"title": "From Storage",
"properties": {
"type": {
"const": "fromFile"
},
"param": {
"$ref": "schema:#/definitions/stringExpression",
"title": "Storage key",
"description": "key name of the blob"
}
}
},
{
"type": "object",
"title": "image stream",
"properties": {
"type": {
"const": "fromKey"
},
"param": {
"$ref": "schema:#/definitions/stringExpression",
"title": "Stream of second face",
"description": "Second face to compare"
}
}
}
]
}
},
"if": {
"properties": {
"has": { "const": true }
},
"required": [ "has" ]
},
"then": {
"required": [ "secondFace" ]
},
"else": {
"not": { "required": [ "secondFace" ] }
}
}
}
Unable to update the Knowledge in QnA maker whereas i am able to add the data to my Knowledge Base.Below is my update related REQUEST object
references: https://github.com/Azure-Samples/cognitive-services-qnamaker-java/blob/master/update-knowledge-base.java
{
"update": {
"qnaList": [
{
"id": 0,
"answer": "[92 Newcastle Court Roanoke, VA 24012](https://www.google.com/)",
"questions": [
"Where is Virginia located",
"What is the address of Roanoke",
"Roanoke address",
"Roanoke location"
],
"metadata": [
{
"name": "fragmenttype",
"value": "location"
},
{
"name": "locationname",
"value": "Roanoke"
},
{
"name": "type",
"value": "locationinfo"
}
]
},
{
"id": 1,
"answer": "[880 Oakwood St.Billerica, MA 01821](https://www.google.com/)",
"questions": [
"Where is Billerica located",
"What is the address of Billerica",
"Billerica address",
"Billerica location"
],
"metadata": [
{
"name": "fragmenttype",
"value": "location"
},
{
"name": "locationname",
"value": "Billerica"
},
{
"name": "type",
"value": "locationinfo"
}
]
}
]
}
}
and error response is:
{
"error": {
"code": 12,
"message": "Parameter is null",
"target": null,
"details": null,
"innerError": null
}
}
Your API call should be as below format.
More information can be found here
"update": {
"name": "QnA Maker FAQ Prompts Bot",
"qnaList": [
{
"id": 2,
"answer": "You can use our REST apis to create a KB. See here for details: https://learn.microsoft.com/en-us/rest/api/cognitiveservices/qnamaker/knowledgebase/create",
"source": "Custom Editorial",
"questions": {
"add": [],
"delete": []
},
"metadata": {
"add": [],
"delete": []
}
}
]
}
I have a logic app which contains an action that is using a custom connector. Custom connector is a SOAP Pass through.
Everything is being deployd via ARM Template. When I deploy, everything looks OK except the action for custom connector. It says 'Connector not found'. But If i delete that and add a new action from Logic App designer, everything seems to work as it should. So I believe, the custom connector and api connections are being setup properly but for some reason the action is not setup properly.
Connector is a SOAP Passthrough configured to use on-premises data gateway.
Here is ARM Template (I have removed sensitive information)
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"logicAppName": {
"type": "string",
"metadata": {
"description": "Name of the Logic App."
},
"defaultValue": "TestLogicAppCustomConnector"
},
"logicAppLocation": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"allowedValues": [
"[resourceGroup().location]",
"eastasia",
"southeastasia",
"centralus",
"eastus",
"eastus2",
"westus",
"northcentralus",
"southcentralus",
"northeurope",
"westeurope",
"japanwest",
"japaneast",
"brazilsouth",
"australiaeast",
"australiasoutheast",
"southindia",
"centralindia",
"westindia",
"canadacentral",
"canadaeast",
"uksouth",
"ukwest",
"westcentralus",
"westus2"
],
"metadata": {
"description": "Location of the Logic App."
}
},
"customApis_RemedyConnector_name": {
"type": "string",
"defaultValue": "remedyconnector"
},
"connections_RemedyConnector_name": {
"type": "string",
"defaultValue": "RemedyPassThroughConnection"
},
"connections_RemedyConnector_DisplayName": {
"type": "string",
"defaultValue": "Remedy PassThrough SOAP Connection"
},
"remedy_Host": {
"type": "string",
"defaultValue": "server.company.com:8080"
},
"remedy_Base_Path": {
"type": "string",
"defaultValue": "/service"
},
"remedy_username": {
"type": "string",
"defaultValue": "username"
},
"remedy_password": {
"type": "string",
"defaultValue": "pwd"
},
"onPremDataGateway_name": {
"type": "string",
"defaultValue": "on-prem-gateway"
},
"onPremDataGatewayRG_name": {
"type": "string",
"defaultValue": "gateway-rg"
}
},
"variables": {
"remedy_webservice_full_url": "[concat('http://',parameters('remedy_Host'),parameters('remedy_Base_Path'))]"
},
"resources": [
{
"type": "Microsoft.Web/customApis",
"apiVersion": "2016-06-01",
"name": "[parameters('customApis_RemedyConnector_name')]",
"location": "[parameters('logicAppLocation')]",
"tags": {
"displayName": "RemedyCustomConnector"
},
"properties": {
"connectionParameters": {
"username": {
"type": "securestring",
"uiDefinition": {
"displayName": "userName",
"description": "The userName for this api",
"tooltip": "Provide the userName",
"constraints": {
"tabIndex": 2,
"clearText": true,
"required": "true",
"capability": [
"gateway"
]
}
}
},
"password": {
"type": "securestring",
"uiDefinition": {
"displayName": "password",
"description": "The password for this api",
"tooltip": "Provide the password",
"constraints": {
"tabIndex": 3,
"clearText": false,
"required": "true",
"capability": [
"gateway"
]
}
}
},
"authType": {
"type": "string",
"allowedValues": [
{
"value": "basic"
}
],
"uiDefinition": {
"displayName": "Authentication Type",
"description": "Authentication type to connect to your API",
"tooltip": "Authentication type to connect to your API",
"constraints": {
"tabIndex": 1,
"required": "true",
"allowedValues": [
{
"text": "basic",
"value": "basic"
}
],
"capability": [
"gateway"
]
}
}
},
"gateway": {
"type": "gatewaySetting",
"gatewaySettings": {
"dataSourceType": "CustomConnector",
"connectionDetails": []
},
"uiDefinition": {
"constraints": {
"tabIndex": 4,
"required": "true",
"capability": [
"gateway"
]
}
}
}
},
"description": "SOAP pass-through for Remedy Calls",
"displayName": "[parameters('customApis_RemedyConnector_name')]",
"backendService": {
"serviceUrl": "[variables('remedy_webservice_full_url')]"
},
"apiType": "Soap",
"wsdlDefinition": {
"importMethod": "SoapPassThrough"
},
"capabilities": [
"gateway"
],
"swagger": {
"swagger": "2.0",
"info": {
"title": "SOAP pass-through",
"description": "SOAP pass-through for Remedy Calls",
"version": "1.0"
},
"host": "[parameters('remedy_Host')]",
"basePath": "[parameters('remedy_Base_Path')]",
"consumes": [],
"produces": [],
"paths": {
"/SoapPassThrough": {
"post": {
"operationId": "SoapPassThrough",
"parameters": [
{
"name": "server",
"in": "query",
"required": true,
"type": "string",
"default": "servername",
"x-ms-visibility": "important",
"enum": [
"servername"
]
},
{
"name": "webService",
"in": "query",
"required": true,
"type": "string",
"default": "FRIntegration",
"x-ms-visibility": "important",
"enum": [
"FRIntegration"
]
},
{
"name": "Content-Type",
"in": "header",
"required": false,
"type": "string",
"default": "text/xml",
"enum": [
"text/xml"
]
},
{
"name": "SOAPAction",
"in": "header",
"required": false,
"type": "string",
"default": "urn:FRIntegration/OpCreate",
"enum": [
"urn:FRIntegration/OpCreate"
]
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {},
"x-ms-visibility": "important"
},
"x-ms-visibility": "important"
}
],
"responses": {
"200": {
"description": "OK"
}
},
"summary": "Update",
"description": "Update Remedy Record",
"x-ms-visibility": "important"
}
}
},
"definitions": {},
"parameters": {},
"responses": {},
"securityDefinitions": {
"basic_auth": {
"type": "basic"
}
},
"security": [],
"tags": [],
"schemes": [
"http"
]
}
}
},
{
"type": "MICROSOFT.WEB/CONNECTIONS",
"apiVersion": "2016-06-01",
"name": "[parameters('connections_RemedyConnector_name')]",
"location": "[parameters('logicAppLocation')]",
"tags": {
"displayName": "RemedyConnection"
},
"properties": {
"api": {
"id": "[resourceId('Microsoft.Web/customApis', parameters('customApis_RemedyConnector_name'))]"
},
"displayName": "[parameters('connections_RemedyConnector_DisplayName')]",
"parameterValues": {
"authType": "Basic",
"userName": "[parameters('remedy_username')]",
"password": "[parameters('remedy_password')]",
"gateway": {
"id": "[concat(subscription().id, '/resourceGroups/',parameters('onPremDataGatewayRG_name'),'/providers/Microsoft.Web/connectionGateways/',parameters('onPremDataGateway_name'))]"
}
}
},
"dependsOn": [
"[resourceId('Microsoft.Web/customApis', parameters('customApis_RemedyConnector_name'))]"
]
},
{
"name": "[parameters('logicAppName')]",
"type": "Microsoft.Logic/workflows",
"location": "[parameters('logicAppLocation')]",
"apiVersion": "2016-06-01",
"tags": {
"displayName": "Test-LogicApp-CustomConnector"
},
"properties": {
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"Compose_Soap_Envelope": {
"inputs": "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:urn=\"urn:FRIntegration\"><soapenv:Header></soapenv:Header><soapenv:Body><urn:OpCreate></urn:OpCreate></soapenv:Body></soapenv:Envelope>",
"runAfter": {
},
"type": "Compose"
},
"Scope": {
"actions": {
"get_all": {
"inputs": {
"body": "#outputs('Compose_Soap_Envelope')",
"headers": {
"Content-Type": "text/xml",
"SOAPAction": "urn:FRIntegration/OpCreate"
},
"host": {
"connection": {
"name": "#parameters('$connections')['RemedyPassThrough']['connectionId']"
}
},
"method": "post",
"path": "/SoapPassThrouh",
"queries": {
"server": "<server>",
"webService": "FRIntegration"
},
"retryPolicy": {
"type": "none"
},
"authentication": {
"type": "Basic"
}
},
"runAfter": {},
"type": "ApiConnection"
}
},
"runAfter": {
"Compose_Soap_Envelope": [
"Succeeded"
]
},
"type": "Scope"
},
"Compose": {
"inputs": {
"IncidentID": "INC0001",
"RequestStatus": "Fault Investigation",
"WorkLogID": "WorkLogID"
},
"runAfter": {
"Scope": [
"Succeeded"
]
},
"type": "Compose"
},
"Response": {
"inputs": {
"body": "#outputs('Compose')",
"headers": {
"Content-Type": "application/json"
},
"schema": {
"properties": {
"incidentID": {
"type": "string"
},
"requestStatus": {
"type": "string"
},
"workLogID": {
"type": "string"
}
},
"type": "object"
},
"statusCode": 201
},
"kind": "Http",
"runAfter": {
"Compose": [
"Succeeded"
]
},
"type": "Response"
}
},
"parameters": {
"$connections": {
"defaultValue": {},
"type": "Object"
}
},
"triggers": {
"manual": {
"type": "Request",
"kind": "Http",
"inputs": {
"schema": {
"type": "object",
"properties": {
"workLogId": {
"type": "object",
"properties": {
"workLogDateTime": {
"type": "string"
},
"workLogDescription": {
"type": "string"
}
}
}
}
},
"method": "POST"
}
}
},
"contentVersion": "1.0.0.0",
"outputs": {}
},
"parameters": {
"$connections": {
"value": {
"RemedyPassThrough": {
"connectionId": "[resourceId('Microsoft.Web/connections', parameters('connections_RemedyConnector_name'))]",
"connectionName": "[parameters('connections_RemedyConnector_name')]",
"id": "[resourceId('Microsoft.Web/customApis', parameters('customApis_RemedyConnector_name'))]"
}
}
}
}
},
"resources": [
],
"dependsOn": [
"[resourceId('Microsoft.Web/customApis', parameters('customApis_RemedyConnector_name'))]",
"[resourceId('Microsoft.Web/connections', parameters('connections_RemedyConnector_name'))]"
]
}
]
}
I've also downloaded and compared the ARM Template for the logic app that i designed in the designer but I don't find any differences. I would appreciate any help/pointers to sort this out.
Thanks
Sanjay
I am trying to make an ARM Template for a Custom Connector which needs to have enabled the use of on-premises Data Gateway. I am getting everything right except this last requirement, since I create a fully configured Custom Connector, except for the fact that the check-mark for using the on-premises Data Gateway is not active.
Any idea which setting/element I need to add change to get this done?
This is my template up to now:
{
"type": "Microsoft.Web/customApis",
"name": "[parameters('Connection_Name')]",
"apiVersion": "2016-06-01",
"location": "centralus",
"scale": null,
"properties": {
"connectionParameters": {
"authType": {
"type": "string",
"allowedValues": [
{
"value": "none"
}
],
"uiDefinition": {
"displayName": "Authentication Type",
"description": "Authentication type to connect to your API",
"tooltip": "Authentication type to connect to your API",
"constraints": {
"tabIndex": 1,
"required": "true",
"allowedValues": [
{
"text": "none",
"value": "anonymous"
}
],
"capability": [
"gateway"
]
}
}
},
"gateway": {
"type": "gatewaySetting",
"gatewaySettings": {
"dataSourceType": "CustomConnector",
"connectionDetails": []
},
"uiDefinition": {
"constraints": {
"tabIndex": 4,
"required": "true",
"capability": [
"gateway"
]
}
}
}
},
"backendService": {
"serviceUrl": "[parameters('ServiceUrl')]"
},
"apiType": "Soap",
"wsdlDefinition": {
"importMethod": "SoapPassThrough"
},
"swagger": {
"swagger": "2.0",
"info": {
"title": "SOAP pass-through",
"description": "Custom Connector for SOAP Operation",
"version": "1.0"
},
"host": "xxxxxxxxxxxxx",
"basePath": "/xxxxxxxx/xxxxxxxxxx",
"consumes": [],
"produces": [],
"paths": {
"/": {
"post": {
"responses": {
"default": {
"description": "default",
"schema": {
"type": "string",
"title": "",
"x-ms-visibility": "important"
},
"headers": {
"Content-Type": {
"description": "Content-Type",
"type": "string"
}
}
}
},
"summary": "GetOrigins",
"description": "GetOrigins",
"operationId": "GetOrigins",
"parameters": [
{
"name": "Content-Type",
"in": "header",
"required": false,
"type": "string"
},
{
"name": "body",
"in": "body",
"required": false,
"schema": {
"type": "string"
}
}
]
}
}
},
"definitions": {},
"parameters": {},
"responses": {},
"securityDefinitions": {},
"security": [],
"tags": [],
"schemes": [
"http"
]
},
"description": "[concat('Custom Connector for SOAP', parameters('Connection_Name'),' Operation')]",
"displayName": "[parameters('Connection_Name')]",
"iconUri": "/Content/retail/assets/default-connection-icon.6296199fc1d74aa45ca68e1253762025.2.svg"
},
"dependsOn": []
}
To enable the 'On-Premises Data Gateway' option, you need to add gateway to the capabilities array like so:
"properties" {
"capabilities": [
"gateway"
],
}
the On-Premises Data Gateway option is not available from ARM templates, you must to install your template and manually add the check box from the Azure portal.
Thanks.
I have created a REST API with a Swagger/OPEN API specification which I will like to consume trough a Azure API Management tenant in a Logic App.
When I download the specification it looks like this:
{
"swagger": "2.0",
"info": {
"title": "Leasing",
"version": "1.0"
},
"host": "ENDPOINT.azure-api.net",
"basePath": "/leasing",
"schemes": [
"http",
"https"
],
"securityDefinitions": {
"apiKeyHeader": {
"type": "apiKey",
"name": "Ocp-Apim-Subscription-Key",
"in": "header"
},
"apiKeyQuery": {
"type": "apiKey",
"name": "subscription-key",
"in": "query"
}
},
"security": [
{
"apiKeyHeader": []
},
{
"apiKeyQuery": []
}
],
"paths": {
"/{Brand}/groups": {
"get": {
"description": "Get a list of leasing groups on a brand",
"operationId": "GetGroups",
"parameters": [
{
"name": "Brand",
"in": "path",
"description": "Selection of possible brands",
"required": true,
"type": "string",
"enum": [
"Volkswagen",
"Audi",
"Seat",
"Skoda",
"VolkswagenErhverv",
"Porsche",
"Ducati"
]
}
],
"responses": {
"200": {
"description": "Returns a list of leasing groups",
"schema": {
"$ref": "#/definitions/GroupArray"
}
},
"400": {
"description": "If the brand is not valid",
"schema": {
"$ref": "#/definitions/Error"
}
}
},
"produces": [
"application/json"
]
}
}
},
"definitions": {
"Group": {
"type": "object",
"properties": {
"id": {
"format": "int32",
"type": "integer"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"leasingModelCount": {
"format": "int32",
"type": "integer"
},
"lowestMonthlyFee": {
"format": "int32",
"type": "integer"
}
}
},
"Error": {
"type": "object",
"properties": {
"code": {
"enum": [
"NotValidBrand",
"NotValidGroupId"
],
"type": "string",
"x-ms-enum": {
"name": "ErrorCode",
"modelAsString": true
}
},
"message": {
"type": "string"
}
}
},
"GroupArray": {
"type": "array",
"items": {
"$ref": "#/definitions/Group"
}
}
}
}
When I add this in a Logic App with the connector HTTP + Swagger I only get to define the {Brand} query input but not the various ways of using the Subscriptions key (header or query) as defined in SecurityDefiniations.
The whole securityDefinitions and security section are automatically generated in the Azure API Management service, but not recognized in Logic App.
See image of missing subscription key field:
What am I doing wrong?
Update
I have tried the following:
Usage of the 'Authentication' field (but this field is limited to certain types of auths flows https://learn.microsoft.com/en-us/azure/connectors/connectors-native-http#authentication)
Change the Logic App 'Http + Swagger'-action in code to add the header parameter, but this action converts the action to a simple 'Http' action and therfore loosing the automatic schema generation from Swagger.
I think you need to specify this in the Authentication-field in a JSON format. Something like:
{
"apiKeyHeader" : "your Ocp-Apim-Subscription-Key",
"apiKeyQuery" : "your subscription key"
}