DEV Community

Discussion on: Configure secret-less connection from App Services to Azure Sql via terraform

Collapse
 
masahigo profile image
Masi • Edited

Hi Clara,

I put together a small gist which builds upon the example from this blog post: gist.github.com/Masahigo/0263ffdda...

It is not 100% complete but shows the basic idea. Identity (Azure AD user principal or service principal) executing that IaC needs to have that above mentioned permission on AAD side (or well, nowadays Microsoft Entra ID). Azure AD group is expected to be created beforehand and another service principal (only used in db automation) added to that group as member.

There's one more gotcha in regards to this approach. The Terraform provider (betr-io/mssql) writes the mssql_user resource to Terraform state and leads to issues if/when the client secret is changed/updated. This is a bug in the provider itself. Therefore it would be better to use a managed identity as it would be a more production-ready solution.