%3CLINGO-SUB%20id%3D%22lingo-sub-1739102%22%20slang%3D%22en-US%22%3EDeploy%20your%20.NET%20Blazor%20app%20in%20minutes%20with%20Azure%20Static%20Web%20Apps%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1739102%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3E%26gt%3B%20TLDR%3B%20Azure%20Static%20Web%20Apps%20is%20a%20service%20that%20allows%20you%20to%20deploy%20both%20JavaScript%20apps%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3Ebut%20now%20also%20Blazor%20apps%3C%2FSTRONG%3E%3CSPAN%3E.%20The%20service%20is%20simple%20to%20use%20as%20it%20only%20requires%20an%20Azure%20subscription%20and%20a%20GitHub%20repo.%20That's%20all%20the%20set%20up%20you%20need.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1241651771%22%20id%3D%22toc-hId--1241651771%22%20id%3D%22toc-hId--1241651771%22%20id%3D%22toc-hId--1241651771%22%20id%3D%22toc-hId--1241651771%22%20id%3D%22toc-hId--1241651771%22%3EResources%3C%2FH2%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdevblogs.microsoft.com%2Faspnet%2Fazure-static-web-apps-with-blazor%2F%3Fwt.mc_id%3Dtechcommunity-blog-chnoring%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EBlazor%20on%20Static%20Web%20Apps%20blog%20post%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Flearn%2Fmodules%2Fbuild-blazor-webassembly-visual-studio-code%2F%3Fwt.mc_id%3Dtechcommunity-blog-chnoring%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EBlazor%20LEARN%20Module%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-gb%2Fazure%2Fstatic-web-apps%2Fdeploy-blazor%3Fwt.mc_id%3Dtechcommunity-blog-chnoring%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EBlazor%20%2B%20Static%20Web%20Apps%20Tutorial%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-gb%2Flearn%2Fmodules%2Fpublish-app-service-static-web-app-api-dotnet%3Fwt.mc_id%3Dtechcommunity-blog-chnoring%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EBlazor%20%2B%20Static%20Web%20Apps%2C%20LEARN%20module%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdev.to%2Fdotnet%2Fblazor-the-future-of-net-web-apps-a-first-look-m8%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EIntro%20to%20Blazor%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdev.to%2Fdotnet%2Flearn-hot-build-and-work-with-blazor-apps-using-net-core-c-and-javasript-5dmg%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EWorking%20with%20Blazor%20and%20JavaScript%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CH2%20id%3D%22toc-hId-1245861062%22%20id%3D%22toc-hId-1245861062%22%20id%3D%22toc-hId-1245861062%22%20id%3D%22toc-hId-1245861062%22%20id%3D%22toc-hId-1245861062%22%20id%3D%22toc-hId-1245861062%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CH2%20id%3D%22toc-hId--561593401%22%20id%3D%22toc-hId--561593401%22%20id%3D%22toc-hId--561593401%22%20id%3D%22toc-hId--561593401%22%20id%3D%22toc-hId--561593401%22%20id%3D%22toc-hId--561593401%22%3EBlazor%3C%2FH2%3E%0A%3CP%3EBlazor%20is%20a%20framework%20that%20allows%20you%20to%20write%20C%23%20fullstack.%20If%20you%20are%20developing%20a%20fullstack%20web%20application%2C%20you%20usually%20have%20to%20involve%20JavaScript%20at%20some%20point.%20You%20either%20add%20it%20to%20improve%20the%20interaction%20of%20your%20pages%20or%20you%20split%20between%20having%20a%20backend%20in%20.NET%20and%20the%20frontend%20in%20JavaScript%20using%20for%20example%20a%20SPA%20framework%20like%20React%2C%20Angular%20or%20maybe%20Vue.%20A%20Blazor%20app%20can%20be%20compiled%20into%20WebAssembly%20and%20can%20thereby%20be%20a%20first-class%20web%20citizen%20and%20also%20really%20fast.%3C%2FP%3E%0A%3CP%3EIf%20you%20are%20completely%20new%20to%20Blazor%20I%20recommend%20reading%20this%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdev.to%2Fdotnet%2Fblazor-the-future-of-net-web-apps-a-first-look-m8%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eintro%20article%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1925919432%22%20id%3D%22toc-hId-1925919432%22%20id%3D%22toc-hId-1925919432%22%20id%3D%22toc-hId-1925919432%22%20id%3D%22toc-hId-1925919432%22%20id%3D%22toc-hId-1925919432%22%3EWhat%20is%20Azure%20Static%20Web%20apps%20service%3C%2FH2%3E%0A%3CP%3EStatic%20Web%20Apps%20is%20an%20Azure%20service%20with%20which%20you%20can%20deploy%20fullstack%20apps%20within%20minutes.%20It%20can%20deploy%20both%20JavaScript%20projects%20as%20well%20as%20Blazor.%3C%2FP%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3ENET%20developer%20here%2C%20you%20have%20my%20attention.%20So%2C%20it%20can%20deploy%20a%20Blazor%20project%2C%20what%20else%20can%20it%20do%3F%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CUL%3E%0A%3CLI%3E%3CSTRONG%3EWeb%20hosting%3C%2FSTRONG%3E%2C%20your%20app%20is%20hosted%20on%20Azure%2C%20the%20end%20product%20it%20hosts%20is%20just%20HTML%2C%20CSS%20and%20JavaScript%20or%20Web%20Assembly.%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EIntegrated%20API%3C%2FSTRONG%3E%2C%20you%20can%20add%20a%20Serverless%20API%20to%20your%20app%20at%20any%20time.%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EFree%20SSL%20certificates%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EReverse%20proxy%3C%2FSTRONG%3E.%20When%20calling%20APIs%2C%20no%20need%20to%20configure%20CORS%2C%20it%20just%20works.%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3ESocial%20auth%20%2B%20AAD%20supported%3C%2FSTRONG%3E.%20Through%20simple%20configuration%20get%20auth%20providers%20like%20GitHub%2C%20Linked%20In%20and%20even%20Azure%20Active%20Directory%20authentication%2Fauthorization%20to%20just%20work.%20This%20includes%20being%20able%20to%20set%20up%20separate%20roles%20to%20have%20access%20to%20specific%20resources.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3EThat's%20a%20nice%20featurelist.%20I%20care%20about%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CEM%3Eease%20of%20use%3C%2FEM%3E%2C%20what%20can%20you%20tell%20me%20about%20that%3F%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CP%3EThere's%20not%20much%20to%20fill%20in%2C%20everything%20revolves%20around%20your%20GitHub%20repo%20and%20once%20you%20selected%20a%20repo%2C%20and%20a%20few%20other%20things%2C%20it%20starts%20deploying%20it.%3C%2FP%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3EOk%2C%20but%20how%20does%20it%20work%20under%20the%20hood%3F%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CP%3EIt%20works%20by%20creating%20and%20running%20GitHub%20actions%20that%20carries%20out%20things%20like%20fetching%20dependent%20libraries%2C%20building%20your%20code%2C%20and%20finally%20deploying%20it.%20You%20end%20up%20getting%20a%20so-called%20workflow%20file%20pushed%20to%20your%20repo%20(it's%20a%20YAML%20file).%3C%2FP%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3EAlright%2C%20but%20I'm%20likely%20to%20update%20my%20code%20quite%20a%20lot%2C%20does%20it%20help%20me%20with%20redeploy%3F%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CP%3EIt%20does%2C%20you%20can%20define%20in%20the%20workflow%20file%20when%20a%20redeploy%20should%20be%20trigger%2C%20like%20merging%20of%20a%20PR%20or%20a%20commit%20to%20master%2Fmain%20branch%20for%20example.%3C%2FP%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3EThis%20all%20sounds%20very%20promising%3B%20can%20you%20take%20me%20through%20a%20deploy%3F%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CP%3EOf%20course%2C%20next%20thing%20on%20my%20list%20%3A)%3C%2Fimg%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-118464969%22%20id%3D%22toc-hId-118464969%22%20id%3D%22toc-hId-118464969%22%20id%3D%22toc-hId-118464969%22%20id%3D%22toc-hId-118464969%22%20id%3D%22toc-hId-118464969%22%3EDeploy%20your%20first%20Blazor%20app%3C%2FH2%3E%0A%3COL%3E%0A%3CLI%3E%3CSTRONG%3EClone%20an%20app%3C%2FSTRONG%3E.%20The%20easiest%20way%20to%20get%20started%20is%20to%20create%20a%20Blazor%20app%20from%20this%20GitHub%20template%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FMicrosoftDocs%2Fmslearn-staticwebapp-dotnet%2Fgenerate%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EGenerate%20app%20from%20GH%20template%3C%2FA%3E.%20Once%20it's%20done%20generating%20you%20now%20have%20a%20repo%20on%20your%20GH%20user.%20Type%20the%20following%20command%3A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CDIV%20class%3D%22highlight%22%3E%0A%3CPRE%20class%3D%22highlight%20plaintext%22%3E%3CCODE%3E%20%20%20git%20clone%20%3CNAME%20of%3D%22%22%20repo%3D%22%22%20url%3D%22%22%3E%20%0A%3C%2FNAME%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3COL%3E%0A%3CLI%3E%3CSTRONG%3EInspect%20an%20app%3C%2FSTRONG%3E.%20To%20inspect%20the%20app%2C%20first%20ensure%20you%20have%20the%20latest%20version%20of%20dotnet%20core%20installed%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdotnet.microsoft.com%2Fdownload%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Einstall%3C%2FA%3E.%20Change%20directory%20to%20that%20of%20your%20cloned%20repo.%3COL%3E%0A%3CLI%3EBuild%20the%20solution.%20Ensure%20you%20are%20standing%20at%20the%20solution%20root%20and%20type%20the%20following%20command%3A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CDIV%20class%3D%22highlight%22%3E%0A%3CPRE%20class%3D%22highlight%20plaintext%22%3E%3CCODE%3E%20%20%20dotnet%20build%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3COL%3E%0A%3CLI%3E%3CSTRONG%3ERun%20the%20client%20app%3C%2FSTRONG%3E.%20Run%20the%20client%20by%20typing%20the%20following%20command%3A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CDIV%20class%3D%22highlight%22%3E%0A%3CPRE%20class%3D%22highlight%20plaintext%22%3E%3CCODE%3E%20%20%20cd%20Client%0A%20%20%20dotnet%20run%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3CP%3EYou%20should%20get%20a%20terminal%20output%20similar%20to%20the%20following%3A%3C%2FP%3E%0A%3CDIV%20class%3D%22highlight%22%3E%0A%3CPRE%20class%3D%22highlight%20plaintext%22%3E%3CCODE%3E%20%20%20info%3A%20Microsoft.Hosting.Lifetime%5B0%5D%0A%20%20%20%20%20%20Now%20listening%20on%3A%20https%3A%2F%2Flocalhost%3A5001%0A%20%20%20info%3A%20Microsoft.Hosting.Lifetime%5B0%5D%0A%20%20%20%20%20%20Now%20listening%20on%3A%20http%3A%2F%2Flocalhost%3A5000%0A%20%20%20info%3A%20Microsoft.Hosting.Lifetime%5B0%5D%0A%20%20%20%20%20%20Application%20started.%20Press%20Ctrl%2BC%20to%20shut%20down.%0A%20%20%20info%3A%20Microsoft.Hosting.Lifetime%5B0%5D%0A%20%20%20%20%20%20Hosting%20environment%3A%20Development%0A%20%20%20info%3A%20Microsoft.Hosting.Lifetime%5B0%5D%0A%20%20%20%20%20%20Content%20root%20path%3A%20%0A%20%20%20%2Fpath%2Fto%2Fproject%2Fblazor-sample%2FClient%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3COL%3E%0A%3CLI%3E%3CSTRONG%3ENavigate%20to%20the%20app%3C%2FSTRONG%3E.%20Type%20the%20following%20URL%20in%20the%20browser%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3Elocalhost%3A5000%3C%2FSTRONG%3E.%20The%20browser%20should%20now%20display%20the%20following%20content%3A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22blazor-article-app.png%22%20style%3D%22width%3A%20880px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F223326iB4B40F54B7799B08%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22blazor-article-app.png%22%20alt%3D%22blazor-article-app.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1688989494%22%20id%3D%22toc-hId--1688989494%22%20id%3D%22toc-hId--1688989494%22%20id%3D%22toc-hId--1688989494%22%20id%3D%22toc-hId--1688989494%22%20id%3D%22toc-hId--1688989494%22%3EDeploy%20the%20app%3C%2FH2%3E%0A%3CP%3EAt%20this%20point%20you%20have%20a%20working%20Blazor%20app%20that%20you%20can%20deploy%20using%20Azure%20Static%20functions.%20How%20do%20you%20do%20that%3F%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3ENavigate%20to%20the%20URL%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3Eportal.azure.com%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Ein%20your%20browser%20and%20log%20on%20to%20Azure.%3C%2FLI%3E%0A%3CLI%3EType%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EStatic%20Web%20Apps%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eand%20select%20the%20suggestion.%3C%2FLI%3E%0A%3CLI%3EClick%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3E%2B%20Add%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Ein%20the%20top%20left%20area.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3ENow%20you%20are%20met%20with%20a%20set%20of%20dropdowns%20where%20you%20need%20to%20fill%20in%20some%20info.%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3E%3CSTRONG%3ESubscription%3C%2FSTRONG%3E%2C%20select%20the%20subscription%20you%20want%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EResource%20group%3C%2FSTRONG%3E%2C%20select%20the%20resource%20group%20you%20want%20or%20create%20a%20new%20one.%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EName.%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3EGive%20the%20app%20name.%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3ERegion.%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3ESelect%20a%20region.%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3ESKU.%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3ENo%20need%20to%20do%20a%20selection%20here%2C%20the%20service%20is%20free%20for%20now.%3C%2FLI%3E%0A%3CLI%3EClick%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3ESign%20in%20to%20GitHub%3C%2FSTRONG%3E%2C%20after%20clicking%20this%20button%20you%20will%20need%20to%20locate%20and%20pick%20your%20generated%20repo.%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EOrganization%3C%2FSTRONG%3E.%20Select%20organization.%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3ERepository%3C%2FSTRONG%3E.%20Select%20the%20repo%20that%20was%20created%20when%20you%20generated%20it%20from%20the%20template.%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EBranch.%3C%2FSTRONG%3E.%20Select%20the%20branch%2C%20in%20this%20case%20we%20only%20have%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3Emain%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Ebranch.%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EBuild%20presets%3C%2FSTRONG%3E.%20Select%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3ECustom%3C%2FSTRONG%3E%2C%20now%20you%20are%20presented%20with%20some%20options%3A%3COL%3E%0A%3CLI%3E%3CSTRONG%3EApp%20location%3C%2FSTRONG%3E.%20This%20is%20where%20the%20client%20app%20lives%2C%20so%20type%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3E%2FClient%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Ehere.%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EApi%20location%3C%2FSTRONG%3E%2C%20leave%20as%20default%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EApp%20artifact%20location%3C%2FSTRONG%3E.%20This%20is%20the%20folder%20that%20your%20client%20app%20gets%20built%20to.%20Give%20it%20the%20following%20value%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3Ewwwroot%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3C%2FLI%3E%0A%3CLI%3EClick%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EReview%20%2B%20Create%3C%2FSTRONG%3E.%3C%2FLI%3E%0A%3CLI%3EClick%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3ECreate%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eat%20this%20point%20if%20you%20are%20happy%20with%20all%20selections%20you've%20made.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3EClick%20to%20be%20taken%20to%20the%20resource%20once%20deployed.%20The%20resource%20page%20should%20look%20something%20like%20this%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22blazor-app-portal.png%22%20style%3D%22width%3A%20880px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F223327i08F5B042E83A57E4%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22blazor-app-portal.png%22%20alt%3D%22blazor-app-portal.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EAbove%20you%20have%20the%20resource.%20You%20could%20click%20the%20URL%20from%20the%20indicated%20field%2C%20but%20it%20would%20take%20you%20to%20default%20page.%20Why%20is%20that%3F%20Your%20app%20hasn't%20finished%20building%20yet.%20Instead%20click%20the%20link%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EGitHub%20action%20runs%3C%2FSTRONG%3E%3CSPAN%3E.%20This%20will%20take%20you%20to%20the%20GitHub%20actions%20of%20your%20repo.%20Once%20all%20the%20actions%20have%20finished%20it%20should%20look%20like%20so%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22blazor-app-github-actions.png%22%20style%3D%22width%3A%20880px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F223328iE862B10DCA1AE731%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22blazor-app-github-actions.png%22%20alt%3D%22blazor-app-github-actions.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3ERevisit%20your%20app.%20Now%20go%20back%20to%20the%20resource%20page%20at%20the%20Azure%20portal%20and%20click%20that%20app%20URL.%20You%20should%20see%20the%20following%3A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22blazor-app-deployed.png%22%20style%3D%22width%3A%20880px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F223330i49FEFF2CFC04724A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22blazor-app-deployed.png%22%20alt%3D%22blazor-app-deployed.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-798523339%22%20id%3D%22toc-hId-798523339%22%20id%3D%22toc-hId-798523339%22%20id%3D%22toc-hId-798523339%22%20id%3D%22toc-hId-798523339%22%20id%3D%22toc-hId-798523339%22%3EAdding%20an%20API%3C%2FH2%3E%0A%3CP%3ENow%20a%20Blazor%20app%20could%20contain%20its%20own%20backend.%20The%20way%20the%20Azure%20Static%20Web%20Apps%20service%20is%20constructed%20though%20it%20assumes%20your%20backend%20will%20be%20located%20in%20an%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EApi%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Edirectory.%20So%20what%20should%20be%20in%20that%20directory%3F%20Well%20a%20function%20app.%20Luckily%20your%20repo%20already%20have%20a%20working%20function%20app%2C%20almost.%3C%2FP%3E%0A%3CP%3ELet's%20review%20our%20repo%20quickly.%20Your%20solution%20should%20look%20something%20like%20this.%3C%2FP%3E%0A%3CDIV%20class%3D%22highlight%22%3E%0A%3CPRE%20class%3D%22highlight%20plaintext%22%3E%3CCODE%3E%20%20%20-%7C%20Api%0A%20%20%20-%7C%20Data%0A%20%20%20-%7C%20Client%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3CP%3EYou%20already%20know%20about%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EClient%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Edirectory%20where%20your%20Blazor%20app%20lives.%20The%20other%20directory%20of%20interest%20is%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EApi%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Edirectory%20that%20contains%20a%20Function%20app.%20It's%20an%20almost%20functioning%20Function%20app.%20What%20do%20I%20mean%20by%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CEM%3Ealmost%3C%2FEM%3E%3F%20Well%20let's%20have%20a%20look%20at%20it%2C%20expanding%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EApi%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Edirectory%20there%20are%20some%20files%20of%20interest%3A%3C%2FP%3E%0A%3CDIV%20class%3D%22highlight%22%3E%0A%3CPRE%20class%3D%22highlight%20plaintext%22%3E%3CCODE%3EClient%2F%0AApi%2F%0A%20%20ProductData.cs%0A%20%20ProductsDelete.cs%0A%20%20ProductsPost.cs%0A%20%20ProductsPut.cs%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3CP%3EThe%20first%20file%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CCODE%3EProductData.cs%3C%2FCODE%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Econtains%20an%20in-memory%20data%20store.%20The%20remaining%20three%20files%20is%20just%20routes%20for%20our%20API.%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1489084813%22%20id%3D%22toc-hId-1489084813%22%20id%3D%22toc-hId-1489084813%22%20id%3D%22toc-hId-1489084813%22%20id%3D%22toc-hId-1489084813%22%20id%3D%22toc-hId-1489084813%22%3EAdding%20missing%20GET%20route%3C%2FH3%3E%0A%3CP%3EFor%20this%20API%20to%20be%20a%20full%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EC%3C%2FSTRONG%3Ereate%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3ER%3C%2FSTRONG%3Eead%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EU%3C%2FSTRONG%3Epdate%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3ED%3C%2FSTRONG%3Eelete%20it%20needs%20another%20file%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CCODE%3EProductsGet.cs%3C%2FCODE%3E%2C%20let's%20create%20that%20file%20and%20give%20it%20the%20following%20content%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-csharp%22%3E%3CCODE%3Eusing%20System.Threading.Tasks%3B%0Ausing%20Microsoft.AspNetCore.Mvc%3B%0Ausing%20Microsoft.Azure.WebJobs%3B%0Ausing%20Microsoft.Azure.WebJobs.Extensions.Http%3B%0Ausing%20Microsoft.AspNetCore.Http%3B%0A%0Anamespace%20Api%0A%7B%0A%20%20public%20class%20ProductsGet%0A%20%20%7B%0A%20%20%20%20private%20readonly%20IProductData%20productData%3B%0A%0A%20%20%20%20public%20ProductsGet(IProductData%20productData)%0A%20%20%20%20%7B%0A%20%20%20%20%20%20this.productData%20%3D%20productData%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20%5BFunctionName(%22ProductsGet%22)%5D%0A%20%20%20%20public%20async%20Task%3CIACTIONRESULT%3E%20Run(%0A%20%20%20%20%20%20%20%20%5BHttpTrigger(AuthorizationLevel.Anonymous%2C%20%22get%22%2C%20Route%20%3D%20%22products%22)%5D%20HttpRequest%20req)%0A%20%20%20%20%7B%0A%20%20%20%20%20%20var%20products%20%3D%20await%20productData.GetProducts()%3B%0A%20%20%20%20%20%20return%20new%20OkObjectResult(products)%3B%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0A%3C%2FIACTIONRESULT%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CDIV%20class%3D%22highlight%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3ENow%20select%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3ERun%20%26gt%3B%20Start%20debugging%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Efrom%20the%20top%20menu%20in%20VS%20Code.%20At%20the%20end%20of%20the%20build%20output%20you%20should%20have%20text%20stating%20something%20like%20this%3A%3C%2FP%3E%0A%3CDIV%20class%3D%22highlight%22%3E%0A%3CPRE%20class%3D%22highlight%20plaintext%22%3E%3CCODE%3EProductsPut%3A%20%5BPUT%5D%20http%3A%2F%2Flocalhost%3A7071%2Fapi%2Fproducts%0A%0AProductsGet%3A%20%5BGET%5D%20http%3A%2F%2Flocalhost%3A7071%2Fapi%2Fproducts%0A%0AProductsPost%3A%20%5BPOST%5D%20http%3A%2F%2Flocalhost%3A7071%2Fapi%2Fproducts%0A%0AProductsDelete%3A%20%5BDELETE%5D%20http%3A%2F%2Flocalhost%3A7071%2Fapi%2Fproducts%2F%7BproductId%3Aint%7D%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3CP%3EYou%20are%20almost%20there.%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--318369650%22%20id%3D%22toc-hId--318369650%22%20id%3D%22toc-hId--318369650%22%20id%3D%22toc-hId--318369650%22%20id%3D%22toc-hId--318369650%22%20id%3D%22toc-hId--318369650%22%3E%3CA%20class%3D%22anchor%22%20href%3D%22https%3A%2F%2Fdev.to%2Fazure%2Fdeploy-your-blazor-app-in-minutes-with-azure-static-web-apps-40bh%23testing-locally-set-up-cors%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%20name%3D%22testing-locally-set-up-cors%22%3E%3C%2FA%3ETesting%20locally%2C%20set%20up%20CORS%3C%2FH3%3E%0A%3CP%3EWhen%20testing%20things%20out%20locally%20you%20need%20to%20instruct%20the%20Function%20to%20allow%20requests%20from%20a%20cross%20domain%2C%20i.e%20our%20Blazor%20app.%20How%20do%20we%20do%20that%3F%20Locate%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3Elocal.settings.json%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Efile%20and%20ensure%20it%20has%20the%20following%20content%3A%3C%2FP%3E%0A%3CDIV%20class%3D%22highlight%22%3E%0A%3CPRE%20class%3D%22highlight%20json%22%3E%3CCODE%3E%3CSPAN%20class%3D%22p%22%3E%7B%3C%2FSPAN%3E%0A%20%20%3CSPAN%20class%3D%22nl%22%3E%22IsEncrypted%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22p%22%3E%3A%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kc%22%3Efalse%3C%2FSPAN%3E%3CSPAN%20class%3D%22p%22%3E%2C%3C%2FSPAN%3E%0A%20%20%3CSPAN%20class%3D%22nl%22%3E%22Values%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22p%22%3E%3A%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22p%22%3E%7B%3C%2FSPAN%3E%0A%20%20%20%20%3CSPAN%20class%3D%22nl%22%3E%22AzureWebJobsStorage%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22p%22%3E%3A%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22s2%22%3E%22%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22p%22%3E%2C%3C%2FSPAN%3E%0A%20%20%20%20%3CSPAN%20class%3D%22nl%22%3E%22FUNCTIONS_WORKER_RUNTIME%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22p%22%3E%3A%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22s2%22%3E%22dotnet%22%3C%2FSPAN%3E%0A%20%20%3CSPAN%20class%3D%22p%22%3E%7D%2C%3C%2FSPAN%3E%0A%20%20%3CSPAN%20class%3D%22nl%22%3E%22Host%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22p%22%3E%3A%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22p%22%3E%7B%3C%2FSPAN%3E%0A%20%20%20%20%3CSPAN%20class%3D%22nl%22%3E%22CORS%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22p%22%3E%3A%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22s2%22%3E%22*%22%3C%2FSPAN%3E%0A%20%20%3CSPAN%20class%3D%22p%22%3E%7D%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22p%22%3E%7D%3C%2FSPAN%3E%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3CP%3EAbove%20you%20added%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EHost%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eproperty%20and%20made%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3ECORS%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Epoint%20to%20allowing%20all%20requests.%20This%20is%20just%20something%20we%20do%20locally%2C%20don't%20worry%20about%20this%20making%20production.%3C%2FP%3E%0A%3CP%3EAt%20this%20point%20you%20can%20run%20your%20client%20Blazor%20app%20and%20it%20will%20look%20like%20this%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22blazor-app-api.png%22%20style%3D%22width%3A%20705px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F223332i10202A6FE1B9A456%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22blazor-app-api.png%22%20alt%3D%22blazor-app-api.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EThe%20Blazor%20app%20is%20now%20able%20to%20talk%20to%20your%20Function%20app%20backend.%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--328872754%22%20id%3D%22toc-hId--328872754%22%20id%3D%22toc-hId--328872754%22%20id%3D%22toc-hId--328872754%22%20id%3D%22toc-hId--328872754%22%20id%3D%22toc-hId--328872754%22%3E%3CA%20class%3D%22anchor%22%20href%3D%22https%3A%2F%2Fdev.to%2Fazure%2Fdeploy-your-blazor-app-in-minutes-with-azure-static-web-apps-40bh%23deploy-the-app-now-with-api%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%20name%3D%22deploy-the-app-now-with-api%22%3E%3C%2FA%3EDeploy%20the%20app%2C%20now%20with%20API%3C%2FH2%3E%0A%3CP%3ESo%20how%20do%20you%20deploy%20this%20so%20that%20the%20API%20part%20is%20there%3F%20You%20need%20to%20do%20the%20following%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSTRONG%3EAdjust%20the%20workflow%20YML%20file%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eand%20point%20out%20the%20Api%20directory%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EPush%20the%20changes%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eyou%20did%20you%20did%20to%20the%20workflow%20file%20and%20Api%20directory%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EThat's%20it%2C%20the%20way%20the%20workflow%20file%20is%20constructed%20it%20should%20pick%20up%20the%20changes%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CEM%3Eon%20push%3C%2FEM%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eand%20redeploy%20the%20app.%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--333474759%22%20id%3D%22toc-hId--333474759%22%20id%3D%22toc-hId--333474759%22%20id%3D%22toc-hId--333474759%22%20id%3D%22toc-hId--333474759%22%20id%3D%22toc-hId--333474759%22%3E%3CA%20class%3D%22anchor%22%20href%3D%22https%3A%2F%2Fdev.to%2Fazure%2Fdeploy-your-blazor-app-in-minutes-with-azure-static-web-apps-40bh%23adjust-workflow-file%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%20name%3D%22adjust-workflow-file%22%3E%3C%2FA%3EAdjust%20workflow%20file%3C%2FH3%3E%0A%3COL%3E%0A%3CLI%3E%3CP%3E%3CSTRONG%3EOpen%20up%20the%20workflow%20file%3C%2FSTRONG%3E.%20It's%20a%20file%20ending%20in%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3E.yml%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Ein%20your%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3E.github%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Esub%20directory%20(ensure%20you%20have%20done%20a%20git%20pull%20before%20this%20so%20you%20get%20this%20file%20as%20it's%20created%20and%20added%20to%20your%20repo%20the%20first%20time%20you%20deploy).%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%3CP%3E%3CSTRONG%3ELocate%20the%20section%20called%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CCODE%3Eapi_location%3A%3C%2FCODE%3E%3C%2FSTRONG%3E.%20Ensure%20it%20looks%20like%20this%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3Eapi_location%3A%20%22%2FApi%22%3C%2FSTRONG%3E.%20This%20will%20point%20out%20our%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EApi%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Esub%20directory.%3C%2FP%3E%0A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CH3%20id%3D%22toc-hId--2140929222%22%20id%3D%22toc-hId--2140929222%22%20id%3D%22toc-hId--2140929222%22%20id%3D%22toc-hId--2140929222%22%20id%3D%22toc-hId--2140929222%22%20id%3D%22toc-hId--2140929222%22%3E%3CA%20class%3D%22anchor%22%20href%3D%22https%3A%2F%2Fdev.to%2Fazure%2Fdeploy-your-blazor-app-in-minutes-with-azure-static-web-apps-40bh%23push-the-changes%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%20name%3D%22push-the-changes%22%3E%3C%2FA%3EPush%20the%20changes%3C%2FH3%3E%0A%3CP%3EType%20the%20following%20command%3A%3C%2FP%3E%0A%3CDIV%20class%3D%22highlight%22%3E%0A%3CPRE%20class%3D%22highlight%20plaintext%22%3E%3CCODE%3Egit%20add%20.%0Agit%20commit%20-m%20%22adding%20API%22%0Agit%20push%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3CP%3EThe%20above%20should%20push%20your%20changes%20to%20GitHub%20and%20the%20GitHub%20actions%20should%20be%20triggered.%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EGo%20to%20the%20GitHub%20actions%20tab%20and%20wait%20for%20the%20actions%20to%20finish.%20Now%20ensure%20you%20reload%20the%20page%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3EYou%20should%20now%20see%20the%20deployed%20app%2C%20this%20time%20loading%20the%20data%20correctly%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1739102%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3ETLDR%3B%20Azure%20Static%20Web%20Apps%20is%20a%20service%20that%20allows%20you%20to%20deploy%20both%20JavaScript%20apps%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3Ebut%20now%20also%20Blazor%20apps%3C%2FSTRONG%3E%3CSPAN%3E.%20The%20service%20is%20simple%20to%20use%20as%20it%20only%20requires%20an%20Azure%20subscription%20and%20a%20GitHub%20repo.%20That's%20all%20the%20set%20up%20you%20need.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1739102%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EWeb%20Apps%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1741182%22%20slang%3D%22en-US%22%3ERe%3A%20Deploy%20your%20.NET%20Blazor%20app%20in%20minutes%20with%20Azure%20Static%20Web%20Apps%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1741182%22%20slang%3D%22en-US%22%3E%3CP%3EGithub%20repo%20404%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1741239%22%20slang%3D%22en-US%22%3ERe%3A%20Deploy%20your%20.NET%20Blazor%20app%20in%20minutes%20with%20Azure%20Static%20Web%20Apps%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1741239%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F818433%22%20target%3D%22_blank%22%3E%40Mickahappening%3C%2FA%3E%26nbsp%3Bwe%20are%20trying%20to%20fix%20it%2C%20meanwhile%2C%20please%20clone%20this%20repo%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fsoftchris%2Fblazor-sample%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fsoftchris%2Fblazor-sample%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Microsoft

