<?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: My</title>
    <description>The latest articles on DEV Community by My (@mydiemho).</description>
    <link>https://dev.to/mydiemho</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%2F129508%2F7c8145a1-059b-464a-8737-c507e31a7fb1.png</url>
      <title>DEV Community: My</title>
      <link>https://dev.to/mydiemho</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mydiemho"/>
    <language>en</language>
    <item>
      <title>Protect your function app with Azure KeyVault</title>
      <dc:creator>My</dc:creator>
      <pubDate>Thu, 26 Sep 2019 06:18:31 +0000</pubDate>
      <link>https://dev.to/mydiemho/protect-your-function-app-with-azure-keyvault-2hkp</link>
      <guid>https://dev.to/mydiemho/protect-your-function-app-with-azure-keyvault-2hkp</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;This article is part of &lt;a href="https://dev.to/azure/serverless-september-content-collection-2fhb"&gt;#ServerlessSeptember&lt;/a&gt;. You'll find other helpful articles, detailed tutorials, and videos in this all-things-Serverless content collection. New articles are published every day — that's right, every day — from community members and cloud advocates in the month of September. &lt;/p&gt;

&lt;p&gt;Find out more about how Microsoft Azure enables your Serverless functions at &lt;a href="https://docs.microsoft.com/azure/azure-functions/?WT.mc_id=servsept_devto-blog-cxa" rel="noopener noreferrer"&gt;https://docs.microsoft.com/azure/azure-functions/&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You should never store secrets in code. But what if your function need access to a secret, ie. a connection string to a storage blob?  You can store those secrets in &lt;a href="https://azure.microsoft.com/en-us/services/key-vault/" rel="noopener noreferrer"&gt;Azure KeyVault&lt;/a&gt; and securely reference said secrets in your function app.&lt;/p&gt;

&lt;p&gt;The rest of this article is going to show you how to set this up without using Azure Portal.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you want to learn more about how to better secure your function app, take a look at this article by Function PM Matthew&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/mattchenderson" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F232866%2F9beda4df-c1a8-44cd-b625-d9e41f6d91bb.jpeg" alt="mattchenderson"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/mattchenderson/they-can-t-hack-your-servers-if-you-don-t-have-any-servers-right-246a" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;They can't hack your servers if you don't have any servers, right?&lt;/h2&gt;
      &lt;h3&gt;Matthew Henderson ・ Sep 23 '19&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#serverless&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#security&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#azure&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  Pre-requisites
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Azure CLI
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest" rel="noopener noreferrer"&gt;Installation guide&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  jq
&lt;/h2&gt;

&lt;p&gt;a lightweight and flexible &lt;a href="https://stedolan.github.io/jq/" rel="noopener noreferrer"&gt;command-line JSON processor&lt;/a&gt; that I promise you'll be using over and over again&lt;/p&gt;

&lt;h2&gt;
  
  
  A deployed function app
&lt;/h2&gt;

&lt;p&gt;This can either be done through&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-first-azure-function-azure-cli" rel="noopener noreferrer"&gt;azure-cli&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Serverless framework - recommended since this article is building upon the sample app walk through from yesterday&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/mydiemho" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F129508%2F7c8145a1-059b-464a-8737-c507e31a7fb1.png" alt="mydiemho"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/mydiemho/create-and-deploy-azure-functions-with-serverless-20ai" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Create and Deploy Azure Functions with Serverless&lt;/h2&gt;
      &lt;h3&gt;My ・ Sep 24 '19&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#serverless&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#webdev&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#tutorial&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#node&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;h1&gt;
  
  
  Walk-through
&lt;/h1&gt;

&lt;p&gt;All the scripts I mentioned below can be find in this accompanying repo&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/mydiemho" rel="noopener noreferrer"&gt;
        mydiemho
      &lt;/a&gt; / &lt;a href="https://github.com/mydiemho/myho-serverless-demo" rel="noopener noreferrer"&gt;
        myho-serverless-demo
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      app to demo connecting Azure KeyVault using Serverless Framework
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;blockquote&gt;
&lt;p&gt;Feel free to change the chosen resource name in the scripts to something else, but beware that different resource have different naming restrictions.&lt;/p&gt;

