Writing json to Azure Table Storage throws type error
hmqgg opened this issue · 1 comments
hmqgg commented
When I use json.dump(somejson, f)
, it throws
TypeError: a bytes-like object is required, not 'str'
.
And if I use json.dumps(somejson, f)
, it throws
Microsoft.Azure.WebJobs.Host: Object reference not set to an instance of an object.
It should be
with open(os.environ['someTable'], 'w') as f:
json.dump(somejson, f);