Deploy a Next.js (Miro) app to Microsoft Azure w/ Env Variables
- March 18, 2024
- Posted by: MainInstructor
- Category: BASIC Go Microsoft Azure
Video Title: Deploy a Next.js (Miro) app to Microsoft Azure w/ Env Variables
Hi everybody my name is H Peru and I’m a developer Advocate at Meo and in this video I’m going to show you how to deploy a nextjs app to Microsoft Azure no more intros let’s get right into it so it’s going to be a very simple app
It’s just going to have one page it’s going to have one button which is sign in and it’s going to redirect you to the oo page for Miro and then it’s going to have a redirect URL and then if you sign in successfully it’s just going to say
Logged in successfully so very simple but we’re going to show you how to use environmental variables so let me test it out to show you what the finished product is going to be like so here is my simple sign in I’m just going to click the button sign in and then it’s
Going to take me to the Miro redirect page here I’m going to select a team and then what’s really important is that it shows you where you will go to complete the installation so this is the redirect URL that’s very important and we’re going to need to set this in our miror
App app settings and we can click add and it will go to the redirect URL and if it does so it’ll say logged in successfully so that’s the basic premise of the app and I’ll show you now how to deploy this on Microsoft Azure and specifically we’ll be using the static
Web app service and we’ll add in some environmental variables and you’ll know how to do that for the nextjs runtime and it can be applied for any of the other run times that the Microsoft Azure static web app support so let’s go ahead and get started so first of all we’re going to
Go into our Azure account this is all on the free account uh but you need to make sure you have an account to begin with and so that’s what we’ll do is we’ll go back into our Azure account we’ll go to static web apps and what we actually
Need is we need to have a repo where our code is based here is my repo that I’m going to use and it’s a blank repo and what I’m going to do is I’m going to actually put in some code uh from this repo so I’m going to just do a
Getet uh get add get commit and then I just need to add the remote so I already set this you can see I already have remote origin so I’m just going to set it and then now push it okay so now we have our code into this
Public repo and of course you can go ahead and clone the repo and just use this repo to deploy um so now that we have the repo ready to go and I do think it looks good we can go into uh Azure static web apps we can create a new web
App and here we’re going to create a new Resource Group and it’ll be YouTube demo nextjs and then this will just be Azure Deo deploy nextjs we’ll keep it on free this is really important too you want to pick uh where your app is going to be
Deployed and I’ve ran into some issues before with Azure where it only lets you deploy I believe it’s like one uh web app per region I’m not 100% sure on these details but you might get some errors so if you see that just change the region or change the resource Group
And it should be good so now it’s asking me for my deployment details so here is my gith account um you can of course you can change that but I’m going to stick to my account and of course you’ll need to authenticate into your GitHub account I’ve already done that uh but you’ll
Need to go through that as well now we’re just going to choose the repository and it’s going to be deploy nextjs Azure so deploy nextjs Azure uh main branch which is fine and the build presets this is the most important part of the video is the build presets I had
Some issues with this in the past I just let it be on default and it didn’t work properly so we’re going to choose nextjs here of course and we’re going to leave the defaults where our app location is at root that’s fine and if you had serverless functions or things like that
You would add that here but I don’t so I’m just going to do preview that looks fine to me now I’m going to click on review and create this looks good to me and within a couple seconds I should be able to deploy so I’ll click create
Now and while this is deploying we’re going to need to do something on the Miro side so for a Miro app to work we’re going to need to tell it what our URL is so this is um what Microsoft Azure provides is it provides this public URL so anybody on the internet
Can access your app so let’s go to our resource and here it is and here is our URL so we can copy this URL and we’ll go into developers. mirro.com and we will create a new app and we can use this section create apps using examples and we will use the
Nextjs oo and what we can do here is register app using example settings so that’ll just give us uh kind of the boilerplate template code we need and we’re just going to hit create app and this is where I’m going to go ahead and edit in the Manifest this is the um app
URL and then here is the redirect URL so I’m going to click save so that looks good and that should be it for the mirror side and now we can show you the deployed app hopefully it’s ready so let’s go ahead and check okay so it’s
Taking a little bit of time that’s fine so while this is taking some time I’ll show you how to use environmental variables in Azure I’ll show you the code that we’re deploying so it has a couple pages so it goes Pages API and redirect and that is the logic that we
Need to understand and you can see it’s using some environmental variables here it’s using client ID and it’s using client secret and then redirect URL so we’re going to need to set those environmental variables in our Azure app so let’s go ahead and do that now and we
Will get that uh the client ID and client secret from our mirror app so let’s go ahead and see this app you can see it’s created today October 29th here’s my app URL and the redirect that all looks good and I’ll start with the client ID
So in our Azure app we went into configuration and I’ll click add and here is the client ID and it has to be spelled perfectly in terms of the casing so uh uppercase and lower case does matter we’re going to click okay we’re going to add in a new one which will be
The client secret and here is my client secret and I’m going to delete this application after the video so that’s fine and all good but you don’t want to show anybody that client SE secret and lastly is the redirect URL so here it is we’re going to add that into our Azure redirect
URL okay now we’re going to click save and that’s going to take some time to redeploy the application with this new configuration and if all worked well in a few seconds I should be able to refresh this page and here’s the signin button and again the redirect URL should be Black
Rock / API redirect so we click sign in and here we can see that it will work because we can see that it’s going to take us to the right URL so this all looks good I’m going to add this into the hod Dev team I’m going to click add
And we should say successfully logged in nice so that’s it for this video you learned how to deploy a static web app a nextjs app on Microsoft Azure and we showed you how to do that with Environ edable variables specifically for a Miro app we’re going to need to go into our
App settings and tell uh Miro where our app is deployed so we’re going to use that deployed URL and also the redirect URL for the ooth and in terms of the environmental variables on Azure side we go to configuration and then add those in click save and that will redeploy the
App with this new environment so I hope this was helpful please let me know in the comments below if it helped you please like And subscribe because that will make my life a lot better and I will make more videos for you and let me know in the comments below what you want
To see next thank you bye
Video Keywords: Microsoft Azure
-
Sale!
Wireless WIFI Repeater Extender Amplifier Booster 300Mbps
$29.99$14.99 Add to cartWireless WIFI Repeater Extender Amplifier Booster 300Mbps
Categories: Electronics, Wi-Fi Router, Wireless Wi-Fi Extender Tags: 300Mbps, 802.11N, Amplifier, Booster, Extender, mobile wi-fi booster, Remote, WIFI, Wireless, Wireless WIFI, Wireless WIFI Repeater, Wireless WIFI Repeater Extender, Wireless WIFI Repeater Extender Amplifier, Wireless WIFI Repeater Extender Amplifier Booster, Wireless WIFI Repeater Extender Amplifier Booster 300Mbps$29.99$14.99 -
Sale!
Full RGB Light Design Gaming Headset Headphones with Mic
$24.99$14.99 Add to cartFull RGB Light Design Gaming Headset Headphones with Mic
Categories: Electronics, Gaming, Gaming Headsets Tags: Design, Full, Full RGB Light Design Gaming Headset, Full RGB Light Design Gaming Headset Headphones, Full RGB Light Design Gaming Headset Headphones with Mic, Gamer, Gaming, Gaming Headset Headphones, gaming headset wireless, Headphone, Headphones, Headset, Light, Mic, Package, RGB$24.99$14.99 -
Sale!
Wireless BlueTooth Multi-Device Keyboard Mouse Combo
$39.99$19.99 Add to cartWireless BlueTooth Multi-Device Keyboard Mouse Combo
Categories: Electronics, Gaming, Gaming Keyboards, Keyboard Mouse Combos Tags: Combo, Keyboard, keyboard mouse combos, Mouse, MultiDevice, Set, WireKeyboard Mouse Combo, Wireless, Wireless BlueTooth Keyboard Mouse Combo, Wireless BlueTooth Keyboard Mouse Combos, Wireless BlueTooth Multi-Device Keyboard Mouse Combo, Wireless BlueTooth Multi-Device Keyboard Mouse Combos$39.99$19.99 -
Sale!
High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar
$199.99$139.99 Add to cartHigh Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar
Categories: Gaming, Gaming Chairs Tags: Adjustable, Chair, computer chairs, Desk, Executive, Gaming, Girl, Headrest, High, High Back Leather Executive Adjustable Swivel Gaming Chair, High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest, High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar, High Back Leather Executive Adjustable Swivel Gaming Chairs, Leather, Lumbar, Office, Racing, Swivel$199.99$139.99 -
Sale!
Professional LED Light Wired Gaming Headphones with Noise Cancelling Microphone
$29.99$19.99 Select optionsProfessional LED Light Wired Gaming Headphones with Noise Cancelling Microphone
SKU: N/A Categories: Electronics, Gaming, Gaming Headsets Tags: Cancelling, Gaming, Gaming Headphones with Noise Cancelling Microphone, gaming headset, Headphones, Headset, LED, Light, Mic, Microphone, Noise, Professional, Professional LED Light Wired Gaming Headphones, Professional LED Light Wired Gaming Headphones with Noise Cancelling Microphone, Wired, Wired Gaming Headphones, Wired Gaming Headphones with Noise Cancelling Microphone$29.99$19.99 -
Sale!
Gaming Desk with LED Lights USB Power Outlets and Charging Ports
$349.99$249.99 Select optionsGaming Desk with LED Lights USB Power Outlets and Charging Ports
SKU: N/A Categories: Computer Desk, Gaming, Gaming Desk Tags: and Charging Ports, Charging, Desk, Desks, Gaming, gaming desk with led lights, Gaming Desks with LED Lights, Home, LED, Lights, Monitor, Office, Outlets, Port, Power, Room, Stand, USB, USB Power Outlets, White, Workstation$349.99$249.99 -
Sale!
Wired Mixed Backlit Anti-Ghosting Gaming Keyboard
$99.99$79.99 Add to cartWired Mixed Backlit Anti-Ghosting Gaming Keyboard
Categories: Electronics, Gaming, Gaming Keyboards Tags: Antighosting, Backlit, Blue, brown, Gaming, Gaming Keyboard, gaming keyboards, gaming keyboards and mouse, Keyboard, Laptop, Switch, Wired, Wired Mixed Backlit Anti-Ghosting Gaming Keyboard, Wired Mixed Backlit Anti-Ghosting Gaming Keyboards, Wired Mixed Backlit Gaming Keyboard$99.99$79.99 -
Sale!
Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset
$119.99$59.99 Add to cartWireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset
Categories: Electronics, Gaming, Gaming Headsets Tags: 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset, ANC, Audio, Bluetooth, Cancellation, Ear, Earphone, gaming headset, Headphones, Headset, Hi-Res Over the Ear Headphones Headset, HiRes, Noise, Wireless, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Headphones, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headsets$119.99$59.99 -
Sale!
Wired Sports Gaming Headset Earbuds with Microphone
$19.99$9.99 Select optionsWired Sports Gaming Headset Earbuds with Microphone
SKU: N/A Categories: Gaming, Gaming Headsets Tags: Accessories, Earbud, Earphone, Earphones, Gaming, gaming headset with microphone, Headphones, Headset, IOS, Microphone, Sports, Wired, Wired Sports Gaming Headset Earbuds, Wired Sports Gaming Headset Earbuds with Microphone, Wired Sports Headset Earbuds$19.99$9.99 -
Sale!
150W Universal Multi USB Fast Charger 16 Port MAX Charging Station
$49.99$29.99 Add to cart150W Universal Multi USB Fast Charger 16 Port MAX Charging Station
Categories: Charging Stations, Electronics Tags: 150W, 150W Charging Station, 150W Universal Multi USB Charging Station, 150W Universal Multi USB Fast Charger 16 Port MAX Charging Station, 150W Universal Multi USB Fast Charger 16 Port MAX Charging Stations, 150W Universal Multi USB MAX Charging Station, 16 Port MAX Charging Station, 3.5A, Charger, Charging, Fast, laptop charging stations, Max, Multi, Port, Stand, Station, Universal, USB$49.99$29.99