> TLDR; Azure Static Web Apps is a service that allows you to deploy both JavaScript apps but now also Blazor apps. The service is simple to use as it only requires an Azure subscription and a GitHub repo. That's all the set up you need.

Resources

 

Blazor

Blazor is a framework that allows you to write C# fullstack. If you are developing a fullstack web application, you usually have to involve JavaScript at some point. You either add it to improve the interaction of your pages or you split between having a backend in .NET and the frontend in JavaScript using for example a SPA framework like React, Angular or maybe Vue. A Blazor app can be compiled into WebAssembly and can thereby be a first-class web citizen and also really fast.

If you are completely new to Blazor I recommend reading this intro article

 

What is Azure Static Web apps service

Static Web Apps is an Azure service with which you can deploy fullstack apps within minutes. It can deploy both JavaScript projects as well as Blazor.

NET developer here, you have my attention. So, it can deploy a Blazor project, what else can it do?

  • Web hosting, your app is hosted on Azure, the end product it hosts is just HTML, CSS and JavaScript or Web Assembly.
  • Integrated API, you can add a Serverless API to your app at any time.
  • Free SSL certificates
  • Reverse proxy. When calling APIs, no need to configure CORS, it just works.
  • Social auth + AAD supported. Through simple configuration get auth providers like GitHub, Linked In and even Azure Active Directory authentication/authorization to just work. This includes being able to set up separate roles to have access to specific resources.

