{"id":22071,"date":"2018-04-18T09:25:21","date_gmt":"2018-04-18T16:25:21","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/aspnet\/?p=22071"},"modified":"2018-04-18T09:25:21","modified_gmt":"2018-04-18T16:25:21","slug":"publish-improvements-in-visual-studio-2017-version-15-7","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/publish-improvements-in-visual-studio-2017-version-15-7\/","title":{"rendered":"Publish Improvements in Visual Studio 2017 version 15.7"},"content":{"rendered":"<p>Today we released Visual Studio 2017 version 15.7. Our 15.7 update brings some exciting updates for publishing applications from Visual Studio that we\u2019re excited to tell you about, including:<\/p>\n<ul>\n<li>Ability to configure publish settings before you publish or create a publish profile<\/li>\n<li>Publish to a fully managed App Service Linux environment<\/li>\n<li>Create Azure Storage Accounts and automatically store the connection string for App Service<\/li>\n<li>Automatic enablement of Managed Service Identity in App Service<\/li>\n<\/ul>\n<p><a id=\"configure_standalone\"><\/a><\/p>\n<h3>Configure settings before publishing<\/h3>\n<p>When publishing your ASP.NET Core applications to either a folder or Azure App Service you can configure the following settings prior to creating your publish profile:<\/p>\n<ul>\n<li>Build configuration (Release | Debug)<\/li>\n<li>Target Framework<\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/core\/deploying\/index\">Framework Dependent or Self-contained app<\/a><\/li>\n<li>Target Runtime<\/li>\n<li>Remove additional files at destination<\/li>\n<\/ul>\n<p>To configure this prior to creating your profile, click the \u201cAdvanced\u2026\u201d link on the publish target page to open the Advanced Settings dialog.<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2018\/04\/clip_image00217.jpg\"><img decoding=\"async\" alt=\"Advanced link on 'Pick a publish target' dialog\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2018\/04\/clip_image002_thumb16.jpg\" width=\"750\" border=\"0\" \/><\/a> <a id=\"app_service_linux\"><\/a><\/p>\n<h3>Publish to a fully managed Linux environment on Azure App Service<\/h3>\n<p>In the Visual Studio 15.7 update, we\u2019ve now added support for publishing to <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/app-service\/containers\/app-service-linux-intro\">fully managed Linux environments on App Service<\/a> as well as bringing your own container.<\/p>\n<p>Visual Studio 2017 previously offered support for <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/app-service\/containers\/tutorial-custom-docker-image\">building your own Docker container<\/a> and publishing that to <a href=\"https:\/\/azure.microsoft.com\/en-us\/services\/app-service\/containers\/\">Azure App Service for Containers<\/a>. Bringing your own container gives you full control of your application\u2019s runtime environment, but it also means you are responsible for rebuilding and redeploying your container whenever there are updates available to the base images (e.g. security updates to the operating system or runtime). By contrast, in a fully managed environment, Azure automatically updates the hosting environment whenever updates are available without the need to rebuild and redeploy your app\u2019s container.<\/p>\n<p>To publish an ASP.NET Core application to a fully managed Linux App Service:<\/p>\n<ul>\n<li>Right click on your project and choose \u201cPublish\u201d<\/li>\n<li>Select \u201cApp Service Linux\u201d<\/li>\n<li>Choose \u201cCreate new\u201d <em>Note: If your application is Docker enabled, you\u2019ll see a second option called \u201cCreate new App Service for Containers\u201d which publishes your container.<\/em><\/li>\n<\/ul>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2018\/05\/clip_image00211.jpg\"><img decoding=\"async\" title=\"clip_image002[1]\" alt=\"clip_image002[1]\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2018\/05\/clip_image0021_thumb.jpg\" width=\"628\" height=\"245\" border=\"0\" \/><\/a> <a id=\"storage\"><\/a><\/p>\n<h3>Create Azure Storage Accounts and automatically store the connection string in App Settings<\/h3>\n<p>When creating a new Azure App Service, we&#8217;ve always offered the ability to create a new SQL Azure database and automatically store its connection string in your app\u2019s App Service Settings. With 15.7, we now offer the ability to create a new Azure Storage Account while you are creating your App Service, and automatically place the connection string in the App Service settings as well. To create a new storage account:<\/p>\n<ul>\n<li>Click the \u201cCreate a storage account\u201d link in the top right of the \u201cCreate App Service\u201d dialog<\/li>\n<li>Provide in the connecting string key name your app uses to access the storage account in the \u201c(Optional) Connecting String Name\u201d field at the bottom of the Storage Account dialog<\/li>\n<li>Your application will now be able to talk to the storage account once your application is published<\/li>\n<\/ul>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2018\/04\/clip_image00611.jpg\"><img decoding=\"async\" alt=\"Optional Connection String Name field on Storage Account dialog\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2018\/04\/clip_image006_thumb10.jpg\" width=\"520\" border=\"0\" \/><\/a><\/p>\n<h3>Managed Service Identity enabled for new App Services<\/h3>\n<p>A common challenge when building cloud applications is how to manage the credentials that need to be in your code for authenticating to other services. Ideally, credentials never appear on developer workstations or get checked into source control. <a href=\"https:\/\/azure.microsoft.com\/en-us\/services\/key-vault\/\">Azure Key Vault<\/a> provides a way to securely store credentials and other keys and secrets, but your code needs to authenticate to Key Vault to retrieve them. <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/managed-service-identity\/overview\">Managed Service Identity (MSI)<\/a> makes solving this problem simpler by giving Azure services an automatically managed identity in Azure Active Directory (Azure AD). You can use this identity to authenticate to any service that supports Azure AD authentication, including Key Vault, without having any credentials in your code.<\/p>\n<p>Starting in Visual Studio 2017 15.7 Preview 4, when you publish an application to Azure App Service (not Linux) Visual Studio automatically enables MSI for your application. You can then give your app permission to communicate with <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/managed-service-identity\/overview#which-azure-services-support-managed-service-identity\">any service that supports MSI authentication<\/a> by logging into that service&#8217;s page in the <a href=\"https:\/\/portal.azure.com\">Azure Portal<\/a> and granting access your App Service. For example, to create a Key Vault and give your App Service access<\/p>\n<ol>\n<li>In the <a href=\"https:\/\/portal.azure.com\">Azure Portal<\/a>, select Create a resource &gt; Security + Identity &gt; Key Vault.<\/li>\n<li>Provide a Name for the new Key Vault.<\/li>\n<li>Locate the Key Vault in the same subscription and resource group as the App Service you created from Visual Studio.<\/li>\n<li>Select Access policies and click Add new.<\/li>\n<li>In Configure from template, select Secret Management.<\/li>\n<li>Choose Select Principal, and in the search field enter the name of the App Service.<\/li>\n<li>Select the App Service\u2019s name in the result list and click Select.<\/li>\n<li>Click OK to finishing adding the new access policy, and OK to finish access policy selection.<\/li>\n<li>Click Create to finish creating the Key Vault.<\/li>\n<\/ol>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2018\/04\/clip_image0088.jpg\"><img decoding=\"async\" alt=\"Azure portal dialog: Create a Key Vault and give your App Service access\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2018\/04\/clip_image008_thumb8.jpg\" width=\"680\" border=\"0\" \/><\/a><\/p>\n<p>Once you publish your application, it will have access to the Key Vault without the need for you to take any additional steps.<\/p>\n<h3>Conclusion<\/h3>\n<p>If you\u2019re interested in the many other great things that Visual Studio 2017 15.7 brings for .NET development, check out our <a href=\"https:\/\/blogs.msdn.microsoft.com\/dotnet\/2018\/04\/18\/visual-studio-2017-15-7-preview-4\/\">.NET tool updates in Visual Studio 15.7<\/a> post on the .NET blog.<\/p>\n<p>We hope that you\u2019ll give 15.7 a try and let us know how it works for you. If you run into any issues, or have any feedback, please report them to us using <a href=\"https:\/\/docs.microsoft.com\/en-us\/visualstudio\/ide\/how-to-report-a-problem-with-visual-studio-2017\">Visual Studio\u2019s feature<\/a>s for sending feedback. or let us know what you think below or <a href=\"https:\/\/twitter.com\/andrewbrianhall\">via Twitter<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today we released Visual Studio 2017 version 15.7. Our 15.7 update brings some exciting updates for publishing applications from Visual Studio that we\u2019re excited to tell you about, including: Ability to configure publish settings before you publish or create a publish profile Publish to a fully managed App Service Linux environment Create Azure Storage Accounts [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":58792,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[197],"tags":[4,43,126],"class_list":["post-22071","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-aspnet","tag-net","tag-bcl","tag-servicing"],"acf":[],"blog_post_summary":"<p>Today we released Visual Studio 2017 version 15.7. Our 15.7 update brings some exciting updates for publishing applications from Visual Studio that we\u2019re excited to tell you about, including: Ability to configure publish settings before you publish or create a publish profile Publish to a fully managed App Service Linux environment Create Azure Storage Accounts [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/22071","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=22071"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/22071\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/58792"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=22071"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=22071"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=22071"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}