Skip to content
Advertisement

Azure LogicApp cannot get rowid from SQL Server

I have an Azure logicapp that connects to a SQL Server database in Azure. The table has a uniqueidentifier column as the primary key. In the logic app the delete or update requires the rowid in order to perform update, the primary key does not work here and throws an error when running, stating that the table does not have a primary key. It does, and is additionally confirmed when inserting a row twice in the logicapp it knows about the primary key’s constraint, being unique.

If I Get Rows and filter by the primary key column, the resulting array lists each item found (the one obviously) but does not make available the rowid as a dynamic expression.

How is one to actually get the rowid? Is it possible to update a row using just the primary key?

UPDATE:

The uuid is generated outside of the logicapp and is passed to it as a string. It should be noted that inserting works just fine.

Here the logicapp requires a rowid specifier, but using the uuid fails. I thought I could then instead get all rows filtered by uuid and update them, as a work around, but I could not get the rowid. Another person had a similar issue (https://stackoverflow.com/a/43516709/1298523) and could not get the rowid without editing the source code; however this method of adding the rowid in the body section of the code no longer seems to work as the result is empty. enter image description here The logicapp error I receive during an update or delete when using the uuid is:

{ "status": 400, "message": "Execution Failurern inner exception: The specified table has no primary key. Update and delete operations are not supported.rnclientRequestId: 555", "source": "sql-555.p.azurewebsites.net" }

With that said the insert goes fine and the uuid I pass get’s placed into the table.

Insert result: enter image description here

Advertisement

Answer

I figured it out, I actually deleted the entire logicapp and rebuilt it and now it recognizes that the uuid column is a PK. I believe when the app is first connected to SQL it stores the schema and never updated afterwards. I had rebuilt the connection a few times but the only thing that got it to update was by rebuilding the logicapp itself. I’m a bit convinced this is a bug, so I’m leaving here as an answer in case anyone ever comes in to this issue in the future

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement