Functions - Retrieve Default Definition

Retrieves the default definition of a function based on the parameters specified.

POST https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}/functions/{functionName}/RetrieveDefaultDefinition?api-version=2016-03-01

URI Parameters

Name In Required Type Description
functionName
path True
  • string

The name of the function.

jobName
path True
  • string

The name of the streaming job.

resourceGroupName
path True
  • string

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

subscriptionId
path True
  • string

GUID which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

api-version
query True
  • string

Client Api Version.

Request Body

The request body can be one of the following:

Name Description
AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters

The parameters needed to retrieve the default function definition for an Azure Machine Learning web service function.

JavaScriptFunctionRetrieveDefaultDefinitionParameters

The parameters needed to retrieve the default function definition for a JavaScript function.

AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters

The parameters needed to retrieve the default function definition for an Azure Machine Learning web service function.

Name Type Description
bindingRetrievalProperties.executeEndpoint
  • string

The Request-Response execute endpoint of the Azure Machine Learning web service. Find out more here: https://docs.microsoft.com/en-us/azure/machine-learning/machine-learning-consume-web-services#request-response-service-rrs

bindingRetrievalProperties.udfType

The function type.

bindingType string:
  • Microsoft.MachineLearning/WebService

Indicates the function binding type.

JavaScriptFunctionRetrieveDefaultDefinitionParameters

The parameters needed to retrieve the default function definition for a JavaScript function.

Name Type Description
bindingRetrievalProperties.script
  • string

The JavaScript code containing a single function definition. For example: 'function (x, y) { return x + y; }'.

bindingRetrievalProperties.udfType

The function type.

bindingType string:
  • Microsoft.StreamAnalytics/JavascriptUdf

Indicates the function binding type.

Responses

Name Type Description
200 OK

Successfully retrieved the function's default definition.

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

Retrieve the default definition for an Azure ML function

Sample Request

POST https://management.azure.com/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourcegroups/sjrg7/providers/Microsoft.StreamAnalytics/streamingjobs/sj9093/functions/function588/RetrieveDefaultDefinition?api-version=2016-03-01
{
  "bindingType": "Microsoft.MachineLearning/WebService",
  "bindingRetrievalProperties": {
    "executeEndpoint": "someAzureMLExecuteEndpointUrl",
    "udfType": "Scalar"
  }
}

Sample Response

{
  "name": "function588",
  "properties": {
    "type": "Scalar",
    "properties": {
      "inputs": [
        {
          "dataType": "nvarchar(max)"
        }
      ],
      "output": {
        "dataType": "nvarchar(max)"
      },
      "binding": {
        "type": "Microsoft.MachineLearning/WebService",
        "properties": {
          "endpoint": "someAzureMLExecuteEndpointUrl",
          "inputs": {
            "name": "input1",
            "columnNames": [
              {
                "name": "tweet",
                "dataType": "string",
                "mapTo": 0
              }
            ]
          },
          "outputs": [
            {
              "name": "Sentiment",
              "dataType": "string"
            }
          ],
          "batchSize": 1000
        }
      }
    }
  }
}

Definitions

AzureMachineLearningWebServiceFunctionBinding

The binding to an Azure Machine Learning web service.

AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters

The parameters needed to retrieve the default function definition for an Azure Machine Learning web service function.

AzureMachineLearningWebServiceInputColumn

Describes an input column for the Azure Machine Learning web service endpoint.

AzureMachineLearningWebServiceInputs

The inputs for the Azure Machine Learning web service endpoint.

AzureMachineLearningWebServiceOutputColumn

Describes an output column for the Azure Machine Learning web service endpoint.

Function

A function object, containing all information associated with the named function. All functions are contained under a streaming job.

FunctionInput

Describes one input parameter of a function.

FunctionOutput

Describes the output of a function.

JavaScriptFunctionBinding

The binding to a JavaScript function.

JavaScriptFunctionRetrieveDefaultDefinitionParameters

The parameters needed to retrieve the default function definition for a JavaScript function.

ScalarFunctionProperties

The properties that are associated with a scalar function.

UdfType

The function type.

AzureMachineLearningWebServiceFunctionBinding

The binding to an Azure Machine Learning web service.

Name Type Description
properties.apiKey
  • string

The API key used to authenticate with Request-Response endpoint.

properties.batchSize
  • integer

Number between 1 and 10000 describing maximum number of rows for every Azure ML RRS execute request. Default is 1000.

