<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Christopher Maneu</title>
    <description>The latest articles on DEV Community by Christopher Maneu (@cmaneu).</description>
    <link>https://dev.to/cmaneu</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F152569%2F4bf71371-c006-4020-8bb6-62606f50b61f.png</url>
      <title>DEV Community: Christopher Maneu</title>
      <link>https://dev.to/cmaneu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cmaneu"/>
    <language>en</language>
    <item>
      <title>Get your SQL Server dev environment ready in one click</title>
      <dc:creator>Christopher Maneu</dc:creator>
      <pubDate>Tue, 25 Oct 2022 15:35:16 +0000</pubDate>
      <link>https://dev.to/cmaneu/get-your-sql-server-dev-environment-ready-in-one-click-1h46</link>
      <guid>https://dev.to/cmaneu/get-your-sql-server-dev-environment-ready-in-one-click-1h46</guid>
      <description>&lt;p&gt;Setting up a development environment is – most of the time – cumbersome. Technologies like Docker and Visual Studio Code Remote Containers – and GitHub Codespaces – really help a lot. &lt;br&gt;
We’ve just released a new sample, &lt;a href="https://github.com/microsoft/vscode-remote-try-sqlserver"&gt;Try Out Development Containers: SQL Server &amp;amp; Azure SQL&lt;/a&gt; that get you ready to work on your databases projects, just in one click!&lt;/p&gt;

&lt;h2&gt;
  
  
  One-click to SQL Server development
&lt;/h2&gt;

&lt;p&gt;If you click on the button below, you will open an instance of Visual Studio Code – if it’s installed – spin up a new SQL server instance and automatically add relevant Visual Studio Code extensions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/vscode-remote-try-sqlserver"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3-tiH-Y8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://img.shields.io/static/v1%3Flabel%3DRemote%2520-%2520Containers%26message%3DOpen%26color%3Dblue%26logo%3Dvisualstudiocode" alt="Open in Remote - Containers" width="181" height="20"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ma2o06l4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.maneu.net/images/posts/2022/data/sql-server-remote-containers-2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ma2o06l4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.maneu.net/images/posts/2022/data/sql-server-remote-containers-2.png" alt="Visual Studio Code opened on the Try SQL CMD project" width="880" height="660"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you have opened this template, you can directly write SQL files, execute them either through the &lt;code&gt;SQLCMD&lt;/code&gt; CLI or use the SQL Server extension to visualize your database right from the Visual Studio Code interface. You have everything ready to work on your database projects.&lt;/p&gt;

&lt;h2&gt;
  
  
  Easily deploy database schema changes
&lt;/h2&gt;

&lt;p&gt;This sample uses the SQL Database Projects extension. This extension allows you to organize your SQL files into a &lt;a href="https://marketplace.visualstudio.com/items?itemName=ms-mssql.sql-database-projects-vscode"&gt;&lt;em&gt;database project&lt;/em&gt;&lt;/a&gt;. This extension allows you to: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Create a database schema from a Swagger or Open API definition&lt;/li&gt;
&lt;li&gt;  Compare your database to your database numbers&lt;/li&gt;
&lt;li&gt;  Deploy your database project to an Azure SQL database or a SQL Server instance&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--42Jfdc6x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.maneu.net/images/posts/2022/data/sql-server-remote-containers-3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--42Jfdc6x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.maneu.net/images/posts/2022/data/sql-server-remote-containers-3.png" alt="Visual Studio Code UI to publish schema changes to a database" width="732" height="190"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Use it for learning or for your next project
&lt;/h2&gt;

&lt;p&gt;You can use this &lt;a href="https://github.com/microsoft/vscode-remote-try-sqlserver"&gt;Dev Container quick start&lt;/a&gt; simply to learn how to use Azure SQL or SQL Server. But you can also simply &lt;a href="https://github.com/microsoft/vscode-remote-try-sqlserver/generate"&gt;&lt;strong&gt;Use this Template&lt;/strong&gt;&lt;/a&gt; within GitHub to create your next database project and get everything already setup for you.&lt;/p&gt;

</description>
      <category>database</category>
      <category>vscode</category>
      <category>azure</category>
    </item>
    <item>
      <title>Deploy Meilisearch on Azure in One Click</title>
      <dc:creator>Christopher Maneu</dc:creator>
      <pubDate>Fri, 18 Feb 2022 15:53:41 +0000</pubDate>
      <link>https://dev.to/cmaneu/deploy-meilisearch-on-azure-in-one-click-57kf</link>
      <guid>https://dev.to/cmaneu/deploy-meilisearch-on-azure-in-one-click-57kf</guid>
      <description>&lt;p&gt;If you're developing an application, chances are that you need some search capabilities. In this area, users have been accustomed to blazing-fast search experiences like the ones on modern search engines.&lt;/p&gt;

&lt;p&gt;Truth is, providing a great search experience from just an autocomplete box is quite hard. Enter  &lt;strong&gt;&lt;a href="https://www.meilisearch.com/"&gt;Meilisearch&lt;/a&gt;&lt;/strong&gt;, an open-source search API. It's easy to use, blazing fast, and comes with &lt;a href="https://docs.meilisearch.com/learn/what_is_meilisearch/sdks.html"&gt;SDKs for a wide range of languages&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So, let's see how easy it is to host it on Azure 🚀&lt;/p&gt;

&lt;h2&gt;
  
  
  One-click deploy
&lt;/h2&gt;

