In Azure, I have a javascript HTTPTrigger Function App with:
const azure = require('azure-storage')
const tableSvc = azure.createTableService(
process.env.COSMOS_TABLE_ACCOUNT,
process.env.COSMOS_TABLE_KEY,
process.env.COSMOS_TABLE_ENDPOINT
)
const entGen = azure.TableUtilities.entityGenerator
const testData = {
PartitionKey: entGen.String('test'),
RowKey: entGen.String(1),
name: entGen.String('It works!')
}
const insertTestData = () => new Promise((resolve, reject) => {
tableSvc.insertEntity('tests', testData, (error, res) => {
if (error) return reject(error)
resolve(res)
})
})
...
I've confirmed that the environment variables are all set and populated with the values from Azure Cosmos DB -> Cosmos Table Instance -> Connection String.
I've also tried connecting with:
const tableSvc = azure.createTableService(
process.env.COSMOS_TABLE_CONNECTION_STRING
)
When I call insertTestData()
, I'm getting back an error back from the .insertEntity
callback with an empty object: {}
. No entities are being added to my tests
table, as confirmed by the Data Explorer.
Any ideas how to perform this operation or get more information in my debugger? I have an Insight monitor attached to the process, but it reports a successful completion.