Github deploy actions for Azure SQL Managed Instance

David Gonzalez D 61 Reputation points
2023-01-06T20:42:24.99+00:00

Hi, i have a github action which use the task azure/sql-action@v2 to deploy database changes, in the documentation i saw it's compatible with azure sql and sql server, the problem is i'm trying to deploy in Azure SQL Managed instance and when i excecute this task the response is No SQL servers were found in the subscription..

I need to take sql scripts or DACPAC files from GIT and deploy it to Managed Instance. Is azure/sql-action@v2 compatible with SQL Managed Instace? and if not, is there any cloud-based service you suggest to automate deployment from GIT to Managed Instance?

Thanks a lot.

Azure SQL Database
{count} vote

2 answers

Sort by: Most helpful
  1. Alberto Morillo 34,671 Reputation points MVP Volunteer Moderator
    2023-01-06T22:38:10.24+00:00

    The role contributor permission at the resource group level works perfectly for connecting GitHub Actions to Azure SQL, but for Azure SQL may not be enough. When the SQL Managed Instance Contributor Azure role is applied to a resource group (RG), it's not applied to SQL Managed Instance and has no effect.

    Please try to set up a SQL Managed Instance Contributor role at the subscription level.


  2. Luke Murray 11,436 Reputation points MVP Volunteer Moderator
    2023-01-07T04:25:55.877+00:00

    Hi, David

    Based on the documentation I read, it doesn't sound like SQL action is compatible with Managed Instance yet (it's not mentioned anywhere - only Azure SQL). You can raise an issue here: https://github.com/Azure/sql-action

    You MAY be able to use DBATools to execute against your SQL Managed instance, to do what you need to do: https://dbatools.io/commands/

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.