&lt;p&gt;If you're in a hurry, just click that big blue button &lt;strong&gt;and&lt;/strong&gt; do not forget to replace the &lt;em&gt;Application Name&lt;/em&gt; with something more &lt;em&gt;personal&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fcmaneu%2Fmeilisearch-on-azure%2Fmain%2Fmain.json"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YmoRjqWz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazure.svg%3Fsanitize%3Dtrue" alt="Deploy To Azure" width="167" height="34"&gt;&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9mkfkCYe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.maneu.net/images/posts/2022/data/meilisearch-on-azure-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9mkfkCYe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.maneu.net/images/posts/2022/data/meilisearch-on-azure-1.png" alt="Azure portal asking deployment parameters" width="880" height="941"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on the &lt;strong&gt;Create&lt;/strong&gt; button, wait a few minutes while the deployment is happening...and that's it! Your Meilisearch instance is up and running. You can access your instance via a custom URL of the generated App Service. You can see it by clicking the &lt;strong&gt;Outputs&lt;/strong&gt; tab on the left. The API is accessible on the 433 port and not the default 7700 port.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xec3quGU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.maneu.net/images/posts/2022/data/meilisearch-on-azure-2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xec3quGU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.maneu.net/images/posts/2022/data/meilisearch-on-azure-2.png" alt="The deployment output table, showing the Meilisearch API url" width="880" height="941"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Host Meilisearch on Azure Web Apps for Containers
&lt;/h2&gt;

&lt;p&gt;Let's see under the hood how you can easily host Meilisearch on Azure. As Meilisearch is created in Rust, the best way to host it is probably to use their container image. With &lt;a href="https://azure.microsoft.com/services/app-service/#overview"&gt;Azure App Service&lt;/a&gt;, you can easily host and scale containers without having to deal with Kubernetes or OS updates.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create an Azure App Service
&lt;/h3&gt;

&lt;p&gt;If you're not familiar with Azure App Service, I encourage you to &lt;a href="https://docs.microsoft.com/learn/modules/deploy-run-container-app-service/?wt.mc_id=data-46726-chmaneu"&gt;follow this tutorial&lt;/a&gt;. Onwards, I'll assume you have a basic knowledge of this service :).&lt;/p&gt;

&lt;p&gt;If you try to deploy &lt;a href="https://hub.docker.com/r/getmeili/meilisearch"&gt;getmeili/meilisearch&lt;/a&gt; image, it'll not work the first time. This is due to the port exposed by the image - which is by default 7700. We need to inform Azure App Service to map this port behind the SSL termination done by App Service. For this, you must add the environment variable &lt;code&gt;WEBSITES_PORT&lt;/code&gt; with the value 7700.&lt;/p&gt;

&lt;p&gt;Meilisearch recommends setting a master API Key. You can do so by adding the &lt;code&gt;MEILI_MASTER_KEY&lt;/code&gt; environment variable with some long &amp;amp; complex values.&lt;br&gt;
Once this is done, you can try your instance right away! If you're also new to Meilisearch, &lt;a href="https://docs.meilisearch.com/learn/getting_started/quick_start.html#add-documents"&gt;checkout their quick start!&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XfRTHR8E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.maneu.net/images/posts/2022/data/meilisearch-on-azure-3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XfRTHR8E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.maneu.net/images/posts/2022/data/meilisearch-on-azure-3.png" alt="Melisearch dashboard hosted on Azure displaying search results with Harry Potter movies" width="880" height="717"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup shared storage
&lt;/h2&gt;

&lt;p&gt;But what happens if you stop or restart your instance? All your indexed data is gone!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7fbDlGJk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.maneu.net/images/posts/2022/data/meilisearch-on-azure-4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7fbDlGJk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.maneu.net/images/posts/2022/data/meilisearch-on-azure-4.png" alt="The meilisearch dashboard with no index" width="880" height="256"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Well, this is quite expected. Azure App Service is by default a stateless service: all data written on disk will be lost at some point (service restart, reimaging, ...). So you need to configure what we call &lt;strong&gt;&lt;a href="https://docs.microsoft.com/azure/app-service/configure-connect-to-azure-storage?tabs=portal&amp;amp;pivots=container-linux&amp;amp;wt.mc_id=data-46726-chmaneu"&gt;Path mappings&lt;/a&gt;&lt;/strong&gt;. This feature will map a folder within the container to a specific file share. Hence all data stored there will be persisted even if the container is restarted.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EyYAXiQM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.maneu.net/images/posts/2022/data/meilisearch-on-azure-5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EyYAXiQM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.maneu.net/images/posts/2022/data/meilisearch-on-azure-5.png" alt="Azure portal showing mounted volumes" width="880" height="369"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can see how to mount a storage mapping to a Linux container in &lt;a href="https://docs.microsoft.com/azure/app-service/configure-connect-to-azure-storage?tabs=portal&amp;amp;pivots=container-linux#mount-storage-to-linux-container&amp;amp;wt.mc_id=data-46726-chmaneu"&gt;our documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The last thing you must do is to add the environment variable &lt;code&gt;MEILI_DB_PATH&lt;/code&gt; with the path used in your path mapping. &lt;/p&gt;

&lt;p&gt;That's it, you now have a Meilisearch instance hosted on Azure :).&lt;/p&gt;

</description>
      <category>meilisearch</category>
      <category>azure</category>
      <category>cloud</category>
    </item>
    <item>
      <title>#julyot Devs, Learn the basics of IoT Solutions this month!</title>
      <dc:creator>Christopher Maneu</dc:creator>
      <pubDate>Wed, 08 Jul 2020 11:22:41 +0000</pubDate>
      <link>https://dev.to/azure/julyot-devs-learn-the-basics-of-iot-solutions-this-month-1bln</link>
      <guid>https://dev.to/azure/julyot-devs-learn-the-basics-of-iot-solutions-this-month-1bln</guid>
      <description>&lt;p&gt;Hey Fellow developers,&lt;/p&gt;

