I would suggest you create a stored procedure to deal with the json data, then you pass the JSON data into the Azure SQL database by a stored procedure.
Ref the stored procedure example:
CREATE TABLE dbo.SystemRecord(
RecordedDateTime datetime2(0) NOT NULL,
RecordedDateTimeLocal datetime2(0) NOT NULL,
CpuPctProcessorTime smallint NOT NULL,
MemAvailGbytes smallint NOT NULL
)
CREATE PROCEDURE dbo.InsertSystemRecordData
@json NVARCHAR(max)
AS
BEGIN
INSERT INTO dbo.SystemRecord (
[RecordedDateTime]
, [RecordedDateTimeLocal]
, [CpuPctProcessorTime]
, [MemAvailGbytes])
SELECT
RecordedDateTime
,RecordedDateTimeLocal
,CpuPctProcessorTime
,MemAvailGbytes
FROM OPENJSON(@json)
WITH (
RecordedDateTime DATETIME2(0) '$.dateTime'
, RecordedDateTimeLocal DATETIME2(0) '$.dateTimeLocal'
, CpuPctProcessorTime SMALLINT '$.cpuPctProcessorTime'
, MemAvailGbytes SMALLINT '$.memAvailGbytes'
) AS jsonValues
END
EXEC dbo.InsertSystemRecordData @json ='{"dateTime":"2018-03-19T15:15:40.222Z","dateTimeLocal":"2018-03-19T11:15:40.222Z","cpuPctProcessorTime":"0","memAvailGbytes":"28"}'
You could ref these links:
- Pass json_value into stored procedure
- How to Insert JSON Data into SQL Server Database
HTH.