Speaker 1: 00:00 [inaudible], I forgot to say congratulations Speaker 2: 00:11 to us about 150 episodes three episodes ago. Did you know that we did that? Yeah, I guess cause we did the lightning talk. I guess I remembered that. But 150 feels premature to celebrate. Like your celebrations are exponentially spaced apart. So like episode one is a celebration too for a, you know, so, um, but either way, good job boss. We made it this far onto 200 James. Yeah, I think 200 is the big one. In fact, I didn't even think anything of it. And then few of our listeners tweeted at us congratulating us on 150 and I was like, I guess that's a big number. It's not quite three years though. It's like almost three years, you know? Yeah. I, I never understood how we're so not aligned. I guess there's 52 weeks in a year. Have we ever missed a week? I don't think we've missed a week. Speaker 2: 01:02 So that helps. How do we do this? Well, I'm not traveling this week. Are you traveling this week? I'm not traveling this week now. That's why we're being so good at this. We even pull it off while we're traveling, but yup. Good job. Um, I dunno. Just a milestone, just a milestone. Well, you know, going into this podcast recording, it's bittersweet because last week we could have done a WWDC predictions followed by here's everything that just happened in WWDC, but now frank, this podcast is coming out on a sneaky Monday in which apple is doing the keynote. Can you believe that that's never happened? Yeah. It would be so awkward to make our terrible predictions. And then just two hours later you find out what actually happened. So I guess we're going to save ourselves the shame, but I'm looking forward to dark mode and Ios. That's my only prediction. Speaker 2: 01:55 Here's, here's a prediction for you. Okay. Ready? Uh Huh. Uh, Ios is going to come become more like android. It's just like android has become more like Ios and now Macko us will become more like Ios and then ios and will become more like macro s which just got a dark mode. Boom. That's so cynical and true. Good job, James. I agree 100%. No, I'll, I'll, you know, we've been talking about Marzipan the whole time, so I'm just going to be glued to the TV and we might have to wait for not just the keynote, but, uh, what do they call that? The developer, the Union State of the Union. You got it. So that should be the good juicy part. Yeah, I'm very, very excited. Um, like what, like I said, we're going to do just a normal podcast. I don't know if we'll do a special episode or anything like that, but we'll be live tweeting and I'm sure on Monday and go into town and my predictions, anything of Mass Marzipan effication I am all about it. I think it will help the world and it will be lovely. So, um, anyways, so let's, uh, let's go on to our topic, which Speaker 3: 03:00 I sort of threw out there because I've been doing some live streaming like I always do at work and on my Hanselman APP. Frank, you know, I love a good Hanselman App. Speaker 2: 03:08 I love these weeks. I love the weeks when you do something new and then we get to talk about it. We should have like some kind of slogan for this. James did something new that's decent to them. Do it. Yeah, Speaker 3: 03:21 you can watch me, you can listen. And you know, boom. So yeah, so I've been building this app and I started over with, from scratch. So Hanselman forms is this like celebrity application and the idea is what I had five years ago and forms release was that I wanted to build something that I could show handsome in that would allow him. So I said Hanselman's everywhere. He has podcast, he has a blog, he has Twitter, he has all sorts of other social media. I'm going to pull it all into one APP and sort of make it the Scott Hanselman APP. And it's evolved as well. Speaker 2: 03:54 Can I paint a picture here though, because I don't know if you even know a little bit of secret history here. Um, uh, I worked on one of the original Hanselman Ios Xamarin apps many, many, many moons ago, uh, with Chris Ntr. And he and I for some reason decided we're going to take it upon ourselves to write Hanselman an app to just just show off basically. I don't know why we were doing it. And so, uh, it's funny, uh, it all comes around. I've been there, I've worked on such an APP and it's kind of fun. This was back in the day where everyone thought they were going to do custom apps for everything, but then realized they don't have the time or resources to do it is true. Speaker 3: 04:36 Sure. Yeah. So, so yeah, the eight years later, we're still building apps around Hanselman Speaker 2: 04:41 that that's the best scenes, the story. If you're gonna pick a subject, I think it's a great idea for just showing off frameworks and showing off tools. It's way better than what's my normal one. Click a button and a counter goes up, I think. Yeah. Your standard one used to be also be the monkey viewer. I don't think would use that one too much anymore. I still do. I still do. Okay, good, good. Uh, yeah, so just having Hanselman is a subject. He's so prolific. He can just, he's done videos, audio words, all that stuff. Speaker 3: 05:12 He has done all of the things the, yeah. So I thought like this would be cool because let's say you have a favorite celebrity or someone else or you want to build your own app for yourself. You could easily tie up a data source, pull it in, change a few theming done. You got yourself an APP. That's kind of cool. So I thought it, what's going on here, you know, and white labeling this thing. No, the idea is that you could but now no, you're good. Okay. So the entire concept that I had going into this new year is I really wanted to modernize it. I thought that Xamarin forms is in this really great place, um, better than ever. And I knew that Shell was coming out, collection views coming on, visuals coming. I was like, wow, there's just so much stuff and people use this app. Cause Hanselman a whole blog post on Speaker 2: 05:58 in many moons ago. And I said, this app better look good and it could be a cool reference out. I said, I need to actually work on it and do pull requests and make it fresh. So. Okay. Well what, paint us a little bit more of a picture. How has this Ui at this historical point in time is a good, I mean you're saying you want to use new controls. What did you think the Ui was kind of just old or do you think it had some weak spots? Paint us a picture. Yeah, so the application, it's five years old, so it has some five years of cruft on it, if you will. Uh, I would say that Ios and android Ui paradigms haven't changed that much, but at the time, Speaker 3: 06:41 how you would do multiple sections was kind of the fly out navigation, which the world's kind of moving away from in some regards based on how much you have and everybody's all about bottom tabs now, card views and kind of some of the similar Ui between Ios and android and rounded corners and circles. And you know, the application was really just a bunch of lists, views. It was a bunch of lists use. And that was it. It was very simplistic. There was hardly any design work that went into it. So I just slapped down items. Uh, you know, the, it just wasn't the most beautiful thing that I could build. But it got the point across like, look what you could build. In fact, I built it in a weekend or like one night is like five hours or something. Like, well look what you could build in five hours. And that's pretty cool. And then I thought, what if I'd spent more time, 10 hours, 20 hours, 30 hours, 40 hours on it, you know, every Friday and made it really nice with beautiful card views with rounded corners. And what if it could adapt to landscape mode or tablets? And what if it had, you know, a modern podcast player built into it before I just had three buttons that said, play, pause, stop. Like that's not good. Right? That's bad. Yeah. It was demo where it was demo aware of before. Speaker 2: 07:57 Uh, I, I love that you're putting in a fall podcast player because this is something we used to do a lot back in the day actually because apple and android made it pretty easy to just knew what a media player and add some play pause controls. And I think that's why we all had pipe pause cause that part was just so easy. So I'm curious if you're doing like, you know, the slider and taking show notes and that kind of stuff. But uh, nope, nope. Answer those questions first. But, but I, I have questions after that. Okay. Yeah. So, so the podcast, Speaker 3: 08:31 yeah, the idea is that I want to have the ability to download to stream. If I get really fancy, I'll do background. I've done that in the past. That's a little bit complicated. Uh, you know, you could do the artwork cover, things like that. It's all possible. It just depends on which time I want to have. But it was really a, how can we modernize the Ui with modern paradigms. So I wanted bottom tabs everywhere when in material design and more places and not everywhere, but Speaker 2: 08:58 more places. That's exactly what I was going to ask you. Cause I think that that's the biggest question modern Xamarin forms people face is whether to use the new visual material thing. But you decided, Yep, Yep. You're going for it Speaker 3: 09:10 in certain places, not everywhere. You don't need to use it everywhere. It's okay to to, to not use it everywhere. Yeah, just interesting. Yeah. Well where are you using it, James? Well, I'm using it definitely four buttons in many places. Not all buttons, but some buttons that could have a nice ripple effect. The frame in Xamarin forms gets a nice overview because it has a really nice drop shadow now around it. You can have rounded corners, you can make it a circle. It really changes the game a there and you can put anything inside of it too. So you can have a circle image without having extra controls or custom controls. It's just built in. Speaker 2: 09:47 Now is that regardless of visual or is that just work? Well with material visual. Speaker 3: 09:53 So the vision, the visual frame previously was not very elegant. It wasn't, it had like a weird drop shadow on ios because it didn't really have a official thing. Now it has proper drop shadows and it just looks better in all regards in general. So that's where the native Ui then. Yeah. And then you know, I think in general like the sliders and a little activity indicators, I can, I can update, but mostly what I get out of it is a little bit nicer look on Andrea and a little bit nicer look on Ios where I see fit. Whereas the biggest change is not visual. It's probably collection view in making that work and getting rid of list views in many places. Speaker 2: 10:40 So let's dig a little into that. Cause I think when you're writing mobile apps for the first time, you realize how important these reusable views are and collection view. I've heard all the hype, they say it's super configurable, it's super efficient, the syntaxes easier to use. Are Any of those true? Speaker 3: 11:01 Did you enjoy it? Yeah, collection we use. Great. Uh, the Nice thing was collection view is that it's nearly the end identical, uh, API to list view. So it's a list of you and has a data template and you can put stuff in it. The perk of there is that it uses Ui collection view under the hood, which we all know is very superior to Ui table view. No, no shade Speaker 2: 11:27 Ui table view is a thing of amazing. But yeah, I I, I'm still tableview tableview forever, but I, I've used collection view. It's fine. It's nice when you want to have multiple columns. That's all. That's all card you eyes navigation Ui wise. Um, yeah. Modern Uis here, right? [inaudible] your eyes have multiple columns. Speaker 3: 11:50 Yeah. And the Nice thing is that you can now left and right, you can make it a horizontally making vertical. You can have multiple rows, you can have multiple columns. It's very, uh, you can make very visually pleasing user interfaces. You can kind of nest these together, which is very cool. So for instance, what I did in the blog is I have a really cool background image and then some overlays of the title on it in this card. And then if you rotate your device into portrait mode or landscape mode, sorry, it will show to blog side by side. So instead of just making the blog bigger, it makes it too right. Or if you're on a tablet, uh, it'll be two. And then if your on a TV it'll make it four or something like that on, you'll never be on a TV. But on an Android TV, I guess it would work. So you can sort of factor that in to say when I'm on a tablet or a phone or whatever form factor, give me multiple columns and it'll magically do everything for you. So that's sort of the biggest change in, it's the combination of things. It's the modernization to say we're going to use the card views, we're going to use the collection views and eventually I'll use a carousel view and things that make up more modern Speaker 2: 13:06 Ui. Yeah, that's really fun. I'm really curious to see how they handled nesting of collection views. That sounds like an absolute disaster. And I've read, um, all of the touch manuals from apple and I even built a Ui once and I called it a thumb based Ui where you could do everything by flicking your thumb around. And the way it worked was nested table views and scroll views and collection views all within each other. But to pull off that orchestration, I uh, well you really have to read the manual honestly to see like who gets preference under what situation for what directions, stroke and you have to handle all those conditions. They do nest very nicely, but it's always complicated. So I'm curious, um, if it's, if a technically supports nesting or if it, uh, actually thoroughly supports nesting and just being a little cynical. Speaker 3: 14:04 Well, I've seen some people did a collection view challenge and they made some, uh, very beautiful apps like a Netflix type apps. So I think that if you have a scroll view and then you have collection views inside of it that are going, Speaker 2: 14:20 uh, horizontal like left to right, I think that works really well. Yeah, the easy case. Another question Speaker 3: 14:29 Jen will be, if the collection view inside of a scroll view or you know that word Speaker 2: 14:35 positive I need to look at. It's always a question of if you have two vertical scrollers, what happens when the top verticals scrollers done? Do you auto scroll to the bottom? It's all that fine stuff anyway. I didn't mean to make this a episode about collection view that just I perked up when you, when you said, well the funny Speaker 3: 14:52 part about it and, and I'm calling this like kind of the modernization but it's not just about the Ui. You know I want to get to the backend too, which is what I really want to talk about. But the funny part is that when you start modernizing the front end, as things have progressed, there's just so much more to learn. That's sort of the ironic part, which is in the beginning, right of of Ios and android of Xamarin forms, everything is so simple. Simple in quotes, right? Cause you can make it complicated. It'd be like, oh, like it's cool cause I can do this and I can do this and I can build things really fast. And then five years later, there's all of that plus five years of stuff, right? Like, uh, not only does Xamarin forms, but of Ios of Android, do I show the title of you? Speaker 3: 15:34 Do it, what happens when I scroll? Like is there safe zones? Like how do I do bottom tams? I don't do the top tabs. Like how do I do the fly? I like how do I make it the collection view and how does it proportionately do it? And like now I got to worry about all these other devices. So that is what, five years later, I've been in it for eight years, but still learning. And that's something that boggles my mind. So these questions are real questions that I'm thinking through as I'm building the APP. Cause [inaudible] if you're not just using a standard Ui collection or table of view, then things can get complicated. Speaker 2: 16:10 Yeah. Um, my reference for complicated, it's always snapchat. If you remember that APP, they just had crazy Ui for every action. It was semi discoverable and learnable. You know, certainly people who use the APP learned it, but it was definitely not standard Ui. They took a lot of chances and that kind of stuff. And I often think about Uis in terms of fashion trends honestly, and not just in the graphical design, but in these user interactions. Often it feels like we're just going along a path because a cool app came out. So we all copy how that app did something, you know, that's how we got pull to refresh with table view. So it's not so bad these UI trends, but these UI trends can also aid your apps. So not just, you know, keeping up with the Oos, but just in Ui design trends like uh, like you said, the fly out, we're just, I've always hated the hamburger menu in the fly out. So it was so nice to hear that. You think those are starting to go away? Actually, Speaker 3: 17:11 slowly but surely they're the, they're the overflow. You know where you need to get into settings or change accounts or somebody even that's going away. They have bottom sheets and all sorts of stuff. But you are correct. The trend that I hear currently is gradients. People love gradients. Frank, Speaker 2: 17:28 they're back baby. Yeah. Uh, are we getting first class support for gradients? I'm sure there's a billion new gets you could download for Xamarin forms. Is that one of those feeds Speaker 3: 17:37 that's coming in? There are, and I'm pretty sure there are a bunch of new gets. The pancake view is one of my favorite from Steven, but I'm pretty sure on the Xamarin forms roadmap that uh, that there is, I'm pretty sure it says first class support for gradients. Like that's actually a feature on there. And I'm like, that's silly but cool. Like one a rounded corners, gradients and brushes. It's literally July, August 403. Speaker 2: 18:04 Yeah. Well we've had this abstract brush class forever and all we ever had was really solid brush. So I was like, thank God we're getting something interesting going on. Give me those gradients. Yeah. Love Him. Yeah. Did you see a speaking of, not WWDC, but um, a few screenshots leaked out about it and a little bit of skeuomorphism is coming back. Apple starting to put gradients back into their apps so it's better Speaker 3: 18:28 baby ios six forever survive. Oh Gosh. Here we go. All right, well let's stop talking about the acts. I want to talk about the fun stuff, which is the back end for the application. But first let's take a quick break and thank our sponsor this week. Our good friends over at the teller, a team at progress, they've been cooking up all sorts of awesome things. First and foremost we always like to talk about it cause I love Blazer and they just released a Tellerik, a Ui for blazer. And if you don't know what Blazer is, it allows you to run your asp.net server, side applications clients. And you can run an entire web apps on your desktop or anywhere. It's great. It's really, really cool. Runs all in web assembly or you can still set it on your server and things run locally. So you run C sharp in the browser, which is cool. Speaker 3: 19:16 And of course you need Ui for that. So that's where tellerik Ui for blazer comes in, has all sorts of great web Ui components, specifically designed for blazer so that we can create rich web interfaces all in c sharp. No more javascript. Anita get outta here. But if you're building anything else, including Xamarin applications, they have beautiful controls and templates and everything that you need for your Ios, android and windows applications, all from a shared single code base was cool. Is Everything is super optimized for visual studio 2019 so you can go and check it out by going to tellerik.com that's it. telerik.com and thanks to tolerate progress for sponsoring this week's bye God. Speaker 2: 19:57 Thanks tellerik. Ah Man. I know I said it before, but it's super cool that they're staying so up to date with uh, their controls and plays are and all that. It's super cool. You got to, I love it. I just want to grab stuff and shove it in the APP and boom, now I have something. So, all right, so all right. You want to talk about the backend for something? I just, I'm, I'm afraid, you know, we are, we only spent half the episode on the Mobile Ui part in Oregon, spent half on the web. We've turned you into such a web person. James, what have we done? But I guess, uh, servers aren't necessary features of apps these days, so this'll be fun. What'd you do? Do the best part is that there was no backend frank for the APP ever. Oh, um, yeah, that makes sense. Because Hanselman's going to have a bunch of RSS feeds and I assume you were just pulling down all of that. So there was a back end, but Hanselman was, uh, hosting it first. Whatever. Speaker 3: 20:56 Somebody somewhere was paying a bill for me to hit. So there was a one, I had a call, a Twitter API, so that's one. Okay. Uh, Hanselman's blog, that's two. And then I had three separate feeds for three different podcasts. All right. And then I had a channel nine feed for the videos. So that's six different fees that needed to be parsed and updated all inside of the application. Speaker 2: 21:24 And they all probably use the variant of RSS and Adams that you had to have a good library that could consume all of them. I have written these kind of multisource apps a lot and I think that a lot of mobile apps become this. We always simplify to you write your web server and your database and then your app talks to that. But the truth is, yeah, you're right. Speaker 3: 21:45 Usually hitting many data sources and I've always had um, architectural issues with us actually with my coat. I could never decide how I was going to handle this. Was there a set of classes for this service, a set of classes for that service? How do you join that data? It's complicated. Uh, I don't think we need to talk about all of that, but I just wanted to say I feel your pain, James. Yeah. And this one was complicated for the fact that there were so many different backends, like you're saying. And I had different parsing code and at one time I was using link to Twitter, which is a Twitter sort of wrapper, which made it really easy. So I can say, here's my key, just go do it. And that sort of fell out and not up to date on the Twitter API. So then I had to update the APP with the new Twitter Abi go, man, this is complicated. Like I keep having to change things all the time. Uh, and I can do that. But the bigger problem is that when I started to rebuild the APP, I started to look at the payload coming from these backends. How big of a text file do you think the RSS feed is coming from? Hanselman's blog. Speaker 2: 22:52 Oh Gosh. Um, I know he has a lot of posts. I, oh golly. It's gotta be big. I'm going to guess five meg compressed, uncompressed. What are we talking w Speaker 3: 23:05 whatever I do to hit a, get a sick gate, get string, async. Speaker 2: 23:10 Well, hopefully you're enabling compression everyone. I don't know if it's on by default. Speaker 3: 23:14 I think on the http client and client factory, make sure you enable compression. Uh, otherwise I have no idea. James, tell me the number. It was five megabytes. I don't know how you guys nailed it because I deal with data sources, dude. Yeah, well, and it was the same for Twitter. The funny part is that since it was a, Oh this is my kind and find kind of fun play toy, you know, your API limited. So really it's only 15 calls per 15 minutes. So it's like a call a minute. Oh yeah. So many have the APP. It wasn't gonna work. And then you're pulling out all of this Twitter data, which again, which is a huge amount, but do you know how much data I'm displaying in the Ui, frank? Speaker 2: 23:55 Oh Wow. At a time. Probably not too much. Or do you mean just the what? The APP can totally dis way. Weird question. Speaker 3: 24:03 Yeah. So if I have a list of blogs and when I tap on the blog, I'm just going to open a website. Right. I'm not going to try to render the html. That'd be silly for that list. How many, how many properties do you think I need? Speaker 2: 24:16 Oh, I don't know. There's probably 500 items I think. I guess before in the list there's the title, the description, a icon, the date, you know that stuff. Speaker 3: 24:28 Yeah. So what if you were to take the blog and then parse it somewhere else on the back end and then only return Jason instead of Xml to your mobile application? How big would that file? B. Speaker 2: 24:43 Oh, okay. So you cleaned out the data on a server, but it's all the same data. So did you get that down to a megabyte? What'd you get it down to? Speaker 3: 24:54 Five kilobytes? No you didn't. It's not data there then. It's not, it's only the data that I'm displaying in the mobile APP. Speaker 2: 25:04 So no descriptions because I mean just one of his descriptions could be five kilobytes. Speaker 3: 25:09 Ah. So here's what I do is I don't need a full description. I have a caption cause I only need to display so many characters in the APP. So the beautiful part is that the description normally is the full html blob. So my goal here and then I also want to display a photo. And what I do is I try to detect a photo inside of that blob. So what I said is, what if my back end stripped all the html out only gave me finite little tiny bits of data. So the title, the image URL to display the caption and the main URL that's very, very small compared to here's this huge blob with mostly tons of XML junk, to be honest with you. And when you think about hitting a back end, sometimes, um, backends will allow you to pass in arguments and say, Hey, only give me these three things. But sometimes they don't and sometimes you don't know. So I said, what if I created my own backend that was sitting there and was able to cache data on demand, write that out to disk and then kind of keep that as an API. How can I optimize my mobile APP tab, the smallest payload possible? And I did this frank with an Azure function. Speaker 2: 26:33 Ooh, okay. So we have a lot to talk about here. But first I want to say congratulations. You've done what I've been meaning to do for awhile now. Uh, Calca has currency data in it and currency prices unfortunately keep changing. So you got to keep updating it. We all used to just scrape from Yahoo. It was fine. The whole Internet ran off of Yahoo's currency data, but then they stopped serving quite rude of them. Yeah. So now I have to pay for our currency service. Uh, fortunately, unfortunately Calca is popular and I quickly kept going over my rate limits for that currency service. So I need to build an Azure function as something, something function to also, as you said, cash the data. Uh, you mentioned that you have rate limits with Twitter. That's exactly what I'm running into. And so instead of having everyone's app a hit this Api, my server, we'll hit a cash it for a bit and then the server has to uh, people's devices. We'll hit my server instead of theirs and not by server. I know it's serverless, whatever. We all know what we're talking about here. Some machines handling the message, Speaker 3: 27:50 it's very, very true. So I'm going to send you my c sharp file. The cool part here is that this is less than a hundred lines of code to update automatically and also to create an end point because the reason I created an Azure function, let's start there. Okay. Okay. I created an Azure function because I wanted to have job scheduling so I could hit something over and over again, you know, maybe every five minutes, every 10 minutes, every 20 minutes. And at the same time I didn't want a server running 24 seven because you say, oh James, just create a Web Api and that's great if you are modifying the data, if you need to have access immediately to your database and you have a bunch of stuff. But for me, I'm just doing very simple things like I want to every 15 minutes go in, update the tweets and create an http endpoint for me that people can query and I decided that a sheet or Azure functions, we're going to be great. Speaker 3: 28:49 If people don't know what Azure functions are, it's serverless compute. This would be very similar to AWS lambda or Google cloud functions. I think they're called a cause. Why not? But you can write them in javascript and f sharp and c sharp and Java and c Plus, plus you write him in anything. And of course I wrote it in c sharp, but my favorite part is that they have these connector things. And this is where it gets cool frank. Because what I do here is I decided that every 15 minutes I was going to go check Twitter cause my, my rate is fifth is once a minute. But I said I can do it every 15 minutes unless he's on a tweet storm, you know, and uh, and that'll be fine. I could do it every minute, but hey, just every here and what it'll do is it will handle all the code and you only pay for execution time. So if it runs for 0.1, right, boom, now it's going to do the networking, it's going to do the caching, it's going to do the parsing, it's going to do all the hard work for me automatically. Boom. Um, and that super duper cool. But at the same time, you also have these cool connectors on here to do what I needed to do, which is read and write to a blob on Azure blob storage like a Jason File. So, um, that's like one line of code. It's bananas to do. Speaker 2: 30:08 I, I think that the, this is the most interesting part because anytime you say I have this awesome function machine that takes inputs and spits out outputs immediately, the first question you ask is, well, I have a bunch of data and I need to access that data. How do I do that? And what I love here is that each of these functions, while they're literally function, so you declare Gomez, um, static methods on a static class. So it's a pure function. And, um, I love what you do. You just add an argument to that function or parameter with some attributes and the attributes say, here's the file I want from this blob storage connection, which I assume you name your connections in a config file or it's a configured on the web interface or something like that. But the point is, uh, you literally just declare a parameter. It's a stream, like the old system, I'll stream and you say blob and you just put all these attributes on it to tell it how to get that blob and magic presto. You have your connection. And even better you can say if you want read access or write access. Yeah, 50 darn sweet. Speaker 3: 31:18 Yeah. So for each of these I have one that does a read and one that does the right and the read obviously is an http triggers. So the idea is that something will trigger this. So when I publish this function, it gets a Web Api style get and I have a get on here and it's, I can hit that from the browser from anywhere else and it will then automatically suck in the blob that it will try to find there as long as it exists, which it does, read it in, load that string up and then return that as an http request. And it's super quick. And the cool part there is that it's not parsing anything. It's like immediate, right? It's just reading in a five kilobyte file on a super crazy fast server somewhere and returning that as a web request as Jason Boom. Yeah, Speaker 2: 32:05 it's fantastic. You would think that they could even streamline that part of it so you don't even have to go through that. I know there's tricks you can do with a blob storage where you can generate temporary URLs like read only URLs and serve that URL so you're not even hitting any of your server. You're not even using any of your bandwidth anyway. That's just a refinement. I want to call out the timer and how your update function works cause I find this very interesting to just, Yep, just like the blob storage. It's just another parameter on your function. This time it's, I've got a weird, the type is timer info and it's my timer. So an input to your function is some timer and now the part that I find most hilarious, he set up this timer using cron syntax. Yes folks, 1970s cron syntax the syntax and no one can remember except for system administrators and God bless their hearts, but it's an impossible send texts to remember. Speaker 2: 33:05 But you can put that in a, I hope that there are some nice parameters on that attribute. So I don't have to remember cron syntax that are not. Nope. Oh Great. Great. We're all going to go have to buy that Unix book and remember how to write kron. The documentation is very good. It tells you how to do it. So this one is saying, this one is saying every 15 minutes. Run my time. Yeah, well no, that's not what it says James. It says zero space star slash 15 space star space star space star space star. So this is saying great at the top of the hour, every 15 minutes. So at one o'clock one 15 one 31 45 this whole run, that's how that works. It's so obvious. Well, the deep shadow, the default template, the default template gives you the run every five minutes. So then you can just modify that and that's great. Speaker 2: 33:55 So, so as long as yeah, as long as you just want to run on a minute mark, we got you covered. Otherwise go buy a $50 book and see how that Syntax works. Exactly. Yeah. Now the interesting thing with you have two functions. I don't know if we made that clear, but you have one function that just fetches your um, trim down Jason and then you have another function that actually queries Twitter and then writes out that trimmed down function into the blob storage. So one of these functions reads from Blob, the other one writes to Blob. And I like that they kept that very simple to, again, you just declare your stream and you just say, this time I want to write to it instead of read from it and it works exactly how you would expect it to. Very nice. It's super duper simple and boom, it's good to go. Speaker 2: 34:42 Now I, I have not tested necessarily the concurrent. Some people may be thinking, what if your reading and writing at the same time? Like how does that work? And I haven't tested that to be honest with you. Um, yeah. The, the general trick with that, um, blobs are different. So you would have to look up with our policy is with how streaming works. But I would assume that you would either get an access violation on or it'd be the last writer wins, but you should definitely look that up because it'll come up. I'm sure it'll come up. Yeah. So that's one thing that I definitely need to look at. But in general, the, the beautiful part here is that boom, it's just like done all of a sudden. And what I like about this is that previously there was multiple API APIs. Like there was a Jason Api, there was an Xml Api. Now from my mobile APP, I consider this the mobile API. And this is, yeah, something that I've been preaching for a long time when it comes to mobile development and a lot people implement Speaker 3: 35:38 this, um, I've seen it in action. It works well, is that you always sort of have this master API that's usually controlling your website and then you have a mobile shim layer on top of it. So the idea is that your mobile apps hit the Mobile Api, which does the hard work of interlaying with your main one. And the reason you want to do that is because of versioning of your back end and your mobile apps. You know when people go to your website, they always get the latest, but people may be on older versions of your mobile app and you need to worry about sort of handling those updates there. So the cool part here is I could create another Azure function that's called Twitter, get tweets version two, right? And then that could return something else for the next version of my app. And then I don't have to deploy anything of new web server. Like it's just a new end point that my mobile app could hit if I needed to dramatically change the model of the application. But the cool part here is no server, no server running all the time. There are servers and no database. There's no database, there's just a blob bond desk done. Speaker 2: 36:48 Well, we really got to the crux of the problem there. What you're really happy is you're controlling the interface. You're like, I'm so tired of other people's Api Apis. I just want to have my own API. I think it's just the control Speaker 3: 37:00 control is a control. But I will say this, frank is on top of that. I can now do some other things with this. So for instance, when I'm running a query to say, hey, go update this file on disk. Maybe I could perhaps check when the last blog post was written and when he publishes a new blog post, send a push notification. Speaker 2: 37:27 Oh ooh. Yeah. Cause they have all those integrations and these things. So that's an advanced feature. I just want to um, ask you one question more about your code here. One, one, nice input to these functions. You can have an eye logger which gives you I guess a logger. We all need a logger and you're doing your, you're doing your logging very diligently. Very nice question. Do you have debugger support at all? Can you f five this in visual studio or do, are you relying actually on print f basically debugging. Speaker 3: 38:02 So good question. I mean you can run this locally. So I just ran everything locally first just to validate it and okay, what I did is inside of my source code, which I have in the show notes, you'll notice on the update Twitter update blog is that I haven't pound if debug, so I'm safe. So if debug, then instead of making an a timer trigger that just runs, I can just manually trigger it and then boom, good to go. Okay. Now I don't know how it works with, um, Speaker 2: 38:36 I, I believe what I would have to do to be able to Fiv bug this is I can do it locally and you run everything locally. So if it works locally, it's the same runtime that is deployed in Azure. So, you know, it's actually gonna work. Um, they, but quick question, how does the blob storage work when you run locally? It runs in the blob storage emulator. Just [inaudible] actually does, it's all built in cause I always wondered about that. Um, it seemed that I knew there were always, what am I saying? Like some get hub repose of Blom emulators. But is that all built into visual studio or not? All built in. So I did. I literally had to do nothing. And at least on windows, I don't know on Matt. Yeah. Yeah. I know the tools exist on Mac because they're just.net core tools. Speaker 2: 39:26 But I think it's a bit more of a manual process on the Mac. It may be, all I know is I did it locally, totally worked, did it. And the Nice thing with the function is that when you create the function, you create blob storage associated with that function. So when I published my Azure function, I didn't have to, I didn't have to put, set up anything on my back end. It just says, Hey, any function that's in this group is going to be communicating by default. Right. By default with the associated blob storage of the function. You could point it at other ones. Yes. But out of the box, if you don't do anything or want to configure anything, it just says, hey, Azure functions have blob storage associated with them and you can read and write to you and have a fun day. Speaker 2: 40:14 Um, I love that for sure. I love not having to create two things. I do have one question on terminology though. So when I go into the Azure portal and create a function, is that one file that can have multiple end points or is that one end point per function? Hmm. Yes. So what you're creating is sort of, I call it, I don't know the exact terminology, but when you go create a function app, I call it, it's kind of like a group of functions. So it's a group, it's many end points. It's many functions. Okay. Yes. Now and that would be a good way. So ideally you'd have one that was like Calca or I circuit. You'd have different groups for those, uh, in general. And then you would have all of your i's circuit ones in there or something like that or, or whatnot. Speaker 2: 41:06 Yeah. Mm hmm. I'm liking this, you know, um, the ice circuit gallery is already hosted up on the Azure, so it should be very easy to hook some functions into it. I think I'm running my own Api right now and that's kind of terrible. It'd be easier to just do it this way. So I'm excited to try that out too. It's super duper Nice. Yeah, I'm really in love with it. And I was already building the apps inside of Azure Dev ops and on my stream I set up and I set up the Azure functions. Every time Speaker 3: 41:33 I publish the code it redeploys the Azure function off to the back end automatically for me too. So it's all set up in Azure Dev ops. When I build the APP, you've pushed a master, it will update the Azure function, it will update the mobile apps, we'll go to APP center, it'll do all the things. And that was a fun experiment to it. It took me a little bit longer than I thought it would, but it was pretty easy. Speaker 2: 41:56 It was pretty easy. Yeah. What's there? Just the step built into the Dev ops stuff or did you have to write a custom step? Speaker 3: 42:03 There was a, there was prebuilt continuous integration and a prebuilt, um, a prebuilt the delivery as well. But I had a hard time because you have to specify file pass a little bit different. And it took me a little bit to debug that, but I got to work so it wasn't too bad. It was like, it was like, oh, I can't find this file would follow. You're looking for, you're looking in the wrong place template. Why'd you do that? Because what it expects is that you have your cs Proj in your route. It's kind of what it's expecting. Where, where mine is in slash source slash Hanselman dot functions and then I had to add those on and then it worked out properly. So yeah, Speaker 2: 42:48 kind of funny. Just the normal cis stuff. The reason every first, see I built this rent. Yeah, that's true. Yeah. Sounds normal. Ah, I liked this a lot. I'm, once again, you do my work for me. So now I'm all set. I'm all set to write my own function. I'm trying to think if I have any more questions, like what hurdles, what I run over, but it sounded pretty easy. I'm just gonna hit the API, download some currencies, dumped them to a blob storage. I mean, I might just copy your code verbatim, do it, and change a few paths. It's funny that we're doing essentially the same thing. I think Speaker 3: 43:24 model of what I showed for bits and pieces of apps or like what you're doing there. When you need to be rate limited, it's going to save you so much money, you're not going to hit your rate. And I was just testing the mobile APP and my refresh, it's like so fast because you're in control of the data, you're in control of the format, you know what I mean? So I couldn't recommend it enough and hopefully people can take a look at the, I'll put a link to the video that I'll publish and then also, um, uh, to, to the source code to and, and hope that people take a look at x is pretty cool. I'm pretty sure Speaker 2: 43:56 I'm proud of myself now we just have to write a library so you can do all of that in one line of code. I'm just trying to generate those functions Speaker 3: 44:04 pretty a pretty awesome. All right. Well frankly I think that's going to do it. I am so hungry because it's almost seven o'clock. I'm so hungry and it's almost the weekend. But Frank, I can not wait to talk to you about dub dub DC. It's going to be ridiculous. Speaker 2: 44:20 The beginning of the Beta summer where we find out how much money we're going to spend in the fall and how much work we have to do over the summer. Can't wait James. All the money. I'm ready. All right buddy. Speaker 3: 44:32 Well have a great weekend. Thanks everyone for tuning in and let us know how you're using Azure functions are using lambda or anything stopped summize rap. I'd be interested in, let us know. You can find us everywhere on the Internet. Go to merge conflict@afamortweetedusatmergeconflictfmorjoinourpatrionpatrion.com slash merge conflict FM or do whatever. Just go to the website. There's a buttons on there, you click the things, you do the things well, whatever. Uh, I did send out all the stickers to our patrion listeners, so thanks for being supporters. We super duper appreciate it. I think it's going to do it for this week. So merge conflicts. And until next time, I'm James Montse Mac now Speaker 1: 45:05 and I'm frank [inaudible]. Thanks for listening.