0
votes

Could someone please tell me whether it is possible to assign same value for both Partitionkey and Rowkey in Azure Functionapp?

Many Thanks in advance

2
Not exactly sure what you're asking, but partition key and row key are separate properties. Did you run into an issue?David Makogon
yes.when I assign same value for rowkey and partition key in the eventhub trigger javascript functionapp ..there is an exception .The inpt for functionapp is iothub and output is azure table storage. {var date = Date.now(); var partitionKey = date+ ' '; var rowKey = date + ''; }Schatz

2 Answers

1
votes

Based on your description, I just created my Http Trigger for Node.js to check this issue.

function.json:

{
  "bindings": [
    {
      "authLevel": "function",
      "type": "httpTrigger",
      "direction": "in",
      "name": "req"
    },
    {
      "type": "http",
      "direction": "out",
      "name": "res"
    },
    {
      "type": "table",
      "name": "outputTable",
      "tableName": "emails",
      "connection": "AzureWebJobsDashboard",
      "direction": "out"
    }
  ],
  "disabled": false
}

index.js:

var date=Date.now();
var key=date+'-'+Math.ceil(Math.random()*1000);
context.bindings.outputTable = {
    "partitionKey": key,
    "rowKey":key,
    "GPIOPin":2,
    'status':true
};

Leverage Azure Storage Explorer to check my table as follows:

enter image description here

For more details about the output sample for Table storage binding, you could refer to here.

0
votes

It is possible. The design consequences will be that you will have partitions with a size of one entity. Remember that batch operations and transaction support are limited to entities in the same partition.