&lt;p&gt;Are you interested in IoT but never had time - or hardware - to start? Don't know where to start? &lt;strong&gt;Let's start together this month!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I'm running a series of Live streaming about IoT solutions, &lt;strong&gt;every Thursday 5pm CET-Paris Time / 8am PST-Seattle Time&lt;/strong&gt; at &lt;a href="https://julyot.caf%C3%A9.dev"&gt;https://julyot.café.dev&lt;/a&gt;. You'll be able to follow along within your browser my course with the Microsoft Learn Platform (&lt;a href="https://aka.ms/julyot/learn/"&gt;https://aka.ms/julyot/learn/&lt;/a&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  Watch the first episode
&lt;/h2&gt;

&lt;p&gt;The first episode of the series aired last week. With one of my colleague &lt;a href="https://twitter.com/kartben"&gt;Benjamin&lt;/a&gt;, we've introduced what is an IoT Gateway and how to host it easily on Azure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Next episode: Use SaaS solutions to build your own IoT Solution
&lt;/h2&gt;

&lt;p&gt;I'll be streaming live tomorrow (July 9th) about how you can use SaaS IoT product - Azure IoT Central - to create your own IoT Solution with very limited amount of code - or even no code at all sometimes! &lt;/p&gt;

&lt;p&gt;&lt;a href="https://julyot.caf%C3%A9.dev"&gt;&lt;strong&gt;Join me Live on YouTube&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>iot</category>
      <category>cloud</category>
      <category>newbie</category>
      <category>julyot</category>
    </item>
    <item>
      <title>Deploy Blazor WebAssembly apps to Azure Static Web Apps</title>
      <dc:creator>Christopher Maneu</dc:creator>
      <pubDate>Tue, 19 May 2020 17:35:40 +0000</pubDate>
      <link>https://dev.to/azure/deploy-blazor-webassembly-apps-to-azure-static-web-apps-6bp</link>
      <guid>https://dev.to/azure/deploy-blazor-webassembly-apps-to-azure-static-web-apps-6bp</guid>
      <description>&lt;p&gt;&lt;a href="https://docs.microsoft.com/azure/static-web-apps?wt.mc_id=swablazor-blog-chmaneu"&gt;Azure Static Web Apps&lt;/a&gt; is a new service that allows you to easily deploy your Static web apps. As I'm working on a little&lt;br&gt;
Blazor Client App (with WebAssembly), It seems perfect to host it on Azure Static Web Apps. Here is a guide about how &lt;br&gt;
I've done it, and how you can do it for your own projects too!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;What is Blazor?&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://dotnet.microsoft.com/apps/aspnet/web-apps/blazor"&gt;Blazor&lt;/a&gt; is a Web UI framework that allows you to create&lt;br&gt;
dynamic client apps by using C# instead of JavaScript. It's using WebAssembly to execute C# code within the browser&lt;br&gt;
sandbox.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  The plan
&lt;/h2&gt;

&lt;p&gt;Deploying your Blazor App on Static Web App should take you less than 10 minutes! Here is the plan: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create your Blazor project and upload it to a GitHub repository (public or private),&lt;/li&gt;
&lt;li&gt;Create your Azure Static Web App,&lt;/li&gt;
&lt;li&gt;Customize the build,&lt;/li&gt;
&lt;li&gt;Customize URL Routing to forward navigation to Blazor Routing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's get started!&lt;/p&gt;
&lt;h2&gt;
  
  
  Create your Azure Static Web App
&lt;/h2&gt;

&lt;p&gt;Let's say I've pushed my application into a GitHub repo already, and the project is within &lt;code&gt;src/frontend&lt;/code&gt; folder.&lt;br&gt;
The first step to take is to create your Static Web App within the Azure portal :).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Static Web App (or SWA) has a free tier, so even if you don't have an Azure Subscription, you can create a trial &lt;br&gt;
subscription and use it for free ;)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After clicking to &lt;strong&gt;Create new resource&lt;/strong&gt; type &lt;strong&gt;Static Web Apps&lt;/strong&gt; in the search box. Click on &lt;strong&gt;Create&lt;/strong&gt; button.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7wv6OeIc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.maneu.net/images/posts/2020/2020-05-blazor-swa-04.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7wv6OeIc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.maneu.net/images/posts/2020/2020-05-blazor-swa-04.png" alt="" width="880" height="343"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You'll now have to enter few basic info, like the Subscription or the Resource Group (a container for your resources).&lt;br&gt;
The name of the static web apps is only for you. It'll not be a part of the website address. The website address will be&lt;br&gt;
automatically generated, and you can later customize it with your own domain name.&lt;/p&gt;

&lt;p&gt;The last step is to specify the GitHub source repository and branch. The first time you're using SWA, you'll need to &lt;br&gt;
authorize Azure to access your repositories. By doing so, it'll automatically create a new GitHub Action to build and&lt;br&gt;
publish your website.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--q3AbW19V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.maneu.net/images/posts/2020/2020-05-blazor-swa-01.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--q3AbW19V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.maneu.net/images/posts/2020/2020-05-blazor-swa-01.png" alt="" width="879" height="911"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;For now, Azure will create a commit on the specified branch with a new GitHub Action. If you already have other actions&lt;br&gt;
they should not be affected.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The second step is to instruct SWA about where your app is and how to build it. For now, SWA doesn't support building&lt;br&gt;
Blazor Apps, but there is a trick :): Build it beforehand in GitHub Actions and point SWA to the build output folder.&lt;br&gt;
In my case, it's &lt;br&gt;
&lt;code&gt;src/frontend/bin/Release/netstandard2.1/publish/wwwroot&lt;/code&gt;. I'll leave the &lt;strong&gt;Api Location&lt;/strong&gt; and &lt;strong&gt;App Artifact location&lt;/strong&gt;&lt;br&gt;
empty.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_pKiplJw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.maneu.net/images/posts/2020/2020-05-blazor-swa-02.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_pKiplJw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.maneu.net/images/posts/2020/2020-05-blazor-swa-02.png" alt="" width="880" height="542"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on &lt;strong&gt;Review+Create&lt;/strong&gt;, confirm the creation and let's jump onto the second step!&lt;/p&gt;
&lt;h2&gt;
  
  
  Update GitHub Actions
&lt;/h2&gt;

