0

I am working on Azure Resource Group. I managed to deploy sql database to azure. However, I cannot figure out the way to run sql script during the deployment process for that database. Anyone knows how to do it?

Kim Hoang
  • 1,298
  • 8
  • 23
  • Kim - what deployment process are you using to deploy your resource group? – Dan Rediske Aug 26 '16 at 17:46
  • When you say deploy SQL database to azure, I'm assuming you mean through the portal, where you apply a dacpac. If you want to run a sql script, you're going to want to check out my post earlier today about how to deploy using SSDT. http://stackoverflow.com/questions/39209534/using-select-into-with-azure-sql-to-copy-data-from-another-db/39274065#39274065 – Shannon Lowder Sep 01 '16 at 23:24

1 Answers1

1

You should be able to run it directly against the Azure SQL Database through it's connection string (you can get that on Azure Portal)

Also gotta make sure you have the firewall permissions for properly accessing the Azure SQL Database

Pedro Luz
  • 888
  • 5
  • 14
  • I know that way to run the script. I just wonder if there is anyway to run the script directly during the deployment process? – Kim Hoang Aug 23 '16 at 14:57
  • 1
    Well, you'll probably need to write something to run that yourself, unless you're using some kind of deployment tool such as Octopus Deploy or TFS which may contain some pre-made steps for this – Pedro Luz Aug 23 '16 at 15:33
  • What deployment process are you using, Kim? There is probably a way, but it looks different for every deployment process. – Dan Rediske Aug 24 '16 at 17:22