{"id":36908,"date":"2017-11-15T11:00:43","date_gmt":"2017-11-15T19:00:43","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/webdev\/?p=10906"},"modified":"2017-11-15T11:00:43","modified_gmt":"2017-11-15T19:00:43","slug":"improvements-to-azure-functions-in-visual-studio","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/improvements-to-azure-functions-in-visual-studio\/","title":{"rendered":"Improvements to Azure Functions in Visual Studio"},"content":{"rendered":"<p>We&#8217;re excited to announce several improvements to the Azure Functions experience in Visual Studio as part of the latest update to the Azure Functions tools on top of Visual Studio 2017 v15.5.<\/p>\n<ul>\n<li><a href=\"#NewFunctionsProjectDialog\">New Function project dialog<\/a>, including storage account support<\/li>\n<li><a href=\"#DotNETCoreSupport\">.NET Core support<\/a><\/li>\n<li><a href=\"#ManageApplicationSettings\">Manage Azure app settings<\/a><\/li>\n<li><a href=\"#DetectMismatchingRuntime\">Detect mismatching functions runtime versions<\/a><\/li>\n<\/ul>\n<p><a><\/a><\/p>\n<h4>New Function project dialog<\/h4>\n<p>To make it easier to get up and running with Azure Functions, we&#8217;ve introduced a new Functions project dialog. Now, when creating a Functions project, you can choose one that starts with the one of the most popular trigger types (<strong>Http<\/strong>, <strong>Queue<\/strong> or <strong>Timer<\/strong>). If you\u2019re looking for something different choose the <strong>Empty<\/strong> project, then add the item after project creation.<\/p>\n<p>Additionally, most Function apps require a valid storage account to be specified in AzureWebJobsStorage. Typically this has meant adding a connection string to the local.settings.json after the function is created. To make it easier to find and configure the connection strings for your Function\u2019s storage account, we\u2019ve introduced a Storage Account picker in the new project dialog.<\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2017\/11\/StorageAccountPicker.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2017\/11\/StorageAccountPicker-2.png\" alt=\"Storage account picker in new Functions project dialog\" width=\"728\" height=\"420\" class=\"alignnone size-full wp-image-10945\" \/><\/a><\/p>\n<p>The default option is the Storage Emulator. The Storage Emulator is a local service, installed as part of the Azure workload, that offers much of the functionality of a real Azure storage account. If it\u2019s not already running, you can start it by pressing the Windows Start key and typing \u201cMicrosoft Azure Storage Emulator\u201d. This is a great option if you\u2019re looking to get up and running quickly \u2013 especially if you\u2019re playing around, as it doesn\u2019t require any resources to be provisioned in Azure.<\/p>\n<p>However, the best way to guarantee that all supported features are available to your Functions project is to configure it to use an Azure storage account. To help with this, we\u2019ve added a <strong>Browse&#8230;<\/strong> option in the Storage Account picker that launches the Azure Storage Account selection dialog. This lets you choose from existing storage accounts that you have access to through your Azure subscriptions.<\/p>\n<p>When the project is created, the connection string for the selected storage account will be added to the <code>local.settings.json<\/code> file and you\u2019ll be able to run your Functions project straight away!\u00a0\u00a0<em>Note:\u00a0When provisioning a new Azure Functions app, Visual Studio will create a corresponding new storage account, it does re-use the account you are using locally unless you update the connection string in your application settings after you create the app.<\/em><\/p>\n<h4>.NET Core support<\/h4>\n<p>You can now create Azure Functions projects inside Visual Studio that target .NET Core. When creating a Functions project, you can choose a target from the selector at the top of the new project dialog. If you choose the <strong>Azure Functions v2 (.NET Standard)<\/strong> target, your project will run against .NET Core or .NET Framework.<\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2017\/11\/ChooseFunctionsRuntime.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2017\/11\/ChooseFunctionsRuntime-1.png\" alt=\"Choose Azure Functions runtime\" width=\"728\" height=\"420\" class=\"alignnone size-full wp-image-10916\" \/><\/a><\/p>\n<p><a><\/a><\/p>\n<h4>Manage Application Settings<\/h4>\n<p>An important part of deploying Functions to Azure is adding appropriate application settings. Azure Functions projects store local settings in the <code>local.settings.json<\/code> file, but this file does not get published to Azure (by design). So, the settings that control the application running in Azure need to be manually configured. As part of our new tooling improvements, we&#8217;ve added the ability for you to view and edit your Function&#8217;s app settings in the cloud from within Visual Studio. On the Publish page of the Connected Services dialog, you\u2019ll find an option to <strong>Manage Application Settings\u2026<\/strong>.<\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2017\/11\/ManageAppSettingsLink.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2017\/11\/ManageAppSettingsLink-2.png\" alt=\"Manage App Settings link in Publish dialog\" width=\"972\" height=\"384\" class=\"alignnone size-full wp-image-10925\" \/><\/a><\/p>\n<p>This launches the Application Settings dialog, which allows you to view, update, add and remove app settings just like you would on the <a target=\"_blank\" href=\"https:\/\/portal.azure.com\/\" rel=\"noopener\">Azure portal<\/a>. When you&#8217;re satisfied with the changes, you can press <strong>Apply<\/strong> to push the changes to the server.<\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2017\/11\/ApplicationSettingsEditor.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2017\/11\/ApplicationSettingsEditor-1.png\" alt=\"Application Settings editor\" width=\"801\" height=\"400\" class=\"alignnone size-full wp-image-10915\" \/><\/a><\/p>\n<p><a><\/a><\/p>\n<h4>Detect mismatching Functions runtime versions<\/h4>\n<p>To prevent the issue where you are\u00a0developing locally against an out-of-date version of the runtime, now, after publishing a Functions app, we\u2019ll compare your local runtime version against the portal&#8217;s version.\u00a0If they are different, Visual Studio will offer to change the app settings on the cloud to match the version you are using locally.<\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2017\/11\/MismatchingFunctionsRuntmieWarning.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2017\/11\/MismatchingFunctionsRuntmieWarning-2.png\" alt=\"Update mismatching Functions extension version\" width=\"413\" height=\"273\" class=\"alignnone size-full wp-image-10935\" \/><\/a><\/p>\n<h4>Try out the new features<\/h4>\n<p>Download the latest version of <a target=\"_blank\" href=\"https:\/\/www.visualstudio.com\/vs\/preview\/\" rel=\"noopener\">Visual Studio 2017 (v15.5)<\/a> and start enjoying the improved Functions experience today.<\/p>\n<p>Ensure you have the Azure workload installed and the latest version of the <a target=\"_blank\" href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=VisualStudioWebandAzureTools.AzureFunctionsandWebJobsTools\" rel=\"noopener\">Azure Web Jobs and Functions Tools<\/a>.\nNote: If you have a fresh installation, you may need to manually apply the update to Azure Functions and Web Jobs Tools. Look for the new notifications flag in the Visual Studio title bar. Clicking the link in the Notifications window opens the Extensions and Updates dialog. From there you can click <strong>Update<\/strong> to upgrade to the latest version.<\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2017\/11\/UpdateNotification.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2017\/11\/UpdateNotification-2.png\" alt=\"Update notifications\" width=\"442\" height=\"253\" class=\"alignnone size-full wp-image-10955\" \/><\/a><\/p>\n<p>If you have any questions or comments, please let us know by posting in the comments section below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;re excited to announce several improvements to the Azure Functions experience in Visual Studio as part of the latest update to the Azure Functions tools on top of Visual Studio 2017 v15.5. New Function project dialog, including storage account support .NET Core support Manage Azure app settings Detect mismatching functions runtime versions New Function project [&hellip;]<\/p>\n","protected":false},"author":467,"featured_media":58792,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[197,327,646],"tags":[37,7537,7524],"class_list":["post-36908","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-aspnet","category-azure","category-visual-studio","tag-azure","tag-azure-functions","tag-visual-studio-2017"],"acf":[],"blog_post_summary":"<p>We&#8217;re excited to announce several improvements to the Azure Functions experience in Visual Studio as part of the latest update to the Azure Functions tools on top of Visual Studio 2017 v15.5. New Function project dialog, including storage account support .NET Core support Manage Azure app settings Detect mismatching functions runtime versions New Function project [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/36908","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\/467"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=36908"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/36908\/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=36908"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=36908"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=36908"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}