&lt;p&gt;As I said before, we will have to build our Blazor project before deploying it to SWA. Go onto your Git/GitHub repo &lt;br&gt;
(don't forget to &lt;code&gt;git pull&lt;/code&gt; if you're working locally) and locate the GitHub Action &lt;code&gt;.yaml&lt;/code&gt; file created by SWA.&lt;br&gt;
It should start with &lt;code&gt;azure-static-web-apps&lt;/code&gt;. Then add the following steps before the SWA &lt;code&gt;- name: Build And Deploy&lt;/code&gt;&lt;br&gt;
step. You may need to change the paths accordingly to your project structure.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Setup .NET Core&lt;/span&gt;
      &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/setup-dotnet@v1&lt;/span&gt;
      &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;dotnet-version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;3.1.201&lt;/span&gt;

    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Build with dotnet&lt;/span&gt;
      &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;dotnet build --configuration Release&lt;/span&gt;

    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Publish with dotnet&lt;/span&gt;
      &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;dotnet publish --configuration Release&lt;/span&gt; 

    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Publish artifacts&lt;/span&gt;
      &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/upload-artifact@master&lt;/span&gt;
      &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;webapp&lt;/span&gt;
        &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;src/frontend/bin/Release/netstandard2.1/publish/wwwroot&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you've probably spotted, I'm also capturing the build artifacts here. This step is not mandatory; however, I like to &lt;br&gt;
keep an archive of what's been deployed. You can remove this step if you want.&lt;/p&gt;

&lt;p&gt;Commit-Push this change to this repository and head over to the &lt;strong&gt;Actions&lt;/strong&gt; tab on GitHub. Within minutes, your Blazor&lt;br&gt;
website should be deployed! Congrats  🎉&lt;/p&gt;
&lt;h3&gt;
  
  
  Fix URL Routing with Blazor
&lt;/h3&gt;

&lt;p&gt;Almost all Blazor apps have several pages. So, what happens if a user is trying to reach for example &lt;br&gt;
yourapp.com/second-page? It will fail. That's because this page - or directory - does not exists in your output and &lt;br&gt;
that's normal. We need to tell SWA to serve our index.html for all non-matching routes, so Blazor routing can &lt;br&gt;
kick-in and resolve the appropriate Blazor Page.&lt;/p&gt;

&lt;p&gt;And it's easy! You just need to create a &lt;code&gt;routes.json&lt;/code&gt; file with the following content.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"routes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"route"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/*"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"serve"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/index.html"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"statusCode"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The only remaining question is Where to create this page? It should be at the root of your &lt;strong&gt;&lt;em&gt;published&lt;/em&gt;&lt;/strong&gt; folder.&lt;br&gt;
For most of the projects, you can put it onto your &lt;strong&gt;wwwroot&lt;/strong&gt; folder. Do not forget to set Build action to "Copy Always" ;).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dkPv4TFc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.maneu.net/images/posts/2020/2020-05-blazor-swa-05.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dkPv4TFc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.maneu.net/images/posts/2020/2020-05-blazor-swa-05.png" alt="" width="330" height="402"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You now have successfully deployed your Blazor App to Static Web Apps!&lt;/p&gt;

&lt;h2&gt;
  
  
  What about some Azure Functions?
&lt;/h2&gt;

&lt;p&gt;For now, Static Web Apps only supports Azure Functions written in Node JS. If your functions are also written in NodeJs,&lt;br&gt;
you can simply specify the functions folder in the YAML file. &lt;/p&gt;

&lt;p&gt;If your functions are written in C#, for now, you can create another action to publish them directly to Azure Functions.&lt;/p&gt;

</description>
      <category>blazor</category>
      <category>webassembly</category>
      <category>staticwebapps</category>
      <category>azure</category>
    </item>
    <item>
      <title>How YOU can interview developers remotely with Visual Studio Code?</title>
      <dc:creator>Christopher Maneu</dc:creator>
      <pubDate>Mon, 20 Apr 2020 14:15:16 +0000</pubDate>
      <link>https://dev.to/cmaneu/how-you-can-interview-developers-remotely-with-visual-studio-code-4hkn</link>
      <guid>https://dev.to/cmaneu/how-you-can-interview-developers-remotely-with-visual-studio-code-4hkn</guid>
      <description>&lt;p&gt;&lt;em&gt;Photo by Christina @ &lt;a href="https://wocintechchat.com"&gt;wocintechchat.com&lt;/a&gt; on Unsplash&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This article was written during Covid-19 crisis. However, It's relevant before and after this time.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You're about do interview some developers remotely? Great! But how to asses the level&lt;br&gt;
of a developer when she/he's not in front of you?&lt;/p&gt;

&lt;p&gt;In this article, we'll see: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How a remote developer interview is different from an onsite one?&lt;/li&gt;
&lt;li&gt;How you can simply organize coding exercises of different forms remotely?&lt;/li&gt;
&lt;li&gt;How you can do live coding exercises during an interview?&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;In this article, I'll focus on interviewing &lt;em&gt;remotely&lt;/em&gt;, and not &lt;em&gt;for a remote position&lt;/em&gt;.&lt;br&gt;
Interviewing for a remote developer position has some specifics. If you're interested in this topic, &lt;br&gt;
feel free to drop me a message in comments section. Moreover, some countries have laws that forbid&lt;br&gt;
a remote interview process or limit it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Start with what?
&lt;/h2&gt;

&lt;p&gt;As any software developer, I've done a bunch of interviews. From startup to two of the GAFAM, I had quite different &lt;br&gt;
exercises, and some of them made absolutely no sense to my ability to integrate a team and be a good developer.&lt;/p&gt;

&lt;p&gt;As an engineering lead, I've always tried to ensure that the interview process evaluate two things: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The ability of the candidate to integrate a team, communicate and collaborate.&lt;/li&gt;
&lt;li&gt;The ability of the candidate to &lt;em&gt;create software&lt;/em&gt; depending on &lt;strong&gt;our current setup and the seniority level&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In all my experience, I've never seen any actual developer writing code on the whiteboard and use it in production &lt;br&gt;
thereafter. &lt;strong&gt;We must force ourselves to put the candidate in a position &amp;amp; context as close as a team member would be.&lt;/strong&gt; &lt;br&gt;
That's why I like to ask questions about communication and collaboration first, and then put the candidate "at work"&lt;br&gt;
by letting her/him write code. Let's see how to do it easily with Visual Studio Code! &lt;/p&gt;

