Table Storage Binding doesn't allow for access or filtering of Table Storage 'Timestamp' property
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- azure, typescript
Direzione di ricerca
Inizia con la funzione attivata dal timer e la relativa configurazione del binding della tabella, quindi riproduci l'output di context.bindings.eventTable usando l'esempio TypeScript fornito. Traccia il modo in cui il worker Node.js mappa le righe di Azure Table e gestisce il filtro Timestamp. Il lavoro è completato quando Timestamp è disponibile nelle righe associate e può essere usato nel filtro del binding senza errori.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Investigative information
Upon retrieving the whole table via my bindings in a function that is triggered on a timer, (see below).
{
"bindings": [
{
"name": "myTimer",
"type": "timerTrigger",
"direction": "in",
"schedule": "0 */1 * * * *"
},
{
"name": "eventTable",
"type": "table",
"tableName": "HeartbeatEvents",
"direction": "in"
}
],
"scriptFile": "../dist/src/heartbeat-scheduler/index.js"
}
I would expect that the property Timestamp which is a property maintained by the Storage Table server is included in the eventTable binding in the code and be accessible as a property of the array elements of the eventTable, i.e
context.bindings.eventTable.forEach((row) => {
context.log(row.Timestamp);
});
Instead it is undefined.
In the case of the storage table I am using a very basic set up like so,

And when I run the function locally, it is not deployed yet, I get the following output through context logging,
[16/07/2020 1:51:00 am] Executing 'Functions.heartbeat-scheduler' (Reason='Timer fired at 2020-07-16T13:51:00.0093734+12:00', Id=9972164a-5a33-4f68-a240-95e6b7b6db20)
[16/07/2020 1:51:00 am] Heartbeat Logging Triggered on: Thu Jul 16 2020 13:51:00 GMT+1200
[16/07/2020 1:51:00 am] [
{
Status: 'received',
TransactionId: '40574c28-0478-4aeb-a568-40cfea7b957c',
PartitionKey: 'com.triquestra.cloudevents.salesinvoices.heartbeat',
RowKey: 'tq-site_code-101'
},
{
Status: 'received',
TransactionId: '50574c28-0478-4aeb-a568-40cfea7b957c',
PartitionKey: 'com.triquestra.cloudevents.salesinvoices.heartbeat',
RowKey: 'tq-site_code-102'
}
]
[16/07/2020 1:51:00 am] Row 0 has timestamp of: undefined
[16/07/2020 1:51:00 am] Row 0 has new heartbeat
[16/07/2020 1:51:00 am] Row 1 has timestamp of: undefined
[16/07/2020 1:51:00 am] Row 1 has new heartbeat
[16/07/2020 1:51:00 am] Executed 'Functions.heartbeat-scheduler' (Succeeded, Id=9972164a-5a33-4f68-a240-95e6b7b6db20)
Note how Timestamp is excluded.
As this function is only local at the moment I do not have any function id information yet.
Reproduction steps
- Create a storage table and insert a record (Note that the timestamp field is automatically created and updated)
- Create a basic timer-triggered application. (This application was built off the example provided here.)
- Link the storage account associated with the table in your local settings.
- Try to access the table row's in the timerTrigger function and see that Timestamp is inaccessible.
Expected behavior
Expected that Timestamp is accessible for use in the function code.
Actual behavior
Any attempts to access Timestamp returns undefined.
Known workarounds
None known so far. Although I did try adding a filter to the binding to limit by Timestamp and it throws an error. (Accessing other valid properties within the table were fine.)
Related information
The function was built in typescript with the only dependency being moment.js. The source for the function is copied below for fast reproduction of the issue.
Source
import { AzureFunction, Context } from '@azure/functions';
import moment from 'moment';
import { triggerStartMessage } from '../resources/constants';
const timerTrigger: AzureFunction = async function (
context: Context,
myTimer: any
): Promise<void> {
const now = moment();
const timeStamp = now.toString();
const fifteenMinutesAgo = now.subtract(15, 'minutes');
context.log(triggerStartMessage(timeStamp));
context.log(context.bindings.eventTable);
const checkHeartbeat = (row, index) => {
const isOldHeartbeat = fifteenMinutesAgo.isAfter(row.Timestamp);
context.log(`Row ${index} has timestamp of: ${row.Timestamp}`);
if (isOldHeartbeat) {
context.log(`Row ${index} has old heartbeat`);
} else {
context.log(`Row ${index} has new heartbeat`);
}
}
context.bindings.eventTable.map(checkHeartbeat);
};
export default timerTrigger;
- Lingua principale
- TypeScript
- Stelle
- 110
- Fork
- 52
- Merge medio
- 1g 4h
- PR unite (30g)
- 2
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Azure/azure-functions-nodejs-worker
-
Handle valid prerelease Node.js versions without failing worker initializationForse già presa @TsuyoshiUshio l’ha presa 43 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
area:nodejs-functions dependencies engineering tests
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
-
Specialization race: double startApp() with stale require cache leaves worker on default v3 model with all functions unloadableForse già presa @swapnil-nagar l’ha presa 48 giorni fa. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
Azure/azure-functions-nodejs-worker#838 · 1 commento ·
-
c-ares DNS misconfiguration on Windows Consumption causes mongodb+srv:// and dns.resolve*() failuresAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 64/100
Azure/azure-functions-nodejs-worker#830 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
Tutte le issue di Azure/azure-functions-nodejs-worker
Issue simili
-
[Bug]: Server git tests sign fixture commits with the developer's key when run from the repo rootAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
melgarafael/DeskcommCRM#2657 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
MystenLabs/MemWal#1163 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
"Explore the letters"-button should read "Explore the papers"Forse già presa Una pull request collegata a questa issue è aperta o già unita. ApertaMondriaan
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
knaw-huc/textannoviz#709 ·
I maintainer di solito rispondono entro 1 giorno
-
billion-context-pi
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
ranxianglei/billion-context#2521 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno