Azure sql db managed instance - xp cmdshell alternatives

Biju Mathew 471 Reputation points
2021-03-10T11:19:34.693+00:00

Hi
We have a sql server dB that we plan to migrate onto sql pass mi from onprem.
But we have an issue. In the current implementation, we have some stored procedures that uses xp_cmdshell. This cmdshell runs the dir command on a file share and retrieves the list of files to be processed via an stored procedure. Xp_cmdshell is not supported in pass managed instance.
This has become a blocker for our planned migration. We would like to understand from this group what alternatives we have in azure to achieve the same result as xp cmdshell dir?
Can data factory do this?
Please any advice will be helpful

Azure SQL Database
0 comments No comments
{count} votes

Accepted answer
  1. KalyanChanumolu-MSFT 8,316 Reputation points
    2021-03-10T13:15:05.083+00:00

    @Biju Mathew Thank you for reaching out.

    You can create a timer triggered Azure function that runs periodically, checks the file share, and updates the list of files to a table in your database.
    The stored procedure can then consume from the table instead.

    Yes, you can achieve the same using Azure Data Factory as well.
    Do let us know if you have any further questions.

    ----------

    If an answer is helpful, please "Accept answer" or "Up-Vote" for the same which might be beneficial to other community members reading this thread.


0 additional answers

Sort by: Most helpful