&lt;h2&gt;
  
  
  Launch audio-visio easily
&lt;/h2&gt;

&lt;p&gt;First things first! Every interview will start with a quick call. There are a gazillion options out there: &lt;br&gt;
Google Hangouts, Microsoft Teams, Z**m, etc... The fact is we tend to forget simple things: Skype! If it's not perceived&lt;br&gt;
as a professional tool, Skype has a neat conference call feature that checks every criterion you should have for a &lt;br&gt;
videoconferencing tool for remote interviews: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A straightforward way to setup the call&lt;/li&gt;
&lt;li&gt;Should work with almost any platform (Windows, Mac, Linux, iOs, Android, ...)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Should not require any account or download&lt;/strong&gt;. And yes, Skype Conference call allows anybody to make a phone call 
within the browser! &lt;/li&gt;
&lt;li&gt;Allows several people in&lt;/li&gt;
&lt;li&gt;No call limitation (you don't want to hang up after 40 minutes)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ff1eZkuK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.maneu.net/images/posts/2020/2020-04-interview-developers-remotely-skype.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ff1eZkuK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.maneu.net/images/posts/2020/2020-04-interview-developers-remotely-skype.png" alt="" width="880" height="493"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can simply &lt;a href="https://www.skype.com/en/free-conference-call/"&gt;create a new meeting here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The only caveat for now is that you will not be able to share your screen from the web interface. Anyway, we'll see in a&lt;br&gt;
minute how to do &lt;em&gt;better&lt;/em&gt; than sharing a screen.&lt;/p&gt;

&lt;h2&gt;
  
  
  Coding exercise at home
&lt;/h2&gt;

&lt;p&gt;In my previous company, every developer candidate must complete a simple exercise to code on their own. &lt;br&gt;
How we've done this?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We give the candidate a simple exercise (Create a master-details app based on a publicly available API) and all the
details required in less than a sheet of paper (with less than 5 min reading, you should have everything to start)&lt;/li&gt;
&lt;li&gt;We asked that all the exercise code was handed over on a public or private Git repository (most candidates choose the
private repo option. We provided the private repo).&lt;/li&gt;
&lt;li&gt;The code has &lt;strong&gt;no value for us&lt;/strong&gt;. As we were not paying anything to the candidate, no code should be valuable for us.&lt;/li&gt;
&lt;li&gt;The candidate can work on this exercise for two weeks on her/his own terms: 1h per day, 1 weekend day, full time. With
Internet or without, with any IDE. Sometimes we restricted the libraries and packages that can be used but that's all.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, it was not a perfect setup. Candidates had to setup a new project from scratch, and a development environment.&lt;br&gt;
We had to take their code and execute it. Sometimes we had some tweaks to make it work on our own dev environment. It &lt;br&gt;
was also complicated during the next interview to comment their code live.&lt;/p&gt;

&lt;p&gt;But we're in 2020, and thanks to Visual Studio Code, Docker and &lt;a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack&amp;amp;wt.mc_id=remoteitwvsc-blog-chmaneu"&gt;Remote Development Extensions&lt;/a&gt;&lt;br&gt;
, it's now super-easy to setup a development environment within a Docker container, and share it! &lt;br&gt;
&lt;a href="https://code.visualstudio.com/docs/remote/containers#_quick-start-try-a-dev-container?wt.mc_id=remoteitwvsc-blog-chmaneu"&gt;Read this tutorial to get started.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With this simple extension, you can now either setup a dev environment ready for your exercise, or ask your candidate &lt;br&gt;
to provide you this container, so you can review the exercise easily and in an isolated fashion.&lt;/p&gt;

&lt;h2&gt;
  
  
  Unsupervised time-boxed coding exercise
&lt;/h2&gt;

&lt;p&gt;In one of my first company, we had to complete a coding exercise in two hours. This company has to setup a real computer&lt;br&gt;
, and erase it at the end of the exercise. It was a tedious process. &lt;/p&gt;

&lt;p&gt;With remote development extension, this process is now easy. Giving it to a remote candidate is however not easy.&lt;br&gt;
Thanks to &lt;a href="https://online.visualstudio.com?wt.mc_id=remoteitwvsc-blog-chmaneu"&gt;Visual Studio Online&lt;/a&gt;, you can now host a complete development environment&lt;br&gt;
in Azure and access it via a Visual Studio Code embedded in a browser interface. It's &lt;a href="https://docs.microsoft.com/en-us/visualstudio/online/how-to/browser#create-an-environment?wt.mc_id=remoteitwvsc-blog-chmaneu"&gt;easy to setup&lt;/a&gt;, &lt;br&gt;
and you can share an account with the candidate. When the time is up, you can simply access the environment to review&lt;br&gt;
the exercise.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pair programming &amp;amp; supervised coding exercise
&lt;/h2&gt;

&lt;p&gt;One of my favourite exercise (and an ideal replacement of a whiteboard coding session) is a "pair programming"&lt;br&gt;
session. It may be difficult to produce any code in 45 minutes, but you can plan a lot of exercises: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Going through a "fake" pull request and ask the candidate to comment the code,&lt;/li&gt;
&lt;li&gt;Ask the candidate to code a simple piece of code and watch it doing so,&lt;/li&gt;
&lt;li&gt;Ask the candidate to write some unit tests based on a feature description&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5L7Ysxq3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.maneu.net/images/posts/2020/2020-04-interview-developers-remotely-liveshare.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5L7Ysxq3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.maneu.net/images/posts/2020/2020-04-interview-developers-remotely-liveshare.png" alt="" width="880" height="550"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks to &lt;a href="https://docs.microsoft.com/visualstudio/liveshare/use/technical-interviews?wt.mc_id=remoteitwvsc-blog-chmaneu"&gt;Visual Studio Live Share&lt;/a&gt;, &lt;br&gt;
it's easy to setup these kinds of interviews. You can simply share a code and a development environment&lt;br&gt;
with a remote candidate. It's even easier now that you can &lt;a href="https://docs.microsoft.com/visualstudio/liveshare/quickstart/browser-join?wt.mc_id=remoteitwvsc-blog-chmaneu"&gt;Join in the browser&lt;/a&gt;!&lt;/p&gt;

&lt;h2&gt;
  
  
  Whiteboard exercise
&lt;/h2&gt;

&lt;p&gt;Ok, ok. I see you still want to do some whiteboard exercise. As I said before, you need to be very &lt;em&gt;intentional&lt;/em&gt;&lt;br&gt;
about these kinds of exercises. Even in person, they are hard to run and evaluating a candidate performance with them&lt;br&gt;
is complicated. However, you may want to run a quick whiteboarding exercise before a pair programming one.&lt;br&gt;
Thanks to &lt;a href="https://marketplace.visualstudio.com/items?itemName=lostintangent.vsls-whiteboard&amp;amp;wt.mc_id=remoteitwvsc-blog-chmaneu"&gt;Live Share Whiteboard&lt;/a&gt;&lt;br&gt;
extension, you can run a shared whiteboard session directly within Visual Studio Code. Used in combination with&lt;br&gt;
the other tools, it can be an effortless way to run an end-to-end design &amp;amp; coding exercise with only one tool.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zqGYCdZb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.maneu.net/images/posts/2020/2020-04-interview-developers-remotely-whiteboard.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zqGYCdZb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.maneu.net/images/posts/2020/2020-04-interview-developers-remotely-whiteboard.png" alt="" width="880" height="344"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;How you're running your own remote interviews? Is there anything you want to know about this that's not answered in this post? Add a comment below!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>remote</category>
      <category>management</category>
      <category>interview</category>
    </item>
    <item>
      <title>Let's share our 2020 Dev Resolutions!</title>
      <dc:creator>Christopher Maneu</dc:creator>
      <pubDate>Wed, 01 Jan 2020 08:30:16 +0000</pubDate>
      <link>https://dev.to/cmaneu/let-s-share-our-2020-dev-resolutions-26dl</link>
      <guid>https://dev.to/cmaneu/let-s-share-our-2020-dev-resolutions-26dl</guid>
      <description>&lt;p&gt;🎊 &lt;strong&gt;Happy new year to everyone!&lt;/strong&gt; 🎉&lt;/p&gt;

&lt;p&gt;I hope you all get some time to recharge your batteries and enjoy quality time with your beloved ones - family, friends, ...&lt;/p&gt;

&lt;p&gt;We're entering a new decade today, and I'm excited about what's coming next for all of us. 2019 has seen the rise of a lot of topics that - for me - that promise a bright future : &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I witnessed a lot of people getting their first job in tech - from more diverse backgrounds than ever,&lt;/li&gt;
&lt;li&gt; A lot of cloud-related technologies have enabled developers to create more efficient and powerful services: container orchestrators, serverless, ...&lt;/li&gt;
&lt;li&gt;Even if some places in the world don't have proper/unregulated access to the Internet, it's easy to build IoT projects with a diverse range of connectivities. Despite the security risks, we've seen a lot of new IoT devices deployed everywhere&lt;/li&gt;
&lt;li&gt;A new generation of developers is coming: the Citizenship Developers. With new low-code or no-code solutions, a lot of professionals - whatever their background- can create software to optimize their business or daily work.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  So, what YOU will do in 2020? #2020DevResolutions
&lt;/h2&gt;

&lt;p&gt;As every year, It's resolutions time! Eat healthier, do more exercise, become greener. We all try to commit to them at the beginning of the new year. What's hard is to make them a habit and keep these resolutions over time. One of the best ways to achieve this is to &lt;a href="https://www.nytimes.com/guides/smarterliving/resolution-ideas"&gt;make ourselves accountable by sharing these resolutions with other peoples&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;That's why &lt;strong&gt;I encourage you to share your developer resolutions on Twitter with the hashtag #2020DevResolutions&lt;/strong&gt;. Just one tweet, that's all I'm asking :). You can do it now 👉 &lt;br&gt;
&lt;a href="https://twitter.com/intent/tweet?button_hashtag=2020DevResolutions&amp;amp;ref_src=twsrc%5Etfw" class="twitter-hashtag-button"&gt;Tweet #2020DevResolutions&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want to "write" something about it - a blog/dev.to/medium post, a video, etc...- Go do it! &lt;/p&gt;

&lt;h2&gt;
  
  
  Do you need some ideas?
&lt;/h2&gt;

&lt;p&gt;There are so many things to do, right? To give you some inspirations, I'll publish or retweet one developer resolution per day on Twitter. That's 31 ideas to pick from :) Be sure to follow me &lt;a href="https://twitter.com/cmaneu?ref_src=twsrc%5Etfw" class="twitter-follow-button"&gt;Follow @cmaneu&lt;/a&gt; and follow &lt;/p&gt;