properties.endpoint
  • string

The Request-Response execute endpoint of the Azure Machine Learning web service. Find out more here: https://docs.microsoft.com/en-us/azure/machine-learning/machine-learning-consume-web-services#request-response-service-rrs

properties.inputs

The inputs for the Azure Machine Learning web service endpoint.

properties.outputs

A list of outputs from the Azure Machine Learning web service endpoint execution.

type string:
  • Microsoft.MachineLearning/WebService

Indicates the function binding type.

AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters

The parameters needed to retrieve the default function definition for an Azure Machine Learning web service function.

Name Type Description
bindingRetrievalProperties.executeEndpoint
  • string

The Request-Response execute endpoint of the Azure Machine Learning web service. Find out more here: https://docs.microsoft.com/en-us/azure/machine-learning/machine-learning-consume-web-services#request-response-service-rrs

bindingRetrievalProperties.udfType

The function type.

bindingType string:
  • Microsoft.MachineLearning/WebService

Indicates the function binding type.

AzureMachineLearningWebServiceInputColumn

Describes an input column for the Azure Machine Learning web service endpoint.

Name Type Description
dataType
  • string

The (Azure Machine Learning supported) data type of the input column. A list of valid Azure Machine Learning data types are described at https://msdn.microsoft.com/en-us/library/azure/dn905923.aspx .

mapTo
  • integer

The zero based index of the function parameter this input maps to.

name
  • string

The name of the input column.

AzureMachineLearningWebServiceInputs

The inputs for the Azure Machine Learning web service endpoint.

Name Type Description
columnNames

A list of input columns for the Azure Machine Learning web service endpoint.

name
  • string

The name of the input. This is the name provided while authoring the endpoint.

AzureMachineLearningWebServiceOutputColumn

Describes an output column for the Azure Machine Learning web service endpoint.

Name Type Description
dataType
  • string

The (Azure Machine Learning supported) data type of the output column. A list of valid Azure Machine Learning data types are described at https://msdn.microsoft.com/en-us/library/azure/dn905923.aspx .

name
  • string

The name of the output column.

Function

A function object, containing all information associated with the named function. All functions are contained under a streaming job.

Name Type Description
id
  • string

Resource Id

name
  • string

Resource name

properties FunctionProperties:

The properties that are associated with a function.

type
  • string

Resource type

FunctionInput

Describes one input parameter of a function.

Name Type Description
dataType
  • string

The (Azure Stream Analytics supported) data type of the function input parameter. A list of valid Azure Stream Analytics data types are described at https://msdn.microsoft.com/en-us/library/azure/dn835065.aspx

isConfigurationParameter
  • boolean

A flag indicating if the parameter is a configuration parameter. True if this input parameter is expected to be a constant. Default is false.

FunctionOutput

Describes the output of a function.

Name Type Description
dataType
  • string

The (Azure Stream Analytics supported) data type of the function output. A list of valid Azure Stream Analytics data types are described at https://msdn.microsoft.com/en-us/library/azure/dn835065.aspx

JavaScriptFunctionBinding

The binding to a JavaScript function.

Name Type Description
properties.script
  • string

The JavaScript code containing a single function definition. For example: 'function (x, y) { return x + y; }'

type string:
  • Microsoft.StreamAnalytics/JavascriptUdf

Indicates the function binding type.

JavaScriptFunctionRetrieveDefaultDefinitionParameters

The parameters needed to retrieve the default function definition for a JavaScript function.

Name Type Description
bindingRetrievalProperties.script
  • string

The JavaScript code containing a single function definition. For example: 'function (x, y) { return x + y; }'.

bindingRetrievalProperties.udfType

The function type.

bindingType string:
  • Microsoft.StreamAnalytics/JavascriptUdf

Indicates the function binding type.

ScalarFunctionProperties

The properties that are associated with a scalar function.

Name Type Description
etag
  • string

The current entity tag for the function. This is an opaque string. You can use it to detect whether the resource has changed between requests. You can also use it in the If-Match or If-None-Match headers for write operations for optimistic concurrency.

properties.binding FunctionBinding:

The physical binding of the function. For example, in the Azure Machine Learning web service’s case, this describes the endpoint.

properties.inputs

A list of inputs describing the parameters of the function.

properties.output

The output of the function.

type string:
  • Scalar

Indicates the type of function.

UdfType

The function type.

Name Type Description
Scalar
  • string