services.AddDbContext<DataContext>(options => options.UseNpgsql(dbConnection, providerOptions => providerOptions.EnableRetryOnFailure()), ServiceLifetime.Transient);


"RedisEdge": {"settings": {"image": "marketplace.azurecr.io/garantiadata/redis-edge","createOptions": {
"HostConfig": {
"PortBindings": {
"6379/tcp": [
{
"HostPort": "6379"
}
]
}
}
}},"type": "docker","status": "running","restartPolicy": "always","version": "1.0"},

"postgres": {"settings": {"image": "your_acr/timescaledb:2.1.1-pg13","createOptions": "{\"HostConfig\":{\"Binds\":[\"/var/lib/docker/volumes/postgres/_data:/var/lib/postgresql/data\"],\"PortBindings\":{\"9180/tcp\":[{\"HostPort\":\"9180\"}],\"5432/tcp\":[{\"HostPort\":\"5432\"}]}},\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"10m\",\"max-file\":\"3\"}}}"},"type": "docker","version": "1.0","env": {"POSTGRES_PASSWORD": {"value": "yourpassword"}},"status": "running","restartPolicy": "always"}

Prerequisites

Creating Module Deployment


Prerequisites

Creating SSH Public Key


az iot hub invoke-module-method --method-name 'RestartModule' -n <hub name> -d <device name> -m '$edgeAgent' --method-payload 
'{ "schemaVersion": "1.0", "id": "<module name>" }'
DirectMethod Name : RestartModule
Parameter :
{
"schemaVersion": "1.0",
"id": "<module name>"
}
az iot hub invoke-module-method — method-name ‘ping’ -n <hub name> -d <device name> -m ‘$edgeAgent’
DirectMethod Name : ping
Parameter : {}


.create table tableName(ColumnName:datatype)
.create-or-alter table tableName(ColumnName:datatype)
.create table tableName ingestion json mapping “mappingName”
‘[‘
‘ { “column” : “tableColumnName”, “Properties”:{“Path”:”$.jsonproperty”}},’
‘ { “column” : “tableColumnName”, “Properties”:{“Path”:”$.jsonproperty.innerjsonproperty”}},’
‘ { “column” : “full_text”, “Properties”:{“Path”:”$”}}’
‘]’
.drop table tableName
.clear table tableName data
.alter column [‘tableName’].[‘tableColumnName’] type=datatype

TimeDifference = DATEDIFF(CONVERT(VALUE(FIRSTNONBLANK(TableName[GlobalDateTime], 1)), DATETIME), CONVERT(VALUE(FIRSTNONBLANK(TableName[LocalDateTime], 1)), DATETIME), MINUTE)/60
TimeDifferenceDisplay = CONCATENATE(IF([TimeDifference] >0 , “GMT + “ , “GMT “), [TimeDifference])

Gibin Francis

Am an IoT developer interested in microsoft technologies and cloud technologies

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store