{"id":42366,"date":"2024-11-07T00:20:01","date_gmt":"2024-11-07T07:20:01","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/premier-developer\/?p=42366"},"modified":"2024-11-05T12:48:37","modified_gmt":"2024-11-05T19:48:37","slug":"debugging-a-managed-identity-connection-to-azure-sql-in-azure-app-service-using-containers","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/premier-developer\/debugging-a-managed-identity-connection-to-azure-sql-in-azure-app-service-using-containers\/","title":{"rendered":"Debugging a managed identity connection to Azure SQL in Azure App Service using containers"},"content":{"rendered":"<p><a href=\"https:\/\/www.linkedin.com\/in\/dstamand\/\">Dominique St-Amand<\/a> explores how to debug a managed identity connection from a container-based App Service to Azure SQL.<\/p>\n<hr \/>\n<p>So you\u2019ve been eager to deploy your containerized web application that you\u2019ve been working on for a while, to Azure App Service. You follow the best security practices which means you\u2019ve setup your connection to your Azure SQL database\u00a0<a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/app-service\/tutorial-connect-msi-sql-database?tabs=windowsclient%2Cefcore%2Cdotnet#4-use-managed-identity-connectivity\" target=\"_blank\" rel=\"noreferrer noopener nofollow\" data-type=\"link\" data-id=\"https:\/\/learn.microsoft.com\/en-us\/azure\/app-service\/tutorial-connect-msi-sql-database?tabs=windowsclient%2Cefcore%2Cdotnet#4-use-managed-identity-connectivity\">using a managed identity<\/a>. Upon loading your application, you get a dreadful exception that you can\u2019t connect to the database. You then wonder, is this a database permission problem or some another problem, such as the application cannot connect to the database using its managed identity. This problem is even tougher to diagnose in applications such as Custom Off the Shelf (COTS) that you don\u2019t have the source code.<\/p>\n<p>Rest assured, this happens to the best of us (yes, even me!). In this post, I will give you some techniques to help you determine if the problem is indeed a problem between the web app and the Azure SQL database, through the use of managed identities, without having to modify any code in your application, keeping the debugging strictly on the infrastructure side.<\/p>\n<p>Check out the <a href=\"https:\/\/www.domstamand.com\/debugging-a-managed-identity-connection-to-azure-sql-in-azure-app-service-using-containers\/\">step-by-step walkthrough here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Dominique St-Amand explores how to debug a managed identity connection from a container-based App Service to Azure SQL. So you\u2019ve been eager to deploy your containerized web application that you\u2019ve been working on for a while, to Azure App Service. You follow the best security practices which means you\u2019ve setup your connection to your Azure [&hellip;]<\/p>\n","protected":false},"author":582,"featured_media":37840,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[10661,25,10660],"tags":[],"class_list":["post-42366","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-app-service","category-azure","category-managed-identity"],"acf":[],"blog_post_summary":"<p>Dominique St-Amand explores how to debug a managed identity connection from a container-based App Service to Azure SQL. So you\u2019ve been eager to deploy your containerized web application that you\u2019ve been working on for a while, to Azure App Service. You follow the best security practices which means you\u2019ve setup your connection to your Azure [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/42366","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/users\/582"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/comments?post=42366"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/42366\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media\/37840"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media?parent=42366"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/categories?post=42366"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/tags?post=42366"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}