&lt;p&gt;Refer to the &lt;a href="https://docs.microsoft.com/en-us/azure/architecture/best-practices/naming-conventions#general" rel="noopener noreferrer"&gt;Azure resources naming convention guide&lt;/a&gt; if you're having trouble using &lt;br&gt;
your desire values.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Log in
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;az account show &lt;span class="c"&gt;# list all subscriptions you have access to &lt;/span&gt;
az account &lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;--subscription&lt;/span&gt; &amp;lt;SUB_ID&amp;gt; &lt;span class="c"&gt;# id of the sub you want to use&lt;/span&gt;
az login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Clone repo
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone git@github.com:mydiemho/myho-serverless-demo.git
&lt;span class="nb"&gt;cd &lt;/span&gt;myho-serverless-demo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Set up keyVault
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./scripts/create-keyvault.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The script will create a resource group and a keyVault.&lt;/p&gt;


&lt;h2&gt;
  
  
  Add secrets
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./scripts/add-secrets.sh AwesomeSecret AwesomeSecretValue
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;blockquote&gt;
&lt;p&gt;The script takes 2 inputs: the secret key and the secret value.  If you do not pass in any inputs, the default key and value will be used.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Take note of the &lt;code&gt;secret url&lt;/code&gt; in the output, you'll need it in a later step&lt;/p&gt;
&lt;h2&gt;
  
  
  Grant function app read permission
&lt;/h2&gt;

&lt;p&gt;In order for the app the reference keyVault secrets, you have to add the app to the keyVault's access policies.&lt;/p&gt;
&lt;h3&gt;
  
  
  Behind the scene
&lt;/h3&gt;

&lt;p&gt;The steps involved in doing this is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Adding a system-assigned identity to the function app &lt;sup&gt;&lt;a href="https://docs.microsoft.com/en-us/azure/app-service/overview-managed-identity" rel="noopener noreferrer"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add this identity as access policy to keyVault&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  How-to
&lt;/h3&gt;

&lt;p&gt;You'll have to first deploy a function app, then you can using the following script to grant access to the app&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./scripts/grant-app-access.sh &amp;lt;APP_RESOURCE_GROUP&amp;gt; &amp;lt;APP_NAME&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Once the script finish, you can check the portal and see that a new access policy has been added to the function app&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F72gw3roswpm4olw54l12.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F72gw3roswpm4olw54l12.png" alt="KeyVault access policies portal"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  Add new app setting
&lt;/h2&gt;

&lt;p&gt;We'll add the keyvault secret reference as an app setting &lt;sup&gt;&lt;a href="https://docs.microsoft.com/en-us/azure/azure-functions/functions-how-to-use-azure-function-app-settings" rel="noopener noreferrer"&gt;*&lt;/a&gt;&lt;/sup&gt;.  App settings are available as environment variables to function handlers.  &lt;/p&gt;

