I have following JSON file (product.json) stored in Azure Blob storage. Is it possible to write PowerShell script to read this file from blob storage make some changes and write back to another file. The output file I would like where following changes should occur:
- Replace all "_id" with "id"
- Remove all "_rev" and their values.
Product.json
[
{
"_id": "9f4da9d6babeb9d411c896baa68c94c8",
"_rev": "1-4259271795225df18768ab68baacc96c",
"account_id": 692278,
"limit": 10000,
"products": [
"Commodity",
"InvestmentStock"
]
},
{
"_id": "cc4b59f585b8556a2bedca78294a0797",
"_rev": "1-410e479257faba0457bd9b4816c4dc95",
"account_id": 328304,
"limit": 10000,
"products": [
"Derivatives",
"InvestmentStock",
"CurrencyService"
]
},
{
"_id": "d7e2a72963cff2760514ff772969ffe0",
"_rev": "1-2ec6e2679eae13b76410c93f49c14c4a",
"account_id": 674364,
"limit": 10000,
"products": [
"InvestmentStock"
]
}
]
The outputfile.json should be as follows:
[
{
"id": "9f4da9d6babeb9d411c896baa68c94c8",
"account_id": 692278,
"limit": 10000,
"products": [
"Commodity",
"InvestmentStock"
]
},
{
"id": "cc4b59f585b8556a2bedca78294a0797",
"account_id": 328304,
"limit": 10000,
"products": [
"Derivatives",
"InvestmentStock",
"CurrencyService"
]
},
{
"id": "d7e2a72963cff2760514ff772969ffe0",
"account_id": 674364,
"limit": 10000,
"products": [
"InvestmentStock"
]
}
]