That's a nice featurelist. I care about ease of use, what can you tell me about that?

There's not much to fill in, everything revolves around your GitHub repo and once you selected a repo, and a few other things, it starts deploying it.

Ok, but how does it work under the hood?

It works by creating and running GitHub actions that carries out things like fetching dependent libraries, building your code, and finally deploying it. You end up getting a so-called workflow file pushed to your repo (it's a YAML file).

Alright, but I'm likely to update my code quite a lot, does it help me with redeploy?

It does, you can define in the workflow file when a redeploy should be trigger, like merging of a PR or a commit to master/main branch for example.

This all sounds very promising; can you take me through a deploy?

Of course, next thing on my list :)

 

Deploy your first Blazor app

  1. Clone an app. The easiest way to get started is to create a Blazor app from this GitHub template Generate app from GH templateIf you get a 404, ensure you login to GitHub first and try again 
  2. Once it's done generating you now have a repo on your GH user. Type the following command:
   git clone <name of repo URL> 
  1. Inspect an app. To inspect the app, first ensure you have the latest version of dotnet core installed install. Change directory to that of your cloned repo.
    1. Build the solution. Ensure you are standing at the solution root and type the following command:
   dotnet build
  1. Run the client app. Run the client by typing the following command:
   cd Client
   dotnet run

