question

RishiMishra-8685 avatar image
0 Votes"
RishiMishra-8685 asked SaurabhSharma-msft commented

How to access the script stored(.sql) in azure blob from MI agent job step

Hello,

I wanted to execute script T-SQL script stored in AZ file share is it possible to accomplish if not can we do the same if scripts are stored in AZ blob storage, pls suggest.

Many thanks in advance

azure-sql-databaseazure-container-instances
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

SaurabhSharma-msft avatar image
0 Votes"
SaurabhSharma-msft answered SaurabhSharma-msft commented

Hi @rishimishra-8685,

Thanks for using Microsoft Q&A !!
You cannot directly use Azure MI agent job step to connect to an Azure File Share. You have to either create a custom OS script or PowerShell script which could connect to Azure File Share or a blob to fetch the script to execute it. Please refer to - Create a CmdExec Job Step and Run Windows PowerShell Steps in SQL Server Agent for configuring your job agent to use CMDExec or PowerShell steps.
Please refer to Download a file to download the content of the file from Azure File Share using PowerShell or Azure CLI.

Please let me know if you have any questions.

Thanks
Saurabh

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@rishimishra-8685,

I have not heard back from you. Did my answer solve your issue? If so, please mark as accepted answer. If not, please let me know how I may better assist.

Thanks
Saurabh

0 Votes 0 ·

@rishimishra-8685,

Just wanted to check if you are you still facing the issue? In case If you already found a solution, would you please share it here with the community? Otherwise, let us know and we will continue to engage with you on the issue.

Thanks
Saurabh

0 Votes 0 ·