I need a post VM deployment script in PS to restore a .BAK file located in a Blob Storage to an Azure Managed Instance. I can manually do it manually using SMSS but I get the following error when trying to restore the file from a SQL query (image of error in link below because I do not have enough rep to post images)
Query I'm actually running:
CREATE CREDENTIAL blobstorage
WITH IDENTITY = 'SHARED ACCESS SIGNATURE',
SECRET = '$StrgAccSAS';
RESTORE DATABASE [$DBName]
FROM URL = '$URL'
WITH CREDENTIAL 'blobstorage';
The requested parameters are correctly passed when executing the script.