{"id":17145,"date":"2018-01-25T19:51:00","date_gmt":"2018-01-25T19:51:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/premier_developer\/?p=17145"},"modified":"2019-07-29T12:14:13","modified_gmt":"2019-07-29T19:14:13","slug":"amazon-alexa-skills-authenticated-by-azure-active-directory-and-backed-by-an-azure-function","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/premier-developer\/amazon-alexa-skills-authenticated-by-azure-active-directory-and-backed-by-an-azure-function\/","title":{"rendered":"Amazon Alexa Skills authenticated by Azure Active Directory and backed by an Azure Function"},"content":{"rendered":"<p>This post is provided by Premier Field Engineer, <a href=\"https:\/\/www.linkedin.com\/in\/nathan-vanderby-92a19814\/\">Nathan Vanderby<\/a>, who walks us through how to write an Alexa skill using Azure Functions.\u00a0 <strong>Last updated June 2018.<\/strong><\/p>\n<hr \/>\n<p>Most people have heard of the Amazon Echo and the skills that provide it functions. Amazon makes it really easy to create these skills using an AWS Lambda function. These can also be backed using a REST <a href=\"https:\/\/blogs.msdn.microsoft.com\/premier_developer\/2017\/12\/09\/amazon-alexa-skills-authenticated-by-azure-active-directory-and-backed-by-asp-net-core-2-0-web-api-hosted-on-azure\/\">API app<\/a> or even an Azure Function. Below we will give some instructions for how to leverage Azure Functions. The steps below are almost identical to how you would configure a generic backend API with authentication except that the Azure Function needs to manually verify the JWT token instead of leveraging the <code>[Authorize]<\/code> attribute.<\/p>\n<h4>Step-by-step tutorial<\/h4>\n<h5>Step 1: Create an Azure Subscription<\/h5>\n<p>If you haven&#8217;t already signed up for Azure you can do so <a href=\"https:\/\/azure.microsoft.com\/en-us\/pricing\/purchase-options\/\">here<\/a>. We will use Azure AD for app registration and Azure Functions for the backend. Azure Functions creates a storage account and App. Service resources with it. The cost of doing a proof of concept should be minimal given the app registrations are free, we won&#8217;t be using the storage account and Azure Functions give <a href=\"https:\/\/azure.microsoft.com\/en-us\/pricing\/details\/functions\/\">400,000 GB-s<\/a> free each month.<\/p>\n<h5>Step 2: Create your Azure Function<\/h5>\n<p>We will start off by using the <strong>Azure Functions<\/strong> new project template in Visual Studio. This tutorial focuses on C#, but it is also possible to <a href=\"https:\/\/blogs.msdn.microsoft.com\/appserviceteam\/2017\/09\/25\/develop-azure-functions-on-any-platform\/\">develop Azure Functions on any platform<\/a>.\n<img decoding=\"async\" class=\"alignnone size-full wp-image-37532\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/NewProjectWizard.png\" alt=\"\" width=\"1207\" height=\"440\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/NewProjectWizard.png 1207w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/NewProjectWizard-300x109.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/NewProjectWizard-768x280.png 768w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/NewProjectWizard-1024x373.png 1024w\" sizes=\"(max-width: 1207px) 100vw, 1207px\" \/><\/p>\n<p>Make sure your project is at least on .NET Framework 4.6.1. This is due to the <a href=\"https:\/\/github.com\/timheuer\/alexa-skills-dotnet\">Alexa.Net<\/a> NuGet package we will use to deserialize the Alexa JSON to classes. This will require us to use the Azure Function <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/azure-functions\/functions-versions\">2.x runtime version<\/a>.<\/p>\n<p>Once your project is created add a new <strong>Azure Function<\/strong> item to it.\n<img decoding=\"async\" class=\"alignnone size-full wp-image-37534\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/NewItemWizard1.png\" alt=\"\" width=\"1222\" height=\"314\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/NewItemWizard1.png 1222w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/NewItemWizard1-300x77.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/NewItemWizard1-768x197.png 768w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/NewItemWizard1-1024x263.png 1024w\" sizes=\"(max-width: 1222px) 100vw, 1222px\" \/><\/p>\n<p>Set the trigger type to <strong>Http trigger<\/strong> and the access rights to <strong>Anonymous<\/strong>.\n<img decoding=\"async\" class=\"alignnone size-full wp-image-37535\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/NewItemWizard2.png\" alt=\"\" width=\"1402\" height=\"370\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/NewItemWizard2.png 1402w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/NewItemWizard2-300x79.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/NewItemWizard2-768x203.png 768w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/NewItemWizard2-1024x270.png 1024w\" sizes=\"(max-width: 1402px) 100vw, 1402px\" \/><\/p>\n<p>This will give us a default Run method that is attributed such that the Azure function name is what you specified in the wizard (Alexa in this case). It also sets up anonymous authorization with get and post REST methods. The inputs to the method is an HttpRequestMessage and a TraceWriter.<\/p>\n<p>Add the <strong>Alexa.NET<\/strong> NuGet Package (<a href=\"https:\/\/github.com\/timheuer\/alexa-skills-dotnet\">https:\/\/github.com\/timheuer\/alexa-skills-dotnet<\/a>) to the project so we can easily deserialize the JSON into classes.\n<img decoding=\"async\" class=\"alignnone size-full wp-image-37536\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaNetNuget.png\" alt=\"\" width=\"2031\" height=\"331\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaNetNuget.png 2031w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaNetNuget-300x49.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaNetNuget-768x125.png 768w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaNetNuget-1024x167.png 1024w\" sizes=\"(max-width: 2031px) 100vw, 2031px\" \/><\/p>\n<p>Now we can add some code. First modify the method signature. We can remove the <code>get<\/code> REST API and we can leverage the <code>[FromBody]<\/code> attribute to easily deserialize the JSON into a <code>SkillRequest<\/code>. Then add some code to respond to a skill request. The code below simply looks for a first name and responds with &#8220;Hello [FirstName]&#8221;.<\/p>\n<pre><code>[FunctionName(\"Alexa\")]\r\npublic static async Task&lt;SkillResponse&gt; Run(\r\n    [HttpTrigger(AuthorizationLevel.Anonymous, \"post\", Route = null)]\r\n    [FromBody]SkillRequest request, TraceWriter log)\r\n{\r\n    SkillResponse response = null;\r\n    PlainTextOutputSpeech outputSpeech = new PlainTextOutputSpeech();\r\n    string firstName = (request.Request as IntentRequest)?.Intent.Slots.FirstOrDefault(s =&gt; s.Key == \"FirstName\").Value?.Value;\r\n    outputSpeech.Text = \"Hello \" + firstName;\r\n    response = ResponseBuilder.Tell(outputSpeech);\r\n    return response;\r\n} \r\n<\/code><\/pre>\n<p>This code will work as an unauthenticated backend for an Alexa skill. Lets publish it and test it, then circle back to add authentication.<\/p>\n<h5>Step 3: Publish to Azure<\/h5>\n<p>To push the code to Azure simply right click on the project and select <strong>Publish<\/strong>. Walk through the wizard to create a new Azure Function or select from one that has been already created.<\/p>\n<p>Once the Azure function is created we need to change the runtime version to V2. Go to <a href=\"\/Users\/reedr\/Desktop\/Nathan\/\">portal.azure.com<\/a> and navigate to the function you are using. From the <strong>Overview<\/strong> pane select <strong>Function app settings<\/strong>.\n<img decoding=\"async\" class=\"alignnone size-full wp-image-37537\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/OverviewSettings.png\" alt=\"\" width=\"458\" height=\"365\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/OverviewSettings.png 458w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/OverviewSettings-300x239.png 300w\" sizes=\"(max-width: 458px) 100vw, 458px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Inside the app settings change the <strong>Runtime version<\/strong> to be at least 2.0, currently this is the beta. This is only required since we are leveraging a NuGet that is build for .NET Standard 1.6. If you write your own library or use a different one that is compatible with .NET Framework 4.5 this is not necessary.\n<img decoding=\"async\" class=\"alignnone size-full wp-image-37538\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AppSettings.png\" alt=\"\" width=\"565\" height=\"231\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AppSettings.png 565w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AppSettings-300x123.png 300w\" sizes=\"(max-width: 565px) 100vw, 565px\" \/><\/p>\n<p>Now you should be able to return to Visual Studio and publish your function to Azure. Once your publish is successful you will want to go back to Azure, select that function and copy its URL for use in configuring the Alexa skill.\n<img decoding=\"async\" class=\"alignnone size-full wp-image-37539\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/FunctionURL.png\" alt=\"\" width=\"745\" height=\"119\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/FunctionURL.png 745w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/FunctionURL-300x48.png 300w\" sizes=\"(max-width: 745px) 100vw, 745px\" \/><\/p>\n<h5>Step 4: Configure the Alexa Skill<\/h5>\n<p>Now that we have our code in Azure we need to configure the Alexa skill. Navigate to <a href=\"https:\/\/developer.amazon.com\/alexa\">Amazon&#8217;s developer<\/a> page for Alexa, you will have to create an account. Navigate to <strong>Alexa Skills Kit -&gt; Get Started -&gt; Alexa Skills Kit<\/strong>.\n<img decoding=\"async\" class=\"alignnone size-full wp-image-37540\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaSkill1.png\" alt=\"\" width=\"468\" height=\"174\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaSkill1.png 468w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaSkill1-300x112.png 300w\" sizes=\"(max-width: 468px) 100vw, 468px\" \/><\/p>\n<p>Select <strong>Start a Skill<\/strong> then <strong>Create Skill<\/strong>.<\/p>\n<p>Give the skill a name, click next. Select the <strong>Custom<\/strong> model then click <strong>Create Skill<\/strong>.<\/p>\n<h6>Invocation<\/h6>\n<p>Select <strong>Invocation<\/strong> and enter a phrase to invoke your skill. Click <strong>Save<\/strong> then <strong>Next<\/strong> to move onto the Interaction Model.\n<img decoding=\"async\" class=\"alignnone size-full wp-image-37541\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaSkillInvocation.png\" alt=\"\" width=\"568\" height=\"342\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaSkillInvocation.png 568w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaSkillInvocation-300x181.png 300w\" sizes=\"(max-width: 568px) 100vw, 568px\" \/><\/p>\n<h6>Intents<\/h6>\n<p>Select the <strong>Add<\/strong> button next to <strong>Intents<\/strong> and give the intent a name. We will use Tutorial.\n<img decoding=\"async\" class=\"alignnone size-full wp-image-37542\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaSkillIntent.png\" alt=\"\" width=\"912\" height=\"122\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaSkillIntent.png 912w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaSkillIntent-300x40.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaSkillIntent-768x103.png 768w\" sizes=\"(max-width: 912px) 100vw, 912px\" \/><\/p>\n<p>Type in a sample utterance such as <code>Can you greet {FirstName}<\/code> and click <strong>Add<\/strong> to create the sample utterance and the <code>FirstName<\/code> slot.\n<img decoding=\"async\" class=\"alignnone size-full wp-image-37543\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaSkillSampleUtterance.png\" alt=\"\" width=\"491\" height=\"392\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaSkillSampleUtterance.png 491w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaSkillSampleUtterance-300x240.png 300w\" sizes=\"(max-width: 491px) 100vw, 491px\" \/><\/p>\n<p>The intent here is so Alexa knows that when we talk to &#8220;Tutorial&#8221; it should also expect a parameter called FirstName. If you look back at the code in the API Post method you will see how we can read the FirstName slot from the Tutorial intent on the request.<\/p>\n<p>Make sure the <code>FirstName<\/code> slot has a type of <code>Amazon.DE_FIRST_NAME<\/code>.\n<img decoding=\"async\" class=\"alignnone size-full wp-image-37544\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaSkillIntentSlot.png\" alt=\"\" width=\"1069\" height=\"190\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaSkillIntentSlot.png 1069w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaSkillIntentSlot-300x53.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaSkillIntentSlot-768x137.png 768w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaSkillIntentSlot-1024x182.png 1024w\" sizes=\"(max-width: 1069px) 100vw, 1069px\" \/><\/p>\n<p>In the JSON Editor your skill should look like<\/p>\n<pre><code>{\r\n    \"interactionModel\": {\r\n        \"languageModel\": {\r\n            \"invocationName\": \"Tutorial\",\r\n            \"intents\": [\r\n                {\r\n                    \"name\": \"Tutorial\",\r\n                    \"slots\": [\r\n                        {\r\n                            \"name\": \"FirstName\",\r\n                            \"type\": \"AMAZON.DE_FIRST_NAME\"\r\n                        }\r\n                    ],\r\n                    \"samples\": [\r\n                        \"Can you greet {FirstName}\"\r\n                    ]\r\n                },\r\n                {\r\n                    \"name\": \"AMAZON.HelpIntent\",\r\n                    \"samples\": []\r\n                },\r\n                {\r\n                    \"name\": \"AMAZON.StopIntent\",\r\n                    \"samples\": []\r\n                }\r\n            ],\r\n            \"types\": []\r\n        }\r\n    }\r\n}\r\n<\/code><\/pre>\n<p>Click <strong>Save Model<\/strong> and then <strong>Build Model<\/strong><\/p>\n<h5>Interfaces<\/h5>\n<p>Here you can add various interfaces. We won&#8217;t be using any of these. The various options for these are Audio Player, Display Interface, Video App, Alexa Gadget, etc.<\/p>\n<h6>Endpoint<\/h6>\n<p>Select <strong>HTTPS<\/strong> for the endpoint. Under the <strong>Default Region<\/strong> text box enter the URL for your Azure function.\n<img decoding=\"async\" class=\"alignnone size-full wp-image-37545\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaSkillEndpoint.png\" alt=\"\" width=\"1056\" height=\"288\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaSkillEndpoint.png 1056w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaSkillEndpoint-300x82.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaSkillEndpoint-768x209.png 768w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaSkillEndpoint-1024x279.png 1024w\" sizes=\"(max-width: 1056px) 100vw, 1056px\" \/><\/p>\n<p>Select <strong>My development endpoint is a sub-domain of a domain that has a wildcard certificate from a certificate authority<\/strong> from the drop down.<\/p>\n<h6>Test<\/h6>\n<p>In this page take note of the URL you are sending an Alexa request to and simply type in an utterance such as <strong>Tutorial can you greet Nate.<\/strong> You should get a service response.\n<img decoding=\"async\" class=\"alignnone size-full wp-image-37546\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/Testing.png\" alt=\"\" width=\"1304\" height=\"430\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/Testing.png 1304w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/Testing-300x99.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/Testing-768x253.png 768w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/Testing-1024x338.png 1024w\" sizes=\"(max-width: 1304px) 100vw, 1304px\" \/><\/p>\n<p>Now that our skill is working we need to add authentication to it.<\/p>\n<h5>Step 5: Configure Azure Active Directory<\/h5>\n<h6>App Registration<\/h6>\n<p>Go to the Azure portal and find the Azure Active Directory service. Then click on <strong>App registrations<\/strong> and <strong>New application registration<\/strong>.\n<img decoding=\"async\" class=\"alignnone size-full wp-image-37547\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AzureADAppRegistration1.png\" alt=\"\" width=\"611\" height=\"218\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AzureADAppRegistration1.png 611w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AzureADAppRegistration1-300x107.png 300w\" sizes=\"(max-width: 611px) 100vw, 611px\" \/><\/p>\n<p>Give your registration and name, select <strong>Web app\/API<\/strong> as its type and give it a sign-on URL. This URL doesn&#8217;t matter for this tutorial.\n<img decoding=\"async\" class=\"alignnone size-full wp-image-37548\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AzureADAppRegistration2.png\" alt=\"\" width=\"283\" height=\"204\" \/><\/p>\n<p>Now that the app registration is created select <strong>All settings<\/strong> then <strong>Properties<\/strong>. Note the <strong>App ID URI<\/strong> value. We will need this value later on in the C#.\n<img decoding=\"async\" class=\"alignnone size-full wp-image-37549\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AzureADAppRegistration3.png\" alt=\"\" width=\"1918\" height=\"498\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AzureADAppRegistration3.png 1918w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AzureADAppRegistration3-300x78.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AzureADAppRegistration3-768x199.png 768w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AzureADAppRegistration3-1024x266.png 1024w\" sizes=\"(max-width: 1918px) 100vw, 1918px\" \/><\/p>\n<p>Lastly, make note of the <strong>Keys<\/strong> property. We will have to come back here later to generate a key as a part of the Alexa account linking configuration.<\/p>\n<p>That\u2019s it for now. We\u2019ll come back to the app registration later to update the Redirect URI and get a Client Secret (aka Key) as a part of configuring the account linking in the Alexa skill configuration.<\/p>\n<h5>Step 6: Adding Authentication in the Code<\/h5>\n<p>There are a few posts out there for performing token authentication without leveraging ASP.NET middleware. One of the most helpful and relevant to Azure Functions comes from <a href=\"https:\/\/blog.wille-zone.de\/post\/secure-azure-functions-with-jwt-token\/\">Boris Wilhelms<\/a>. I have leveraged his code sample below.<\/p>\n<p>Create a class called Security and copy from the code below. This code is definitely sample code and <strong>not<\/strong> production ready. The two main variables to set are the <code>ISSUER<\/code> and <code>AUDIENCE<\/code>. The GUID for the issuer is your AAD directory ID that you can get from the properties section of the Azure AD resource. The audience value comes from the App ID URI. The code below also requires 2 additional NuGet packages. The first is <code>System.IdentityModel.Tokens.Jwt<\/code> <strong>v5.1.4<\/strong> or lower. The second is <code>Microsoft.IdentityModel.Protocols.OpenIdConnect<\/code> <strong>v2.1.4<\/strong> or lower. At the time of writing this if you use versions 5.1.5 or 2.1.5 respectively a runtime error occurs when Azure tries to load the function.<\/p>\n<pre><code>public static class Security\r\n{\r\n\tprivate static readonly string ISSUER = \"https:\/\/sts.windows.net\/XXXXXXXX-XXXX-XXXX-aec1-f1f2a290f738\/\";\r\n\tprivate static readonly string AUDIENCE = \"https:\/\/AlexaToAzure.onmicrosoft.com\/AlexaBackendAPI\";\r\n\tprivate static readonly IConfigurationManager&lt;OpenIdConnectConfiguration&gt; _configurationManager;\r\n\r\n\tstatic Security()\r\n\t{\r\n\t\tHttpDocumentRetriever documentRetriever = new HttpDocumentRetriever();\r\n\t\tdocumentRetriever.RequireHttps = ISSUER.StartsWith(\"https:\/\/\");\r\n\r\n\t\t_configurationManager = new ConfigurationManager&lt;OpenIdConnectConfiguration&gt;(\r\n\t\t\t$\"{ISSUER}\/.well-known\/openid-configuration\",\r\n\t\t\tnew OpenIdConnectConfigurationRetriever(),\r\n\t\t\tdocumentRetriever);\r\n\t}\r\n\r\n\tpublic static async Task&lt;ClaimsPrincipal&gt; ValidateTokenAsync(string value)\r\n\t{\r\n\t\tvar config = await _configurationManager.GetConfigurationAsync(CancellationToken.None);\r\n\t\tvar issuer = ISSUER;\r\n\t\tvar audience = AUDIENCE;\r\n\r\n\t\tvar validationParameter = new TokenValidationParameters()\r\n\t\t{\r\n\t\t\tRequireSignedTokens = true,\r\n\t\t\tValidAudience = audience,\r\n\t\t\tValidateAudience = true,\r\n\t\t\tValidIssuer = issuer,\r\n\t\t\tValidateIssuer = true,\r\n\t\t\tValidateIssuerSigningKey = true,\r\n\t\t\tValidateLifetime = true,\r\n\t\t\tIssuerSigningKeys = config.SigningKeys\r\n\t\t};\r\n\r\n\t\tClaimsPrincipal result = null;\r\n\t\tvar tries = 0;\r\n\r\n\t\twhile (result == null &amp;&amp; tries &lt;= 1)\r\n\t\t{\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tvar handler = new JwtSecurityTokenHandler();\r\n\t\t\t\tresult = handler.ValidateToken(value, validationParameter, out var token);\r\n\t\t\t}\r\n\t\t\tcatch (SecurityTokenSignatureKeyNotFoundException)\r\n\t\t\t{\r\n\t\t\t\t\/\/ This exception is thrown if the signature key of the JWT could not be found.\r\n\t\t\t\t\/\/ This could be the case when the issuer changed its signing keys, so we trigger a \r\n\t\t\t\t\/\/ refresh and retry validation.\r\n\t\t\t\t_configurationManager.RequestRefresh();\r\n\t\t\t\ttries++;\r\n\t\t\t}\r\n\t\t\tcatch (SecurityTokenException)\r\n\t\t\t{\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n}\r\n<\/code><\/pre>\n<p>Next we have to modify the <code>Run<\/code> method to call into this `ValidateTokenAsyn()&#8220; with the Alexa requests access token.<\/p>\n<pre><code>SkillResponse response = null;\r\nif (request?.Session?.User?.AccessToken != null)\r\n{\r\n\tClaimsPrincipal principal = await Security.ValidateTokenAsync(request.Session.User.AccessToken);\r\n\tif (principal != null)\r\n\t{\r\n\t\tPlainTextOutputSpeech outputSpeech = new PlainTextOutputSpeech();\r\n\t\tstring firstName = (request.Request as IntentRequest)?.Intent.Slots.FirstOrDefault(s =&gt; s.Key == \"FirstName\").Value?.Value;\r\n\t\toutputSpeech.Text = \"Hello \" + firstName;\r\n\t\tresponse = ResponseBuilder.Tell(outputSpeech);\r\n\t}\r\n}\r\n\r\nreturn response;\r\n<\/code><\/pre>\n<p>Publish this new code to your Azure Function and navigate to the Amazon developer portal to configure the Alexa skill for account linking.<\/p>\n<h5>Step 7: Alexa Account Linking Configuration<\/h5>\n<p>Navigate back to the Alexa skill page. In the Account Linking section enable the slider. Enter the following information into the fields:<\/p>\n<ul>\n<li>Authorization Grant Type: <strong>Auth Code Grant<\/strong><\/li>\n<li>Authorization URI: <a href=\"https:\/\/login.microsoftonline.com\/**%7BTenantId\/DirectoryId%7D**\/oauth2\/authorize?resource=**%7BApplication\">https:\/\/login.microsoftonline.com\/**{TenantId\/DirectoryId}**\/oauth2\/authorize?resource=**{Application<\/a> ID}**\nThe TenandId\/DirectoryId is the same GUID that is in the appsettings.json config file. The Application ID is the Application ID from the app registration. This parameter is required by Azure AD and it tells AAD which resource Alexa is requesting access to and defines the audience property in the JWT token returned from AAD. According to the documentation <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/develop\/active-directory-protocols-oauth-code\">here<\/a> the resource parameter is only recommended, but if you debug account linking with Postman you will notice it fails and states the resource parameter is required.<\/li>\n<li>Client Id: This is the Application Id from the app registration\n<img decoding=\"async\" class=\"alignnone size-full wp-image-37550\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AADWizardSetup3.png\" alt=\"\" width=\"516\" height=\"186\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AADWizardSetup3.png 516w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AADWizardSetup3-300x108.png 300w\" sizes=\"(max-width: 516px) 100vw, 516px\" \/><\/li>\n<li>Access Token URI: <a href=\"https:\/\/login.windows.net\/**%7BTenantId\/DirectoryId%7D**\/oauth2\/token\">https:\/\/login.windows.net\/**{TenantId\/DirectoryId}**\/oauth2\/token<\/a> This URI can be found in the Endpoints settings of the app registration blade. Copy the <strong>OAUTH 2.0 TOKEN ENDPOINT\n<\/strong> <img decoding=\"async\" class=\"alignnone size-full wp-image-37551\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaAccountLinking2.png\" alt=\"\" width=\"1207\" height=\"537\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaAccountLinking2.png 1207w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaAccountLinking2-300x133.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaAccountLinking2-768x342.png 768w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaAccountLinking2-1024x456.png 1024w\" sizes=\"(max-width: 1207px) 100vw, 1207px\" \/>\n<img decoding=\"async\" class=\"alignnone size-full wp-image-37552\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaAccountLinking3.png\" alt=\"\" width=\"502\" height=\"985\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaAccountLinking3.png 502w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaAccountLinking3-153x300.png 153w\" sizes=\"(max-width: 502px) 100vw, 502px\" \/><\/li>\n<li>Client Secret: This is effectively the password the Alexa service will use to allow account linking to your API backend. We will generate one now. Navigate to the <strong>Keys<\/strong> setting in the API app registration.\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-37553\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaAccountLinking4.png\" alt=\"\" width=\"1575\" height=\"620\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaAccountLinking4.png 1575w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaAccountLinking4-300x118.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaAccountLinking4-768x302.png 768w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaAccountLinking4-1024x403.png 1024w\" sizes=\"(max-width: 1575px) 100vw, 1575px\" \/>Give a key a description and a duration. <strong>Select a 1 or 2 year duration.<\/strong> A key with &#8220;never expires&#8221; duration may fail account linking. Click <strong>Save<\/strong>. The key will be generated on the save. This will be the one time this key is displayed, so copy it.\n<img decoding=\"async\" class=\"alignnone size-full wp-image-37554\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaAccountLinking5.png\" alt=\"\" width=\"741\" height=\"254\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaAccountLinking5.png 741w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaAccountLinking5-300x103.png 300w\" sizes=\"(max-width: 741px) 100vw, 741px\" \/><\/li>\n<li>Client Authentication Scheme: HTTP Basic (Recommended)<\/li>\n<\/ul>\n<p>In the end your Account Linking settings should look similar to this:<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-37555\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaAccountLinking6.png\" alt=\"\" width=\"1382\" height=\"630\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaAccountLinking6.png 1382w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaAccountLinking6-300x137.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaAccountLinking6-768x350.png 768w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaAccountLinking6-1024x467.png 1024w\" sizes=\"(max-width: 1382px) 100vw, 1382px\" \/><\/p>\n<p>Before we move onto the next screen, notice the <strong>Redirect URIs<\/strong> in the settings. Copy these URLs into the Redirect URLs setting for app registration.\n<img decoding=\"async\" class=\"alignnone size-full wp-image-37556\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaAccountLinkingRedirectURI1.png\" alt=\"\" width=\"806\" height=\"230\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaAccountLinkingRedirectURI1.png 806w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaAccountLinkingRedirectURI1-300x86.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaAccountLinkingRedirectURI1-768x219.png 768w\" sizes=\"(max-width: 806px) 100vw, 806px\" \/>\n<img decoding=\"async\" class=\"alignnone size-full wp-image-37557\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaAccountLinkingRedirectURI2.png\" alt=\"\" width=\"1090\" height=\"205\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaAccountLinkingRedirectURI2.png 1090w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaAccountLinkingRedirectURI2-300x56.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaAccountLinkingRedirectURI2-768x144.png 768w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/AlexaAccountLinkingRedirectURI2-1024x193.png 1024w\" sizes=\"(max-width: 1090px) 100vw, 1090px\" \/><\/p>\n<h5>Step 6: Link Accounts and Test<\/h5>\n<ol>\n<li>Login to https:\/\/alexa.amazon.com<\/li>\n<li>Navigate to <strong>Skills<\/strong> -&gt; <strong>Your Skills<\/strong><\/li>\n<li>You should see our newly created skill. Click on it.\n<img decoding=\"async\" class=\"alignnone size-full wp-image-37558\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/LinkAccounts1.png\" alt=\"\" width=\"457\" height=\"284\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/LinkAccounts1.png 457w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/LinkAccounts1-300x186.png 300w\" sizes=\"(max-width: 457px) 100vw, 457px\" \/><\/li>\n<li>Select <strong>SETTINGS\n<\/strong><img decoding=\"async\" class=\"alignnone size-full wp-image-37559\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/LinkAccounts2.png\" alt=\"\" width=\"1762\" height=\"416\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/LinkAccounts2.png 1762w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/LinkAccounts2-300x71.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/LinkAccounts2-768x181.png 768w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/LinkAccounts2-1024x242.png 1024w\" sizes=\"(max-width: 1762px) 100vw, 1762px\" \/><\/li>\n<li>Click on the <strong>Link Account<\/strong> button in the upper right corner\n<img decoding=\"async\" class=\"alignnone size-full wp-image-37560\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/LinkAccounts3.png\" alt=\"\" width=\"1750\" height=\"212\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/LinkAccounts3.png 1750w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/LinkAccounts3-300x36.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/LinkAccounts3-768x93.png 768w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/LinkAccounts3-1024x124.png 1024w\" sizes=\"(max-width: 1750px) 100vw, 1750px\" \/><\/li>\n<li>You will be redirected to login to Azure Active Directory and then asked to accept the access being requested. Once you get through that result and if all goes well you should see:\n<img decoding=\"async\" class=\"alignnone size-full wp-image-37561\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/LinkAccounts4.png\" alt=\"\" width=\"475\" height=\"196\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/LinkAccounts4.png 475w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/LinkAccounts4-300x124.png 300w\" sizes=\"(max-width: 475px) 100vw, 475px\" \/><\/li>\n<\/ol>\n<p>If you are unsuccessful linking your account see the troubleshooting steps below.<\/p>\n<h5>Step 7: Testing<\/h5>\n<p>We have multiple options by which to test the Alexa Integration. We can use an actual device or the Amazon Developers Portal Test client.<\/p>\n<p><strong>Amazon Developer Portal<\/strong><\/p>\n<ol>\n<li>In the Amazon Developer portal where we configured the Alexa skill <em>Note: If you left this tab open from the prior instructions, you will have to refresh the page after performing the account linking<\/em><\/li>\n<li>Make sure you are under the skill you are wanting to test<\/li>\n<li>Click on the test section<\/li>\n<li>In the Enter Utterance Section enter the following: <strong>ask Tutorial to greet <\/strong><\/li>\n<\/ol>\n<ul>\n<li>= any name<\/li>\n<li>This is derived in the <strong>Invocation Model<\/strong> section for the skill.<\/li>\n<\/ul>\n<ol>\n<li>If all goes well you should see something that looks like:\n<img decoding=\"async\" class=\"alignnone size-full wp-image-37562\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/Testing-2.png\" alt=\"\" width=\"1304\" height=\"430\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/Testing-2.png 1304w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/Testing-2-300x99.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/Testing-2-768x253.png 768w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2018\/01\/Testing-2-1024x338.png 1024w\" sizes=\"(max-width: 1304px) 100vw, 1304px\" \/><\/li>\n<\/ol>\n<ul>\n<li>if you get a <code>401: Unauthorized<\/code> result check that the skill is account linked or see some debugging tips below.<\/li>\n<\/ul>\n<h4>Troubleshooting<\/h4>\n<ul>\n<li>Double check Web App settings in Azure aren&#8217;t overriding the web.config settings<\/li>\n<li>F12 browser tool\n<ul>\n<li>If you need to look at the HTTP Request Response stream pressing F12 from Explorer, Edge, Chrome will open integrated developer tools.<\/li>\n<\/ul>\n<\/li>\n<li>JWT.IO &#8211; https:\/\/jwt.io\/\n<ul>\n<li>This is a browser based tool where you can take your JWT token from the request and decode it and verify the signature<\/li>\n<\/ul>\n<\/li>\n<li>If account linking works and your still getting a <code>401 unauthorized<\/code> response try the following:\n<ul>\n<li>Refresh the Amazon develop page and try again (this makes Amazon request a new token)<\/li>\n<li>Check the skill is successfully account linked.<\/li>\n<\/ul>\n<\/li>\n<li>Enabling diagnostic logs, detailed error messages and leveraging live streaming of logs in the Azure portal for the web app is very useful for debugging<\/li>\n<li>Use Postman to troubleshoot account linking problems. A video on how to do this can be found <a href=\"https:\/\/blogs.msdn.microsoft.com\/devkeydet\/2016\/03\/22\/using-postman-with-azure-ad\/\">here<\/a>.<\/li>\n<\/ul>\n<h4>Sample Code<\/h4>\n<p>The companion source code for the Azure Function portion of this tutorial can be located on GitHub at <a href=\"https:\/\/github.com\/vanderby\/AlexaToAzureFunction\">https:\/\/github.com\/vanderby\/AlexaToAzureFunction<\/a><\/p>\n<h4>Links<\/h4>\n<ul>\n<li>Azure SDKs and Tools\n<ul>\n<li><a href=\"https:\/\/azure.microsoft.com\/en-us\/downloads\/\">https:\/\/azure.microsoft.com\/en-us\/downloads\/<\/a><\/li>\n<li><a href=\"https:\/\/blogs.msdn.microsoft.com\/premier_developer\/2016\/12\/12\/amazon-alexa-skills-development-with-azure-active-directory-and-asp-net-core-1-0-web-api\/\">https:\/\/blogs.msdn.microsoft.com\/premier_developer\/2016\/12\/12\/amazon-alexa-skills-development-with-azure-active-directory-and-asp-net-core-1-0-web-api\/<\/a><\/li>\n<\/ul>\n<\/li>\n<li>ASP.NET Authentication attribute documentation\n<ul>\n<li><a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/system.web.mvc.authorizeattribute(v=vs.118).aspx\">https:\/\/msdn.microsoft.com\/en-us\/library\/system.web.mvc.authorizeattribute(v=vs.118).aspx<\/a><\/li>\n<\/ul>\n<\/li>\n<li>Amazon developer documentation\n<ul>\n<li><a href=\"https:\/\/developer.amazon.com\/alexa-skills-kit\">https:\/\/developer.amazon.com\/alexa-skills-kit<\/a><\/li>\n<\/ul>\n<\/li>\n<li>How to use Postman to debug account linking\n<ul>\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/develop\/active-directory-protocols-oauth-code\">https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/develop\/active-directory-protocols-oauth-code<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<hr \/>\n<p><a href=\"https:\/\/blogs.msdn.com\/b\/premier_developer\/archive\/2014\/09\/15\/welcome.aspx\"><strong>Premier Support for Developers<\/strong><\/a> provides strategic technology guidance, critical support coverage, and a range of essential services to help teams optimize development lifecycles and improve software quality.\u00a0 Contact your Application Development Manager (ADM) or <a href=\"https:\/\/blogs.msdn.microsoft.com\/premier_developer\/contact-us\/\"><b>email us<\/b><\/a> to learn more about what we can do for you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post is provided by Premier Field Engineer, Nathan Vanderby, who walks us through how to write an Alexa skill using Azure Functions.\u00a0 Last updated June 2018. Most people have heard of the Amazon Echo and the skills that provide it functions. Amazon makes it really easy to create these skills using an AWS Lambda [&hellip;]<\/p>\n","protected":false},"author":582,"featured_media":37840,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[25],"tags":[139,156,3],"class_list":["post-17145","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-azure","tag-alexa","tag-azure-functions","tag-team"],"acf":[],"blog_post_summary":"<p>This post is provided by Premier Field Engineer, Nathan Vanderby, who walks us through how to write an Alexa skill using Azure Functions.\u00a0 Last updated June 2018. Most people have heard of the Amazon Echo and the skills that provide it functions. Amazon makes it really easy to create these skills using an AWS Lambda [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/17145","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/users\/582"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/comments?post=17145"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/17145\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media\/37840"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media?parent=17145"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/categories?post=17145"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/tags?post=17145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}