You should get a terminal output similar to the following:

   info: Microsoft.Hosting.Lifetime[0]
      Now listening on: https://localhost:5001
   info: Microsoft.Hosting.Lifetime[0]
      Now listening on: http://localhost:5000
   info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
   info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Development
   info: Microsoft.Hosting.Lifetime[0]
      Content root path: 
   /path/to/project/blazor-sample/Client
  1. Navigate to the app. Type the following URL in the browser localhost:5000. The browser should now display the following content:

blazor-article-app.png

Deploy the app

At this point you have a working Blazor app that you can deploy using Azure Static functions. How do you do that?

  1. Navigate to the URL portal.azure.com in your browser and log on to Azure.
  2. Type Static Web Apps and select the suggestion.
  3. Click the + Add in the top left area.

Now you are met with a set of dropdowns where you need to fill in some info.

  1. Subscription, select the subscription you want
  2. Resource group, select the resource group you want or create a new one.
  3. Name. Give the app name.
  4. Region. Select a region.
  5. SKU. No need to do a selection here, the service is free for now.
  6. Click Sign in to GitHub, after clicking this button you will need to locate and pick your generated repo.
  7. Organization. Select organization.
  8. Repository. Select the repo that was created when you generated it from the template.
  9. Branch.. Select the branch, in this case we only have the main branch.
  10. Build presets. Select Custom, now you are presented with some options:
    1. App location. This is where the client app lives, so type /Client here.
    2. Api location, leave as default
    3. App artifact location. This is the folder that your client app gets built to. Give it the following value wwwroot
  11. Click Review + Create.
  12. Click Create at this point if you are happy with all selections you've made.