&lt;p&gt;Using serverless, anything under the &lt;code&gt;environment&lt;/code&gt; section will be created as app settings.  &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Make sure to replace the url with the one generated in add secrets&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;
&lt;span class="c1"&gt;# see https://github.com/mydiemho/myho-serverless-demo/blob/master/serverless.yml#L29&lt;/span&gt;

  &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="c1"&gt;# these will be created as application settings&lt;/span&gt;
    &lt;span class="na"&gt;SUPER_SECRET&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;@Microsoft.KeyVault(SecretUri=https://myho-serverless-demo-kv.vault.azure.net/secrets/MySuperSecretName/88df087331004326994047248b0b6b67)"&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Add new function
&lt;/h2&gt;

&lt;p&gt;You can either update the handler code for one of the function or create a new function.  For this example, I choose to create a new function called &lt;code&gt;secrets&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  update serverless.yml
&lt;/h3&gt;

&lt;p&gt;add the following section to your yaml below existing functions&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="c1"&gt;# see https://github.com/mydiemho/myho-serverless-demo/blob/master/serverless.yml#L93&lt;/span&gt;

  &lt;span class="na"&gt;secrets&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;handler&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;src/handlers/secrets.printSecrets&lt;/span&gt;
    &lt;span class="na"&gt;events&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;http&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
        &lt;span class="na"&gt;x-azure-settings&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;methods&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;GET&lt;/span&gt;
          &lt;span class="na"&gt;authLevel&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;anonymous&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  add handler code
&lt;/h3&gt;

&lt;p&gt;Add a new file &lt;code&gt;src/handlers/secrets.js&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;
&lt;span class="c"&gt;# https://github.com/mydiemho/myho-serverless-demo/blob/master/src/handlers/secrets.js&lt;/span&gt;

&lt;span class="s2"&gt;"use strict"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

const superSecret &lt;span class="o"&gt;=&lt;/span&gt; process.env[&lt;span class="s2"&gt;"SUPER_SECRET"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

module.exports.printSecrets &lt;span class="o"&gt;=&lt;/span&gt; async &lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;context, req&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
  context.log&lt;span class="o"&gt;(&lt;/span&gt;
    &lt;span class="s2"&gt;"JavaScript HTTP trigger function processed a request to display the secret in keyvault."&lt;/span&gt;
  &lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  context.res &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    // status: 200, /&lt;span class="k"&gt;*&lt;/span&gt; Defaults to 200 &lt;span class="k"&gt;*&lt;/span&gt;/
    // FOR DEMO PURPOSE: DO NOT LOG SECRETS IN PRODUCTION
    body: &lt;span class="sb"&gt;`&lt;/span&gt;Shhhhh.. it&lt;span class="s1"&gt;'s a secret: ${superSecret}`
  };
};

&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Deploy new changes
&lt;/h2&gt;

&lt;p&gt;Once you've done all the set up, you're now ready to test out your new function app that is referencing KeyVault&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sls deploy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;blockquote&gt;
&lt;p&gt;If you're having trouble deploying, refer to this article to make sure you have done all the pre-requisites &lt;/p&gt;
&lt;div class="ltag__link"&gt;
  &lt;a href="/mydiemho" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F129508%2F7c8145a1-059b-464a-8737-c507e31a7fb1.png" alt="mydiemho"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/mydiemho/create-and-deploy-azure-functions-with-serverless-20ai" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Create and Deploy Azure Functions with Serverless&lt;/h2&gt;
      &lt;h3&gt;My ・ Sep 24 '19&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#serverless&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#webdev&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#tutorial&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#node&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;br&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Verify changes
&lt;/h3&gt;

&lt;p&gt;After deploy, you can hit the function url, apim url, or using the &lt;code&gt;invoke&lt;/code&gt; command to test your changes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;➜ sls invoke &lt;span class="nt"&gt;-f&lt;/span&gt; secrets                                                                             
Serverless: Logging into Azure

...

Serverless: Invoking &lt;span class="k"&gt;function &lt;/span&gt;secrets with GET request
Serverless: &lt;span class="s2"&gt;"Shhhhh.. it's a secret: ItIsASecret"&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>serverless</category>
      <category>webdev</category>
      <category>tutorial</category>
      <category>node</category>
    </item>
    <item>
      <title>Create and Deploy Azure Functions with Serverless</title>
      <dc:creator>My</dc:creator>
      <pubDate>Tue, 24 Sep 2019 23:04:19 +0000</pubDate>
      <link>https://dev.to/mydiemho/create-and-deploy-azure-functions-with-serverless-20ai</link>
      <guid>https://dev.to/mydiemho/create-and-deploy-azure-functions-with-serverless-20ai</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;This article is part of &lt;a href="https://dev.to/azure/serverless-september-content-collection-2fhb"&gt;#ServerlessSeptember&lt;/a&gt;. You'll find other helpful articles, detailed tutorials, and videos in this all-things-Serverless content collection. New articles are published every day — that's right, every day — from community members and cloud advocates in the month of September. &lt;/p&gt;

&lt;p&gt;Find out more about how Microsoft Azure enables your Serverless functions at &lt;a href="https://docs.microsoft.com/azure/azure-functions/?WT.mc_id=servsept_devto-blog-cxa"&gt;https://docs.microsoft.com/azure/azure-functions/&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  Overview
&lt;/h1&gt;

&lt;p&gt;Previously, the most common way to create Azure Functions is through the &lt;a href="https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-first-azure-function"&gt;portal&lt;/a&gt; or using &lt;a href="https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-first-azure-function-azure-cli"&gt;azure-cli&lt;/a&gt;.  &lt;/p&gt;

&lt;p&gt;When using either of these tools to create and deploy Azure Functions, you have to first manually deploy the dependent resources&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Resource group&lt;/li&gt;
&lt;li&gt;Storage account&lt;/li&gt;
&lt;li&gt;App service plan&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You also have to write your own bindings and put them in a specific location for functions to work &lt;sup&gt;&lt;a href="https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-node#folder-structure"&gt;1&lt;/a&gt;&lt;/sup&gt;.  For example, if you have a &lt;code&gt;hello&lt;/code&gt; http-trigger function, you will need a &lt;code&gt;hello/function.json&lt;/code&gt; file with the following content&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;hello/function.json&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;"disabled"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"bindings"&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;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"httpTrigger"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"direction"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"in"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"req"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"authLevel"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"anonymous"&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;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"http"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"direction"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"out"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"res"&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;"entryPoint"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"sayHello"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"scriptFile"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"../src/handlers/hello.js"&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;Fortunately, there's a much simpler way to do this. The &lt;a href="https://github.com/serverless/serverless-azure-functions/blob/master/CHANGELOG.md"&gt;serverless-azure-functions plugin&lt;/a&gt; allows you to quickly create and deploy function without all the overhead work.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Currently, the plugin only supports node, support for other languages are coming.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Pre-requisites
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Node.js
&lt;/h3&gt;

&lt;p&gt;Serverless is a Node.js CLI tool so you'll need to &lt;a href="https://nodejs.org/en/download/package-manager/"&gt;install Node.js&lt;/a&gt; on your machine.&lt;/p&gt;

&lt;h3&gt;
  
  
  Serverless
&lt;/h3&gt;

&lt;p&gt;Make sure &lt;a href="https://github.com/serverless/serverless"&gt;Serverless&lt;/a&gt; is installed and you're on at least &lt;code&gt;1.53&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;   npm i &lt;span class="nt"&gt;-g&lt;/span&gt; serverless
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;





&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;➜ sls &lt;span class="nt"&gt;-v&lt;/span&gt;
Framework Core: 1.53.0
Plugin: 3.1.0
SDK: 2.1.1
Components Core: 1.0.0
Components CLI: 1.2.3
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Once installed, the Serverless CLI can be call with &lt;code&gt;serverless&lt;/code&gt; or &lt;br&gt;
   the shorthand &lt;code&gt;sls&lt;/code&gt; command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;sls &lt;span class="nt"&gt;-h&lt;/span&gt;


Commands
&lt;span class="k"&gt;*&lt;/span&gt; You can run commands with &lt;span class="s2"&gt;"serverless"&lt;/span&gt; or the shortcut &lt;span class="s2"&gt;"sls"&lt;/span&gt;
&lt;span class="k"&gt;*&lt;/span&gt; Pass &lt;span class="s2"&gt;"--verbose"&lt;/span&gt; to this &lt;span class="nb"&gt;command &lt;/span&gt;to get &lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="nt"&gt;-depth&lt;/span&gt; plugin info
&lt;span class="k"&gt;*&lt;/span&gt; Pass &lt;span class="s2"&gt;"--no-color"&lt;/span&gt; to disable CLI colors
&lt;span class="k"&gt;*&lt;/span&gt; Pass &lt;span class="s2"&gt;"--help"&lt;/span&gt; after any &amp;lt;&lt;span class="nb"&gt;command&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;for &lt;/span&gt;contextual &lt;span class="nb"&gt;help&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;






&lt;h2&gt;
  
  
  Create function
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Command
&lt;/h3&gt;

&lt;p&gt;Using the &lt;code&gt;create&lt;/code&gt; command we can specify one of the available &lt;a href="https://serverless.com/framework/docs/providers/azure/cli-reference/create#available-templates"&gt;templates&lt;/a&gt;. For this example we use &lt;code&gt;azure-nodejs&lt;/code&gt; with the &lt;code&gt;--template&lt;/code&gt; or shorthand &lt;code&gt;-t&lt;/code&gt; flag.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;--path&lt;/code&gt; or shorthand &lt;code&gt;-p&lt;/code&gt; is the location to be created with the template service files.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;sls create &lt;span class="nt"&gt;--template&lt;/span&gt; azure-nodejs &lt;span class="nt"&gt;--path&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;whoami&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="nt"&gt;-sample-app&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  Output
&lt;/h3&gt;

&lt;p&gt;The command above created a new directory, in my case &lt;code&gt;myho-sample-app&lt;/code&gt;, with the following contents.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;├── src
|   ├── handlers
|       ├── goodbye.js
|       ├── hello.js
|   ├── .gitignore
|   ├── host.json
|   ├── package.json
|   ├── README.md
|   ├── serverless.yml
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  Note
&lt;/h3&gt;

&lt;p&gt;Azure plugin uses a combination of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;prefix, if provided&lt;/li&gt;
&lt;li&gt;service name&lt;/li&gt;
&lt;li&gt;region&lt;/li&gt;
&lt;li&gt;stage&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;to generate resource names on deployment. Since resource name have to be unique in Azure, adding &lt;code&gt;$(whoami)&lt;/code&gt; will append your username to&lt;br&gt;
the service name, thus creating a unique name.&lt;/p&gt;


&lt;h2&gt;
  
  
  Install Azure Plugin
&lt;/h2&gt;

&lt;p&gt;The previous step created a new directory &lt;code&gt;&amp;lt;YOUR-USER-NAME&amp;gt;-sample-app&lt;/code&gt; where all the function related code are stored. &lt;code&gt;cd&lt;/code&gt; into that directory&lt;/p&gt;

&lt;p&gt;Run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;






&lt;h2&gt;
  
  
  Testing locally
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;You can skip this section if you do not want to test your functions locally before deploy.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The sample app created from template contains 2 functions: hello and goodbye.  You can test them locally before deploying to Azure.&lt;/p&gt;

&lt;p&gt;You'll need to use 2 terminal windows for the following.&lt;/p&gt;

&lt;h3&gt;
  
  
  Terminal 1
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;sls offline
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;While this process is running, you'll notice that some new files have been added.  These files are necessary for Azure function to operate but will be clean up when the process exit. &lt;/p&gt;

&lt;h3&gt;
  
  
  Terminal 2
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;sls invoke &lt;span class="nb"&gt;local&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; hello &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{"name": "Azure"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;In your terminal window you should see the following response&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;Serverless: URL &lt;span class="k"&gt;for &lt;/span&gt;invocation: http://localhost:7071/api/hello?name%3DAzure
&lt;span class="nv"&gt;$ &lt;/span&gt;Serverless: Invoking &lt;span class="k"&gt;function &lt;/span&gt;hello with GET request
&lt;span class="nv"&gt;$ &lt;/span&gt;Serverless: &lt;span class="s2"&gt;"Hello Azure"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;






&lt;h2&gt;
  
  
  Deploy to Azure
&lt;/h2&gt;

&lt;p&gt;Once you're happy with your code, the next step is to deploy to Azure. &lt;/p&gt;

&lt;h3&gt;
  
  
  Azure subscription
&lt;/h3&gt;

&lt;p&gt;If you don't have an Azure account, get started by &lt;a href="https://azure.microsoft.com/en-us/free/"&gt;signing up for a free account&lt;/a&gt;, which includes $200 of free credit&lt;/p&gt;

&lt;h3&gt;
  
  
  Set up credentials
&lt;/h3&gt;

&lt;p&gt;Before you can deploy, you'll have to set up a &lt;code&gt;service principal&lt;/code&gt;. &lt;/p&gt;

&lt;h4&gt;
  
  
  Azure-cli
&lt;/h4&gt;

&lt;p&gt;Make sure you have &lt;a href="https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest"&gt;azure-cli&lt;/a&gt; installed&lt;/p&gt;

&lt;h4&gt;
  
  
  Log in
&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;az login
az account list &lt;span class="c"&gt;# list all subscriptions&lt;/span&gt;
az account &lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;--subscription&lt;/span&gt; &amp;lt;SUBSCRIPTION_ID&amp;gt; &lt;span class="c"&gt;# choose the one you want&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  Generate service principals
&lt;/h4&gt;

&lt;p&gt;Download this &lt;a href="https://raw.githubusercontent.com/serverless/serverless-azure-functions/master/scripts/generate-service-principal.sh"&gt;script&lt;/a&gt;, run it, and follow the printed instruction.&lt;/p&gt;

&lt;p&gt;The script will generate, extract, and write the required credentials to a file that you can then export as environment variables.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Download the file and name it `sp.sh`&lt;/span&gt;
curl https://raw.githubusercontent.com/serverless/serverless-azure-functions/master/scripts/generate-service-principal.sh &lt;span class="nt"&gt;-o&lt;/span&gt; sp.sh

&lt;span class="c"&gt;# skip this if you're on windows&lt;/span&gt;
&lt;span class="nb"&gt;chmod&lt;/span&gt; +x sp.sh

&lt;span class="c"&gt;# run the script&lt;/span&gt;
./sp.sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  Deploy
&lt;/h3&gt;

&lt;p&gt;Deploying to Azure is as simple as running the following command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# if you want more logging info, uncomment the next line&lt;/span&gt;
&lt;span class="c"&gt;# export SLS_DEBUG=*&lt;/span&gt;

sls deploy
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  Behind the scene
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;The plugin created an arm template that is used to deploy all the dependent resources&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Resource group&lt;/li&gt;
&lt;li&gt;App service plan&lt;/li&gt;
&lt;li&gt;Storage account&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Once the infrastructure is up and running, the zipped source code is deployed to the function app&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;➜ sls deploy
Serverless: Parsing Azure Functions Bindings.json...
Serverless: Building binding &lt;span class="k"&gt;for function&lt;/span&gt;: hello event: httpTrigger
Serverless: Parsing Azure Functions Bindings.json...
Serverless: Building binding &lt;span class="k"&gt;for function&lt;/span&gt;: goodbye event: httpTrigger
Serverless: Packaging service...

...

Serverless: -&amp;gt; Deploying ARM template...

...

Serverless: -&amp;gt; ARM deployment &lt;span class="nb"&gt;complete
&lt;/span&gt;Serverless: Deploying serverless functions...
Serverless: Deploying zip file to &lt;span class="k"&gt;function &lt;/span&gt;app: sls-wus-dev-myho-sample-app
Serverless: -&amp;gt; Deploying service package @ /Users/myho/dev/work/github.com/mydiemho/azure-utils/myho-sample-app/.serverless/myho-sample-app.zip

...

Serverless: Deployed serverless functions:
Serverless: -&amp;gt; goodbye: &lt;span class="o"&gt;[&lt;/span&gt;GET] sls-wus-dev-myho-sample-app.azurewebsites.net/api/goodbye
Serverless: -&amp;gt; hello: &lt;span class="o"&gt;[&lt;/span&gt;GET] sls-wus-dev-myho-sample-app.azurewebsites.net/api/hello
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  Test deployed functions
&lt;/h3&gt;

&lt;p&gt;You can test the deployed functions by going directly to the url, or using the &lt;code&gt;invoke&lt;/code&gt; command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;sls invoke &lt;span class="nt"&gt;-f&lt;/span&gt; hello &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{"name": "Azure"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;






&lt;h2&gt;
  
  
  Wrap up
&lt;/h2&gt;

&lt;p&gt;Congratulation! You have created and deployed your first Azure function with Serverless.  &lt;/p&gt;




&lt;h2&gt;
  
  
  Next step
&lt;/h2&gt;

&lt;p&gt;There are a lot more you can do with Serverless than just Http-trigger functions. &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://docs.microsoft.com/en-us/azure/api-management/"&gt;API Management&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;You can add APIM to your functions by configure the &lt;code&gt;apim&lt;/code&gt; section in &lt;code&gt;serverless.yml&lt;/code&gt;.  The generated file already included this, just uncommented the section (line 33-59) and redeploy to give it a try.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;APIM Configuration
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# serverless.yml&lt;/span&gt;

&lt;span class="na"&gt;apim&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;apis&lt;/span&gt;&lt;span class="pi"&gt;:&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;v1&lt;/span&gt;
      &lt;span class="na"&gt;subscriptionRequired&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="no"&gt;false&lt;/span&gt; &lt;span class="c1"&gt;# if true must provide an api key&lt;/span&gt;
      &lt;span class="na"&gt;displayName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;v1&lt;/span&gt;
      &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;V1 sample app APIs&lt;/span&gt;
      &lt;span class="na"&gt;protocols&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;https&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;v1&lt;/span&gt;
      &lt;span class="na"&gt;tags&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;tag1&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;tag2&lt;/span&gt;
      &lt;span class="na"&gt;authorization&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;none&lt;/span&gt;
  &lt;span class="na"&gt;cors&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;allowCredentials&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="no"&gt;false&lt;/span&gt;
    &lt;span class="na"&gt;allowedOrigins&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;*"&lt;/span&gt;
    &lt;span class="na"&gt;allowedMethods&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;GET&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;POST&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;PUT&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;DELETE&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;PATCH&lt;/span&gt;
    &lt;span class="na"&gt;allowedHeaders&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;*"&lt;/span&gt;
    &lt;span class="na"&gt;exposeHeaders&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;*"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;1 . Deploy Output&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;➜ sls deploy

...

Serverless: Starting APIM service deployment
Serverless: -&amp;gt; Deploying API keys
Serverless: -&amp;gt; Deploying API: v1
Serverless: -&amp;gt; Deploying API Backend: myho-sample-app-backend &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; https://sls-wus-dev-myho-sample-app.azurewebsites.net/api
Serverless: -&amp;gt; Deploying CORS policy: v1
Serverless: -&amp;gt; Deploying API Operations: sls-wus-dev-797b03-apim
Serverless: &lt;span class="nt"&gt;--&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; GET-hello: &lt;span class="o"&gt;[&lt;/span&gt;GET] https://sls-wus-dev-797b03-apim.azure-api.net/v1/hello
Serverless: &lt;span class="nt"&gt;--&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; GET-goodbye: &lt;span class="o"&gt;[&lt;/span&gt;GET] https://sls-wus-dev-797b03-apim.azure-api.net/v1/goodbye
Serverless: Finished APIM service deployment
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;You will not be able to use the &lt;code&gt;invoke&lt;/code&gt; command to test the APIM set up&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Additional Triggers
&lt;/h3&gt;

&lt;p&gt;In addition to http-trigger functions, the following triggers are also supported&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Storage Blob&lt;/li&gt;
&lt;li&gt;Storage Queue&lt;/li&gt;
&lt;li&gt;Timer&lt;/li&gt;
&lt;li&gt;Service Bus Queue&lt;/li&gt;
&lt;li&gt;Service Bus Topic&lt;/li&gt;
&lt;li&gt;EventHubs&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For more information, see the &lt;a href="https://serverless.com/framework/docs/providers/azure/events/"&gt;official doc&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  More hands-on training
&lt;/h2&gt;

&lt;p&gt;If you get this far and want to learn more about serverless on Azure, Microsoft is hosting a free workshop in NYC before &lt;a href="https://serverlessconf.io/"&gt;ServerlessConf&lt;/a&gt; on Monday, Oct 7, 2019.  Registration is @ &lt;a href="http://aka.ms/nycworkshop"&gt;http://aka.ms/nycworkshop&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There may or may not be 🍦🍦🍦🍦🍦&lt;/p&gt;

</description>
      <category>serverless</category>
      <category>webdev</category>
      <category>tutorial</category>
      <category>node</category>
    </item>
    <item>
      <title>ErrorBoundary does not re-render app when place below react-router</title>
      <dc:creator>My</dc:creator>
      <pubDate>Fri, 25 Jan 2019 06:13:21 +0000</pubDate>
      <link>https://dev.to/mydiemho/errorboundary-does-not-re-render-app-when-place-below-react-router-568f</link>
      <guid>https://dev.to/mydiemho/errorboundary-does-not-re-render-app-when-place-below-react-router-568f</guid>
      <description>&lt;p&gt;I am adding ErrorBoundary to my app but I found that when I add ErrorBoundary below react-router, the app doesn't re-render on route change until I manually force refresh.  &lt;/p&gt;

&lt;p&gt;Here's the sample code.  I'm using BrowserRouter here. I would like to understand why the order of placement is important here.&lt;/p&gt;

&lt;h1&gt;
  
  
  App doesn't re-render until force refresh
&lt;/h1&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;Router&amp;gt;
    &amp;lt;div className="app-shell"&amp;gt;
        &amp;lt;ErrorBoundary&amp;gt;
            &amp;lt;Navbar /&amp;gt;
            &amp;lt;div className="app-main"&amp;gt;
                &amp;lt;Sidebar project={this.props.currentProject} /&amp;gt;
                &amp;lt;MainContentRouter /&amp;gt;
            &amp;lt;/div&amp;gt;
            &amp;lt;ToastContainer /&amp;gt;
        &amp;lt;/ErrorBoundary&amp;gt;
    &amp;lt;/div&amp;gt;
&amp;lt;Router&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h1&gt;
  
  
  WORKS FINE
&lt;/h1&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;ErrorBoundary&amp;gt;
    &amp;lt;Router&amp;gt;
        &amp;lt;div className="app-shell"&amp;gt;
            &amp;lt;Navbar /&amp;gt;
            &amp;lt;div className="app-main"&amp;gt;
                &amp;lt;Sidebar project={this.props.currentProject} /&amp;gt;
                &amp;lt;MainContentRouter /&amp;gt;
            &amp;lt;/div&amp;gt;
            &amp;lt;ToastContainer /&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;Router&amp;gt;
&amp;lt;/ErrorBoundary&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



</description>
      <category>help</category>
      <category>reactrouter</category>
      <category>react</category>
    </item>
  </channel>
</rss>