&lt;p&gt;I'll also share a weekly blog post. Every Monday, I'll create a digest with the best developers resolutions I saw on Twitter, and to help you &lt;em&gt;adopt&lt;/em&gt; these resolutions, I'll create a plan for some of them.&lt;/p&gt;

&lt;p&gt;🌟 Let's have a stellar Developer year together! 🌠&lt;/p&gt;

</description>
      <category>2020devresolutionsdiscuss</category>
    </item>
    <item>
      <title>How to get usable state from IoT events? #25daysofserverless</title>
      <dc:creator>Christopher Maneu</dc:creator>
      <pubDate>Sat, 21 Dec 2019 07:50:39 +0000</pubDate>
      <link>https://dev.to/cmaneu/how-to-get-usable-state-from-iot-events-25daysofserverless-5ak5</link>
      <guid>https://dev.to/cmaneu/how-to-get-usable-state-from-iot-events-25daysofserverless-5ak5</guid>
      <description>&lt;p&gt;This article is part of &lt;a href="https://25daysofserverless.com"&gt;#25DaysOfServerless&lt;/a&gt;. New challenges will be published every day from Microsoft Cloud Advocates throughout the month of December. Find out more about how Microsoft Azure enables your &lt;a href="https://docs.microsoft.com/azure/azure-functions/?WT.mc_id=25days_devto-blog-cxa"&gt;Serverless functions&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Have an idea or a solution? &lt;a href="https://twitter.com/intent/tweet?text=I'm%20joining%20the%20@azureadvocates%20%2325DaysOfServerless%20challenge!!%20Learn%20more%20at%20https://aka.ms/25daysofserverless%20or%20see%20solutions%20at%20https://dev.to/search?q=25DaysOfServerless!%20Join%20me!"&gt; Share your thoughts on Twitter! &lt;br&gt;