Click to be taken to the resource once deployed. The resource page should look something like this:

blazor-app-portal.png

Above you have the resource. You could click the URL from the indicated field, but it would take you to default page. Why is that? Your app hasn't finished building yet. Instead click the link GitHub action runs. This will take you to the GitHub actions of your repo. Once all the actions have finished it should look like so:

blazor-app-github-actions.png

 

  1. Revisit your app. Now go back to the resource page at the Azure portal and click that app URL. You should see the following:

blazor-app-deployed.png

Adding an API

Now a Blazor app could contain its own backend. The way the Azure Static Web Apps service is constructed though it assumes your backend will be located in an Api directory. So what should be in that directory? Well a function app. Luckily your repo already have a working function app, almost.

Let's review our repo quickly. Your solution should look something like this.

   -| Api
   -| Data
   -| Client

You already know about the Client directory where your Blazor app lives. The other directory of interest is the Api directory that contains a Function app. It's an almost functioning Function app. What do I mean by almost? Well let's have a look at it, expanding the Api directory there are some files of interest:

Client/
Api/
  ProductData.cs
  ProductsDelete.cs
  ProductsPost.cs
  ProductsPut.cs

The first file ProductData.cs contains an in-memory data store. The remaining three files is just routes for our API.

Adding missing GET route

