I'm trying to generate a JSON schema with nested dependencies via https://rjsf-team.github.io/react-jsonschema-form/, here's what I came up with:
{
"type": "object",
"title": "Jira schema",
"properties": {
"summary": {
"type": "string"
},
"description": {
"type": "string"
},
"project": {
"type": "string",
"enum": [
"BE",
"FE"
],
"enumNames": [
"Backend Sprint",
"Frontend Sprint"
],
"default": "BE"
}
},
"required": ["project"],
"dependencies": {
"project": {
"oneOf": [
{
"properties": {
"project": {
"enum": ["BE"]
},
"issuetype": {
"enum": ["10001", "10002"],
"enumNames": ["Task", "Story"],
"default": "10001"
}
},
"required": ["issuetype"]
},
{
"properties": {
"project": {
"enum": ["FE"]
},
"issuetype": {
"enum": ["10003", "10004"],
"enumNames": ["Epic", "Bug"],
"default": "10003"
}
},
"required": ["issuetype"]
}
]
},
"issuetype": {
"oneOf": [
{
"properties":
{
"issuetype": {
"enum": ["10001"],
"enumNames": ["Task"]
},
"priority": {
"enum": ["1", "2", "3"],
"enumNames": ["High", "Medium", "Low"],
"default": "2"
}
}
},
{
"properties":
{
"issuetype": {
"enum": ["10002"],
"enumNames": ["Story"]
},
"priority": {
"enum": ["2", "3"],
"enumNames": ["Medium", "Low"],
"default": "2"
}
}
},
{
"properties":
{
"issuetype": {
"enum": ["10003"],
"enumNames": ["Epic"]
},
"priority": {
"enum": ["3"],
"enumNames": ["Low"],
"default": "3"
}
}
},
{
"properties":
{
"issuetype": {
"enum": ["10004"],
"enumNames": ["Bug"]
},
"priority": {
"enum": ["2", "3"],
"enumNames": ["Medium", "Low"],
"default": "2"
}
}
}
]
}
}
}
Ideally, when I select a project, both issuetype and priority should be updated, same applies to issuetype - when an issuetype is selected, priority should be updated.
Currently, I'm able to update priority by updating issuetype,not by updating project.
Any thoughts/ideas is highly appreciated!
Related
How to reference types by group instead of doing it individually?
For example here, I want "sum" and "subtract" types to accept types that are "number"-related types only("number", "sum", "subtract"). While "concatenate" can accept both "number" and "string"-related types. Including their selves. This will be really helpful for me if in case I added more types and want them to be automatically included.
"sum": {
"title": "sum",
"type": "object",
"properties": {
"values": {
"type": "array",
"items": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/definitions/sum"
},
{
"$ref": "#/definitions/subtract"
}
]
}
}
},
"required": [
"values"
]
},
"subtract": {
"title": "subtract",
"type": "object",
"properties": {
"minuend": {
"type": "number"
},
"subtrahend": {
"type": "number"
}
},
"required": [
"minuend",
"subtrahend"
]
},
"concatenate": {
"title": "concatenate",
"type": "object",
"properties": {
"strings": {
"type": "array",
"items": {
"anyOf": [
{
"type": "number"
},
{
"type": "string"
},
{
"$ref": "#/definitions/sum"
},
{
"$ref": "#/definitions/subtract"
}
]
}
}
},
"required": [
"strings"
]
}
}
Here's the full schema:
{
"definitions": {
"sum": {
"title": "sum",
"type": "object",
"properties": {
"values": {
"type": "array",
"items": {
"anyOf": [
{
"type": "number"
},
{
"$ref": "#/definitions/sum"
},
{
"$ref": "#/definitions/subtract"
}
]
}
}
},
"required": [
"values"
]
},
"subtract": {
"title": "subtract",
"type": "object",
"properties": {
"minuend": {
"type": "number"
},
"subtrahend": {
"type": "number"
}
},
"required": [
"minuend",
"subtrahend"
]
},
"concatenate": {
"title": "concatenate",
"type": "object",
"properties": {
"strings": {
"type": "array",
"items": {
"anyOf": [
{
"type": "number"
},
{
"type": "string"
},
{
"$ref": "#/definitions/sum"
},
{
"$ref": "#/definitions/subtract"
}
]
}
}
},
"required": [
"strings"
]
}
},
"title": "Step",
"type": "object",
"properties": {
"value": {
"oneOf": [
{
"type": "number",
"minimum": 0
},
{
"$ref": "#/definitions/sum"
},
{
"$ref": "#/definitions/subtract"
}
]
}
}
}
How can the following requirements be configured in a JSON schema.
I have the following JSON
{
"orderMethods": [
{
"requestType": "some service",
"deployType": "MANUAL",
"deployLabel": "some label"
},
{
"requestType": "some service",
"deployType": "MANUAL",
"deployLabel": "some label"
},
{
"requestType": "some service",
"deployType": "AUTO",
"deploySubType": "REST",
"deployLabel": "some label",
"deployConfig": "some config"
},
{
"requestType": "some service",
"deployType": "AUTO",
"deploySubType": "DB",
"deployLabel": "some label",
"deployConfig": "some config"
}
]
}
Requirements:
only one deployType = "MANUAL" is allowed
only one deployType = "AUTO" is allowed
additionally, only one deploySubType = "REST or "DB" is allowed
Currently I have the following JSON schema. Unfortunately the above JSON is valid. How can the above requirements be addressed?
{
"$schema": "http://json-schema.org/draft-07/schema",
"type": "object",
"properties": {
"orderMethods": {
"$ref": "#/definitions/OrderMethods"
}
},
"additionalProperties": false,
"definitions": {
"OrderMethods": {
"type": "array",
"items": {
"$ref": "#/definitions/OrderMethod"
}
},
"OrderMethod": {
"oneOf": [
{
"$ref": "#/definitions/OrderMethodManualDeploy"
},
{
"$ref": "#/definitions/OrderMethodAutoDeploy"
}
],
"uniqueItems": true
},
"OrderMethodAutoDeploy": {
"oneOf": [
{
"$ref": "#/definitions/OrderMethodAutoRestDeploy"
},
{
"$ref": "#/definitions/OrderMethodAutoDBDeploy"
}
],
"uniqueItems": true
},
"OrderMethodManualDeploy": {
"type": "object",
"properties": {
"requestType": {
"type": "string"
},
"deployType": {
"const": "MANUAL"
},
"deployLabel": {
"type": "string"
}
},
"required": [
"requestType",
"deployType",
"deployLabel"
],
"additionalProperties": false
},
"OrderMethodAutoRestDeploy": {
"type": "object",
"properties": {
"requestType": {
"type": "string"
},
"deployType": {
"const": "AUTO"
},
"deploySubType": {
"const": "REST"
},
"deployLabel": {
"type": "string"
},
"deployConfig": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"requestType",
"deployType",
"deploySubType",
"deployLabel",
"deployConfig"
]
},
"OrderMethodAutoDBDeploy": {
"type": "object",
"properties": {
"requestType": {
"type": "string"
},
"deployType": {
"const": "AUTO"
},
"deploySubType": {
"const": "DB"
},
"deployConfig": {
"type": "string"
},
"deployLabel": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"requestType",
"deployType",
"deploySubType",
"deployLabel",
"deployConfig"
]
}
}
}
Thanks for your help/ideas.
cant build validation for simple case:
if sources field contains "OTHER" in values then "sourceOtherDescription" must be required.
Shall pass validation
{
"sources": ["RENTS"]
}
{
"sources": ["RENTS", "OTHER"],
"sourceOtherDescription": "other income"
}
This should not pass validation since sources contains "OTHER"
{
"sources": ["RENTS", "OTHER"]
}
The schema that I was able to produce. Does not really work
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "money-sources",
"title": "Money Sources",
"description": "Money Sources definitions",
"type": "object",
"required": ["sources"],
"properties": {
"sources": {
"type": "array",
"items": {
"type": "string",
"enum": [
"RENTS",
"MEMBER_FEES",
"PROFIT",
"SALES_SECURITIES",
"INTERNAL_GROUP_TRANSFERS",
"OTHER"
]
},
"uniqueItems": true
},
"sourceOtherDescription": { "type": "string", "minLength": 3}
},
"additionalProperties": false,
"oneOf": [
{
"properties": {
"sources": {
"type": "array",
"contains": {"const": "OTHER"}
}
},
"required": ["sourceOtherDescription"]
},
{
"properties": {
"sources": {
"type": "array",
"contains": {
"enum": [
"RENTS",
"MEMBER_FEES",
"PROFIT",
"SALES_SECURITIES"
]
}
}
}
}
, false
]
}
Using if-then it works for me this way:
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "money-sources",
"title": "Money Sources",
"description": "Money Sources definitions",
"type": "object",
"required": [ "sources" ],
"properties": {
"sources": {
"type": "array",
"items": {
"type": "string",
"enum": [
"RENTS",
"MEMBER_FEES",
"PROFIT",
"SALES_SECURITIES",
"INTERNAL_GROUP_TRANSFERS",
"OTHER"
]
},
"uniqueItems": true
},
"sourceOtherDescription": {
"type": "string",
"minLength": 3
}
},
"additionalProperties": false,
"if": {
"properties": {
"sources": {
"type": "array",
"contains": {
"const": "OTHER"
}
}
}
},
"then": {
"required": [ "sourceOtherDescription" ]
}
}
When trying to validate the following schema using http://www.jsonschemavalidator.net/,
{
"id": "http://some.site.somewhere/entry-schema#",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "schema for the FormularSpecification",
"definitions": {
"elementId": {
"id": "http://jsonschema.net/elementId",
"type": "string"
},
"mappingKey": {
"id": "http://jsonschema.net/mappingKey",
"type": "string"
},
"elementType": {
"id": "http://jsonschema.net/elementType",
"type": "string"
},
"length": {
"id": "http://jsonschema.net/length",
"type": "integer"
},
"label": {
"id": "http://jsonschema.net/label",
"type": "string"
},
"content": {
"id": "http://jsonschema.net/content",
"type": "string"
},
"placeholder": {
"id": "http://jsonschema.net/placeholder",
"type": "string"
},
"date": {
"id": "http://jsonschema.net/date",
"type": "string"
},
"option": {
"id": "http://jsonschema.net/option",
"type": "object",
"properties": {
"elementId": { "$ref": "#/definitions/elementId" },
"label": { "$ref": "#/definitions/label" }
},
"required": ["elementId", "label"]
},
"options": {
"id": "http://jsonschema.net/options",
"type": "array",
"items": { "$ref": "#/definitions/option" },
"minItems": 1,
"uniqueItems": true
},
"textfield": {
"id": "http://jsonschema.net/textfield",
"type": "object",
"properties": {
"elementId": { "$ref": "#/definitions/elementId" },
"length": { "$ref": "#/definitions/length" },
"label": { "$ref": "#/definitions/label" },
"placeholder": { "$ref": "#/definitions/placeholder" },
"textfieldType": {
"enum": [ "text", "ext4", "btrfs" ]
}
},
"required": ["elementId", "length", "label", "placeholder", "textfieldType"]
},
"checkbox": {
"id": "http://jsonschema.net/checkbox",
"type": "object",
"properties": {
"label": { "$ref": "#/definitions/label" }
},
"required": ["label"]
},
"radio": {
"id": "http://jsonschema.net/radio",
"type": "object",
"properties": {
"label": { "$ref": "#/definitions/label" },
"options": { "$ref": "#/definitions/options" }
},
"required": ["label", "options"]
},
"dropdown": {
"id": "http://jsonschema.net/dropdown",
"type": "object",
"properties": {
"label": { "$ref": "#/definitions/label" },
"options": { "$ref": "#/definitions/options" }
},
"required": ["label", "options"]
},
"validator": {
"id": "http://jsonschema.net/validator",
"type": "object",
"properties": {
"elementId": { "$ref": "#/definitions/elementId" }
}
},
"validators": {
"id": "http://jsonschema.net/validators",
"type": "array",
"items": { "$ref": "#/definitions/validator" }
},
"interactiveDetails": {
"type": "object",
"oneOf": [
{ "textfield": { "$ref": "#/definitions/textfield" } },
{ "checkbox": { "$ref": "#/definitions/checkbox" } },
{ "radio": { "$ref": "#/definitions/radio" } },
{ "dropdown": { "$ref": "#/definitions/dropdown" } },
{ "date": { "$ref": "#/definitions/date" } }
]
},
"interactive": {
"id": "http://jsonschema.net/interactive",
"type": "object",
"properties": {
"elementId": { "$ref": "#/definitions/elementId" },
"elementType": { "$ref": "#/definitions/elementType" },
"mappingKey": { "$ref": "#/definitions/mappingKey" },
"validators": { "$ref": "#/definitions/validators" },
"interactiveDetails" : { "$ref": "#/definitions/interactiveDetails" }
},
"required": ["elementId", "elementType", "mappingKey", "validators"]
},
"interactives": {
"id": "http://jsonschema.net/interactives",
"type": "array",
"items": { "$ref": "#/definitions/interactive" }
},
"description": {
"id": "http://jsonschema.net/description",
"type": "object",
"properties": {
"elementId": { "$ref": "#/definitions/elementId" },
"elementType": { "$ref": "#/definitions/elementType" },
"content": { "$ref": "#/definitions/content" }
},
"required": ["elementId", "elementType", "content"]
},
"descriptions": {
"items": { "$ref": "#/definitions/description" }
},
"children": {
"items": {
"anyOf": [
{ "$ref": "#/definitions/group" },
{ "$ref": "#/definitions/question" }
]
},
"minItems": 1
},
"question": {
"type": "object",
"properties": {
"elementId": { "$ref": "#/definitions/elementId" },
"descriptions": { "$ref": "#/definitions/descriptions" },
"interactives": { "$ref": "#/definitions/interactives" }
},
"required": ["elementId", "descriptions", "interactives"]
},
"group": {
"type": "object",
"properties": {
"elementId": { "$ref": "#/definitions/elementId" },
"descriptions": { "$ref": "#/definitions/descriptions" },
"children": { "$ref": "#/definitions/children"}
},
"required": ["elementId", "descriptions", "children"]
}
},
"type": "object",
"properties": {
"elementId": { "$ref": "#/definitions/elementId" },
"description": { "$ref": "#/definitions/descriptions" },
"children": { "$ref": "#/definitions/children" }
},
"required": [
"elementId",
"descriptions",
"children"
]
}
I'm getting the following error:
Error when resolving schema reference '#/definitions/elementId'. Path 'definitions.description.properties.elementId', line 135, position 30.
I cannot figure out what the problem is. I scanned the documentation several times and had a look at tutorials, but I do not have any clue.
The semantics of the id keyword are are a bit confusing. I'm not sure I completely understand it myself. In general it is almost never a good idea to include id anywhere other than the root of your schema.
The "id" keyword (or "id", for short) is used to alter the resolution scope. When an id is encountered, an implementation MUST resolve this id against the most immediate parent scope. The resolved URI will be the new resolution scope for this subschema and all its children, until another id is encountered.
http://json-schema.org/latest/json-schema-core.html#anchor27
Consider the following excerpt from you schema. Because you include the id keyword, your "elementId" and "label" $refs don't resolve against the root of the document as you expect, they resolve from the nearest parent schema id.
"option": {
"id": "http://jsonschema.net/option",
"type": "object",
"properties": {
"elementId": { "$ref": "#/definitions/elementId" },
"label": { "$ref": "#/definitions/label" }
},
"required": ["elementId", "label"],
"definitions": { ... } <-- your $refs expect values here
}
},
I have seen that in some circles, people write schemas with ids for every subschema. I'm not sure what benefit they think they are getting out of doing that, but I suspect that they think of id as just a label and don't understand how it alters resolution scope.
If you do have good reason to use ids everywhere and want to leave them in, you can always explicitly reference the root id when you have a conflict.
{ "$ref": "http://some.site.somewhere/entry-schema#definitions/elementId" }
I'm using the Azure Resource Group project template in Visual studio to deploy two API Apps and a Logic App. I want one of those API Apps to be a Blob Connector from the marketplace. What I need is the uri of the .zip package for the connector, as shown here:
{
"apiVersion": "2014-06-01",
"name": "MSDeploy",
"type": "Extensions",
"dependsOn": [
//........
],
"properties": {
"packageUri": "https://auxmktplceprod.blob.core.windows.net/packages/UmbracoCms.WebPI.7.2.5.zip",
"dbType": "SQL",
(source)
I tried this solution, but that cmdlet is now deprecated. Is there any way to get these URIs?
-Thanks!
I found a way of deploying custom api app with Marketplace apps.
Below is a sample script to just guide you
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"blobConnectorName": {
"type": "string",
"minLength": 1,
"defaultValue" : "mytestblobconnector"
},
"blobStorageAccount": {
"type": "string",
"minLength": 1,
"defaultValue" : "mystorage.blob.core.windows.net"
},
"blobStorageKey": {
"type": "securestring",
"minLength": 1,
"defaultValue" : "storgekey"
},
"blobContainerName": {
"type": "string",
"minLength": 1,
"defaultValue" : "mycontainer"
},
"gatewayName": {
"type": "string",
"minLength": 1,
"defaultValue" : "myblobconnectorgateway"
},
"logicAppName": {
"type": "string",
"minLength": 1,
"defaultValue" : "testinglogicapp"
},
"svcPlanName": {
"type": "string",
"minLength": 1,
"defaultValue" : "myresourcegrpserviceplan"
},
"sku": {
"type": "string",
"defaultValue": "Basic",
"allowedValues": [
"Free",
"Basic",
"Standard",
"Premium"
]
},
"svcPlanSize": {
"defaultValue": "0",
"type": "string",
"allowedValues": [
"0",
"1",
"2"
]
},
"gatewayToApiAppSecret": {
"defaultValue": "0000000000000000000000000000000000000000000000000000000000000000",
"type": "securestring"
}
},
"variables": {
"$packageId": "Microsoft.ApiApp",
"$nugetFeed": "http://apiapps-preview.nuget.org/api/v2/"
},
"resources": [
{
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2015-04-01",
"name": "[parameters('svcPlanName')]",
"location": "[resourceGroup().location]",
"tags": {
"displayName": "AppServicePlan"
},
"properties": {
"name": "[parameters('svcPlanName')]",
"sku": "[parameters('sku')]",
"workerSize": "[parameters('svcPlanSize')]",
"numberOfWorkers": 1
}
},
{
"type": "Microsoft.Web/sites",
"apiVersion": "2015-04-01",
"name": "[parameters('gatewayName')]",
"location": "[resourceGroup().location]",
"kind": "gateway",
"tags": {
"displayName": "GatewayHost"
},
"resources": [
{
"type": "providers/links",
"apiVersion": "2015-01-01",
"name": "Microsoft.Resources/gateway",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('gatewayName'))]"
],
"properties": {
"targetId": "[resourceId('Microsoft.AppService/gateways', parameters('gatewayName'))]"
}
}
],
"dependsOn": [
"[concat(resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('svcPlanName'))]"
],
"properties": {
"name": "[parameters('gatewayName')]",
"gatewaySiteName": "[parameters('gatewayName')]",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('svcPlanName'))]",
"siteConfig": {
"appSettings": [
{
"name": "ApiAppsGateway_EXTENSION_VERSION",
"value": "latest"
},
{
"name": "EmaStorage",
"value": "D:\\home\\data\\apiapps"
},
{
"name": "WEBSITE_START_SCM_ON_SITE_CREATION",
"value": "1"
}
]
}
}
},
{
"type": "Microsoft.AppService/gateways",
"apiVersion": "2015-03-01-preview",
"name": "[parameters('gatewayName')]",
"location": "[resourceGroup().location]",
"tags": {
"displayName": "Gateway"
},
"resources": [
{
"type": "providers/links",
"apiVersion": "2015-01-01",
"name": "Microsoft.Resources/gatewaySite",
"dependsOn": [
"[resourceId('Microsoft.AppService/gateways', parameters('gatewayName'))]"
],
"properties": {
"targetId": "[resourceId('Microsoft.Web/sites', parameters('gatewayName'))]"
}
},
{
"type": "tokens",
"apiVersion": "2015-03-01-preview",
"location": "[resourceGroup().location]",
"name": "[parameters('logicAppName')]",
"tags": {
"displayName": "AuthenticationToken"
},
"dependsOn": [
"[resourceId('Microsoft.AppService/gateways', parameters('gatewayName'))]"
]
}
],
"dependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('gatewayName'))]"
],
"properties": {
"host": {
"resourceName": "[parameters('gatewayName')]"
}
}
},
{
"type": "Microsoft.Web/sites",
"apiVersion": "2015-04-01",
"name": "[parameters('blobConnectorName')]",
"location": "[resourceGroup().location]",
"kind": "apiApp",
"tags": {
"displayName": "APIAppHost",
"packageId": "AzureStorageBlobConnector"
},
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', parameters('svcPlanName'))]",
"[resourceId('Microsoft.AppService/gateways', parameters('gatewayName'))]"
],
"resources": [
{
"type": "siteextensions",
"tags": {
"displayName": "APIAppExtension"
},
"apiVersion": "2015-02-01",
"name": "AzureStorageBlobConnector",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('blobConnectorName'))]"
],
"properties": {
"type": "WebRoot",
"feed_url": "[variables('$nugetFeed')]"
}
},
{
"type": "providers/links",
"apiVersion": "2015-01-01",
"name": "Microsoft.Resources/apiApp",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('blobConnectorName'))]"
],
"properties": {
"targetId": "[resourceId('Microsoft.AppService/apiapps', parameters('blobConnectorName'))]"
}
}
],
"properties": {
"gatewaySiteName": "[parameters('gatewayName')]",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('svcPlanName'))]",
"siteConfig": {
"appSettings": [
{
"name": "EMA_MicroserviceId",
"value": "[parameters('blobConnectorName')]"
},
{
"name": "EMA_Secret",
"value": "[parameters('gatewayToAPIappSecret')]"
},
{
"name": "EMA_RuntimeUrl",
"value": "[concat('https://', reference(resourceId('Microsoft.Web/sites', parameters('gatewayName'))).hostNames[0])]"
},
{
"name": "WEBSITE_START_SCM_ON_SITE_CREATION",
"value": "1"
},
{
"name": "BlobConnector_ContainerUrl",
"value": "[concat('https://', parameters('blobStorageAccount'),'/',parameters('blobContainerName'))]"
},
{
"name": "BlobConnector_AccessKey",
"value": "[parameters('blobStorageKey')]"
}
],
"applicationLogs": {
"filesystem": {
"level": "Verbose"
},
"azureTableStorage": {
"level": "Off",
"sasUrl": null
},
"azureBlobStorage": {
"level": "Off",
"sasUrl": null,
"retentionInDays": null
}
}
}
}
},
{
"type": "Microsoft.AppService/apiapps",
"apiVersion": "2015-03-01-preview",
"name": "[parameters('blobConnectorName')]",
"location": "[resourceGroup().location]",
"tags": {
"displayName": "BlobConnector"
},
"resources": [
{
"type": "providers/links",
"apiVersion": "2015-01-01",
"name": "Microsoft.Resources/apiAppSite",
"dependsOn": [
"[resourceId('Microsoft.AppService/apiapps', parameters('blobConnectorName'))]"
],
"properties": {
"targetId": "[resourceId('Microsoft.Web/sites', parameters('blobConnectorName'))]"
}
}
],
"dependsOn": [
"[resourceId('Microsoft.Web/sites/siteextensions', parameters('blobConnectorName'), 'AzureStorageBlobConnector')]"
],
"properties": {
"package": {
"id": "AzureStorageBlobConnector"
},
"host": {
"resourceName": "[parameters('blobConnectorName')]"
},
"gateway": {
"resourceName": "[parameters('gatewayName')]"
},
"dependencies": [ ]
}
},
{
"type": "Microsoft.Logic/workflows",
"apiVersion": "2015-02-01-preview",
"name": "[parameters('logicAppName')]",
"location": "[resourceGroup().location]",
"tags": {
"displayName": "LogicApp"
},
"dependsOn": [
"[resourceId('Microsoft.AppService/apiApps', parameters('blobConnectorName'))]"
],
"properties": {
"sku": {
"name": "[parameters('sku')]",
"plan": {
"id": "[concat(resourceGroup().id, '/providers/Microsoft.Web/serverfarms/',parameters('svcPlanName'))]"
}
},
"definition": {
"$schema": "http://schema.management.azure.com/providers/Microsoft.Logic/schemas/2014-12-01-preview/workflowdefinition.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"token": {
"defaultValue": "[reference(resourceId('Microsoft.AppService/gateways/tokens', parameters('gatewayName'), parameters('logicAppName'))).token]",
"type": "String",
"metadata": {
"token": {
"name": "token"
}
}
},
"runworkflowmanually": {
"defaultValue": true,
"type": "Bool"
}
},
"triggers": { },
"actions": {
"azurestorageblobconnector": {
"type": "ApiApp",
"inputs": {
"apiVersion": "2015-01-14",
"host": {
"id": "[concat(resourceGroup().id, '/providers/Microsoft.AppService/apiApps/',parameters('blobConnectorName'))]",
"gateway": "[concat('https://', reference(resourceId('Microsoft.Web/sites', parameters('gatewayName'))).hostNames[0])]"
},
"operation": "UploadBlob",
"parameters": {
"BlobPath": "myfolder/test.txt",
"BlobContent": {
"Content": "TestMessage",
"ContentTransferEncoding": "None"
},
"Overwrite": true
},
"authentication": {
"type": "Raw",
"scheme": "Zumo",
"parameter": "#parameters('token')"
}
},
"conditions": [ ]
}
},
"outputs": {
}
},
"parameters": { }
}
}
]
}
Just search for "AzureStorageBlobConnector" in the above json to observe the usage which is the package id of the blob connector from marketplace. I found the package id for the blob connector from azure portal by deploying one manually and then checking its settings. Please feel free to post a comment for package id for other market place apps if you face any difficulty.