&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;Let's head over to South of France where Julie and her colleagues have decided to prepare a special gift for all patients&lt;br&gt;
where she is working: custom-shaped inflated balloons! To make them, she'll need to inflate a LOT of balloons&lt;br&gt;
with the help of an air compressor and one 12 liters air tank. Will they have enough air to do it?&lt;/p&gt;

&lt;p&gt;We have put some IoT devices that tell us when the air compressor is starting and stopping to fill the tanks.&lt;br&gt;
With the help of Azure IoT Hub and some serverless magic, your mission is to compute the amount of air available and&lt;br&gt;
make this information available.&lt;/p&gt;
&lt;h2&gt;
  
  
  Create our Project
&lt;/h2&gt;

&lt;p&gt;After having created a new Azure Functions project, we will need to install the Azure Functions Durable extension, by adding the corresponding NuGet package.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;func extensions install -p Microsoft.Azure.WebJobs.Extensions.DurableTask -v 2.0.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll also need to create several Azure Resources, including: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A Storage Account. Your entity state will be serialized into it,&lt;/li&gt;
&lt;li&gt;An Event Hub, to reroute messages from the IoT Hub to the Azure Function&lt;/li&gt;
&lt;li&gt;An IoT Hub and a device that sending some messages :) (you can &lt;a href="https://docs.microsoft.com/en-us/azure/iot-hub/tutorial-connectivity?wt.mc_id=25serverless19-devto-chmaneu"&gt;fake it&lt;/a&gt; if needed.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Coding our Durable Entity
&lt;/h2&gt;

&lt;p&gt;That's probably the easiest part. You simply have to write a class, with some assumptions and todos : &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Any property will be only read-only. If you need to change the state of an object, you will need to create a method for it. Methods will be called, but not directly,&lt;/li&gt;
&lt;li&gt;We will only serialize what's needed. So you need to put some attributes for this,&lt;/li&gt;
&lt;li&gt;Any public method can be called by other functions&lt;/li&gt;
&lt;li&gt;You'll need a special &lt;code&gt;Run&lt;/code&gt; method that will dispatch the actual work to the appropriate method. Remember, methods are not called directly on your object.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is a simple example of a class representing a Tank, with different properties.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;JsonObject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;MemberSerialization&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;OptIn&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Tank&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;JsonProperty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"pressure"&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;CurrentPressure&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;JsonProperty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"isFilling"&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;IsFilling&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;

    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;JsonProperty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"fillingStartTime"&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;DateTime&lt;/span&gt; &lt;span class="n"&gt;FillingStartTime&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;

    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;FunctionName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;nameof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Tank&lt;/span&gt;&lt;span class="p"&gt;))]&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="n"&gt;Task&lt;/span&gt; &lt;span class="nf"&gt;Run&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;EntityTrigger&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;IDurableEntityContext&lt;/span&gt; &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;DispatchAsync&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Tank&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;();&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;GetActualPressure&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CurrentPressure&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;StartFilling&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;IsFilling&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="n"&gt;FillingStartTime&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;DateTime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Now&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Stop&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;IsFilling&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;fillingStopTime&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;DateTime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Now&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="n"&gt;CurrentPressure&lt;/span&gt; &lt;span class="p"&gt;+=&lt;/span&gt; &lt;span class="nf"&gt;ComputeFillingPressure&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;FillingStartTime&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fillingStopTime&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Calling a method on our durable entity from &lt;em&gt;regular&lt;/em&gt; functions
&lt;/h2&gt;

&lt;p&gt;At the previous step, we've created some methods like &lt;code&gt;StartFilling&lt;/code&gt; and &lt;code&gt;Stop&lt;/code&gt;. We now need to call it when we receive an event from our IoT device. &lt;/p&gt;

&lt;p&gt;If you try to instantiate an entity directly, you'll have the feeling that's everything is working. However, nothing will work :). You'll need to use an &lt;code&gt;IDurableEntityClient&lt;/code&gt; to communicate with a durable entity. This client will handle all the work behind the scenes to scale, serialize and restore your entities. You get this client via method parameters injection.&lt;/p&gt;

&lt;p&gt;In a case of just calling a method in an entity without expecting any return value, you'll be simply &lt;strong&gt;signaling&lt;/strong&gt; it. That means that your Azure function will almost always return &lt;em&gt;before&lt;/em&gt; any code within the entity gets executed. You just create an &lt;code&gt;EntityId&lt;/code&gt; and call the method &lt;code&gt;SignalEntityAsync()&lt;/code&gt; to send a request to execute a specific method.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;FunctionName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"processCompressorEvent"&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="n"&gt;Task&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;IActionResult&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;Run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;HttpTrigger&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;AuthorizationLevel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Anonymous&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"get"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Route&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="n"&gt;HttpRequest&lt;/span&gt; &lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;ILogger&lt;/span&gt; &lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;DurableClient&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="n"&gt;IDurableEntityClient&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"New event from IoT device."&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;compressorId&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Query&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
    &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;queryType&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Query&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"eventType"&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

    &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;entityId&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;EntityId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;nameof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Tank&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;compressorId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;switch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;queryType&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="s"&gt;"start"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; 
            &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;SignalEntityAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;entityId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"StartFilling"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="s"&gt;"stop"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; 
            &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;SignalEntityAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;entityId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Stop"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ActionResult&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;OkObjectResult&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;$"Event processed."&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Accessing values of our durable entity from &lt;em&gt;regular&lt;/em&gt; functions