For this API to be a full Create Read Update Delete it needs another file ProductsGet.cs, let's create that file and give it the following content:

 

 

 

 

using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.AspNetCore.Http;

namespace Api
{
  public class ProductsGet
  {
    private readonly IProductData productData;

    public ProductsGet(IProductData productData)
    {
      this.productData = productData;
    }

    [FunctionName("ProductsGet")]
    public async Task<IActionResult> Run(
        [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "products")] HttpRequest req)
    {
      var products = await productData.GetProducts();
      return new OkObjectResult(products);
    }
  }
}

 

 

 

 

 

Now select Run > Start debugging from the top menu in VS Code. At the end of the build output you should have text stating something like this:

ProductsPut: [PUT] http://localhost:7071/api/products

ProductsGet: [GET] http://localhost:7071/api/products

ProductsPost: [POST] http://localhost:7071/api/products

ProductsDelete: [DELETE] http://localhost:7071/api/products/{productId:int}

You are almost there.

Testing locally, set up CORS

When testing things out locally you need to instruct the Function to allow requests from a cross domain, i.e our Blazor app. How do we do that? Locate the local.settings.json file and ensure it has the following content:

{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "",
    "FUNCTIONS_WORKER_RUNTIME": "dotnet"
  },
  "Host": {
    "CORS": "*"
  }
}

