Logic App Storage Table CRUD Operations
Logic app Storage Table Operations with REST API:
|
Storage
Account Name |
ehaseprodintcorplast |
|
Storage Table
Name |
dkpoc |
|
Authentication |
managed
identity (add Storage Access Control to “Storage Table Data Contributor” role to your logic app) |
Storage Table look like
·
Read All rows
|
|
{ "type": "Http", "inputs": {
"uri": "https://<storagename>.table. core.windows.net/dkpoc",
"method": "GET",
"headers": {
"Accept": "application/json; odata=nometadata",
"Content-Type": "application/xml",
"x-ms-version": "2019-07-07"
},
"authentication": {
"type": "ManagedServiceIdentity",
"audience": "https://storage.azure.com"
} }, "runAfter": {
"HTTP-WriteBlob": [
"SUCCEEDED"
] } } |
·
Read Specific rows
|
|
{ "type": "Http", "inputs": {
"uri":"https://<storagename>.table .core.windows.net/dkpoc (PartitionKey='LogicApp',RowKey='1')",
"method": "GET",
"headers": {
"Accept": "application/json;odata=nometadata",
"Content-Type": "application/xml",
"x-ms-version": "2020-04-08"
},
"authentication": {
"type": "ManagedServiceIdentity",
"audience": "https://storage.azure.com"
} }, "runAfter": {
"DataFromTable": [
"SUCCEEDED"
] } } |
·
Write into the Storage Table
|
|
{ "type": "Http", "inputs": {
"uri": "https//<storagename>.table. core.windows.net/dkpoc",
"method": "POST",
"headers": {
"Accept": "application/json;odata=nometadata",
"Content-Type": "application/json",
"x-ms-version": "2020-04-08"
},
"body": {
"PartitionKey": "LogicApp",
"RowKey": "@variables('varRowKey')",
"Name": "deepak",
"ID": 123
},
"authentication": {
"type": "ManagedServiceIdentity",
"audience": "https://storage.azure.com"
} }, "runAfter": {
"HTTP-ReadTable-One": [
"SUCCEEDED"
] } } |
·
Update Storage Table row
|
|
{ "type": "Http", "inputs": {
"uri":"https://<storagename>.table. core.windows.net/dkpoc (PartitionKey='LogicApp',RowKey= '@{variables('varRowKey')}')",
"method": "PATCH",
"headers": {
"Accept": "application/json;odata=nometadata",
"Content-Type": "application/json",
"x-ms-version": "2020-04-08"
},
"body": {
"Name": "deepak-updated",
"ID": "124"
},
"authentication": {
"type": "ManagedServiceIdentity",
"audience": "https://storage.azure.com"
} }, "runAfter": {
"HTTP-WriteTable": [
"SUCCEEDED"
] } } |
·
Delete Storage Table row
|
|
{ "type": "Http", "inputs": {
"uri": "https://<storagename>. table.core.windows.net/dkpoc (PartitionKey='LogicApp',RowKey='1')",
"method": "DELETE",
"headers": {
"Accept": "application/json",
"Content-Type": "application/xml",
"x-ms-version": "2020-04-08"
},
"authentication": {
"type": "ManagedServiceIdentity",
"audience": "https://storage.azure.com"
} }, "runAfter": {
"HTTP-UpdateTable": [
"SUCCEEDED"
] } } |
Let me know if it helps...
Thanks,
Deepak SHAW
Comments
Post a Comment