&lt;/h2&gt;

&lt;p&gt;If you need to access the value of an entity, it's almost the same than calling a function: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use an &lt;code&gt;IDurableEntityClient&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;Create an &lt;code&gt;EntityId&lt;/code&gt; object to _locate _ your entity,&lt;/li&gt;
&lt;li&gt;Call &lt;code&gt;durableEntityClient.ReadEntityStateAsync()&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;There is only one thing you need to know&lt;/strong&gt;: if you try to get an entity state for an entity that does not exists yet - because nobody called a method on it for example - You'll get a "value that is null". That's why the return value of &lt;code&gt;ReadEntityStateAsync&lt;/code&gt; is not your object, but a wrapper object that exposes an &lt;code&gt;EntityExists&lt;/code&gt; property.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;FunctionName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"GetCompressorState"&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="n"&gt;Task&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;IActionResult&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;Run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;HttpTrigger&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;AuthorizationLevel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Anonymous&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"get"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"post"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Route&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="n"&gt;HttpRequest&lt;/span&gt; &lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;ILogger&lt;/span&gt; &lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;DurableClient&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="n"&gt;IDurableEntityClient&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"New request to get compressor state."&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;compressorId&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Query&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

    &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;entityId&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;EntityId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;nameof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Tank&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;compressorId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;currentValue&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ReadEntityStateAsync&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Tank&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;(&lt;/span&gt;&lt;span class="n"&gt;entityId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;currentValue&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;EntityExists&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ActionResult&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;OkObjectResult&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;value&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;currentValue&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;EntityState&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CurrentPressure&lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ActionResult&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;OkObjectResult&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;value&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"no-data"&lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Voilà ! With very few lines of code, you're now able to store a concrete state of an IoT object just from events data, and you're ready to scale it to millions of balloons :).&lt;/p&gt;




&lt;p&gt;Want to submit your solution to this challenge? Build a solution locally and then &lt;a href="https://github.com/microsoft/25-days-of-serverless/issues/new?assignees=&amp;amp;labels=challenge-submission&amp;amp;template=challenge-solution-submission.md&amp;amp;title=%5BCHALLENGE+SUBMISSION%5D+"&gt;submit an issue&lt;/a&gt;. If your solution doesn't involve code you can record a short video and submit it as a link in the issue description. Make sure to tell us which challenge the solution is for. We're excited to see what you build! Do you have comments or questions? Add them to the comments area below.&lt;/p&gt;




&lt;p&gt;Watch for surprises all during December as we celebrate 25 Days of Serverless. Stay tuned here on dev.to as we feature challenges and solutions! Sign up for a &lt;a href="https://azure.microsoft.com/free/?WT.mc_id=25days_devto-blog-cxa"&gt;free account on Azure&lt;/a&gt; to get ready for the challenges!&lt;/p&gt;

&lt;p&gt;Enjoying this initiative by Azure Advocates? Stay in touch via our &lt;a href="//aka.ms/usdevconnect"&gt;newsletter&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>25daysofserverless</category>
      <category>serverless</category>
      <category>azure</category>
      <category>iot</category>
    </item>
    <item>
      <title>#Tip Use local Azure Storage emulator in Remote Containers</title>
      <dc:creator>Christopher Maneu</dc:creator>
      <pubDate>Mon, 09 Dec 2019 12:10:03 +0000</pubDate>
      <link>https://dev.to/cmaneu/tip-use-local-azure-storage-emulator-in-remote-containers-2id1</link>
      <guid>https://dev.to/cmaneu/tip-use-local-azure-storage-emulator-in-remote-containers-2id1</guid>
      <description>&lt;p&gt;I LOVE &lt;a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack&amp;amp;wt.mc_id=localstoremu-devto-chmaneu"&gt;Remote Development Extensions&lt;/a&gt; for Visual Studio Code. It allows me to simply pack all my technical stack in one docker container, while getting me everything I need to run and debug things.&lt;/p&gt;

&lt;h2&gt;
  
  
  Everything, this includes &lt;code&gt;localhost&lt;/code&gt;, right?
&lt;/h2&gt;

&lt;p&gt;Ehmm.. that depends! This morning, I was doing different things with Azure Functions SDK for &lt;a href="https://25daysofserverless.com/"&gt;25 days of serverless&lt;/a&gt;, and for that I needed to access the local Azure Storage Emulator, the one on my local machine - not within a Docker container.&lt;/p&gt;

&lt;p&gt;How can I possibly access local resources - who are neither on Internet or within another container - from a container?&lt;/p&gt;

&lt;h2&gt;
  
  
  3 magic words
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;host.docker.internal&lt;/code&gt;. That's all you need &lt;em&gt;within&lt;/em&gt; your container to access your "real" localhost, and everything hosted on it. Like my Azure Storage Emulator :). With that bit of magic, I was able to replace the usuel local connection string &lt;code&gt;UseDevelopmentStorage=true;&lt;/code&gt; by the following :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;UseDevelopmentStorage=true;DevelopmentStorageProxyUri=http://host.docker.internal
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Et voilà! I'm now able to use the benefits of Remote Containers development while using all my local hosted tools, including the Azure Storage Emulator :)&lt;/p&gt;

</description>
      <category>azurevscodedocker</category>
    </item>
  </channel>
</rss>