Above you added the Host property and made CORS point to allowing all requests. This is just something we do locally, don't worry about this making production.

At this point you can run your client Blazor app and it will look like this:

blazor-app-api.png

The Blazor app is now able to talk to your Function app backend.

Deploy the app, now with API

So how do you deploy this so that the API part is there? You need to do the following:

  • Adjust the workflow YML file and point out the Api directory
  • Push the changes you did you did to the workflow file and Api directory

That's it, the way the workflow file is constructed it should pick up the changes on push and redeploy the app.

Adjust workflow file

  1. Open up the workflow file. It's a file ending in .yml in your .github sub directory (ensure you have done a git pull before this so you get this file as it's created and added to your repo the first time you deploy).

  2. Locate the section called api_location:. Ensure it looks like this api_location: "/Api". This will point out our Api sub directory.

Push the changes

Type the following command:

git add .
git commit -m "adding API"
git push

The above should push your changes to GitHub and the GitHub actions should be triggered.

  1. Go to the GitHub actions tab and wait for the actions to finish. Now ensure you reload the page

You should now see the deployed app, this time loading the data correctly

 

2 Comments
Occasional Visitor

Github repo 404

Microsoft

@Mickahappening we are trying to fix it, meanwhile, please clone this repo https://github.com/softchris/blazor-sample