Skip to content
PodSubs
ShowsPeopleGuestsJobsNewsEvents
More
BlogPodCred
Menu
ShowsPeopleGuestsJobsNewsEventsBlogPodCredNetworksSign in
Join nowSign in
  • Shows
  • People
  • Jobs
  • News
  • More
    • Guests
    • Events
    • Blog
    • PodCred
    • Networks
    Join nowSign in

CRM Audio

CRM Audio artwork

Hide your dirty laundry on the server-side

Jan 22, 202628 minAudio
ShareXLinkedInFacebookWhatsAppEmail

15 years too late but it's finally here: server-side logic in Power Pages. What does it change in practice? Unlike Azure Functions, it's just another Power Pages asset that can be added to Power Platform ALM. Perfect for anything that is logic-lite/secret-heavy. Think payments and integrations that need secrets. Server-side logic avoids awkward workarounds using plugins, Power Automate, etc. just to keep keys safe. Re-use your Javascript skills though it's not lift-n-shift from the client-side exercise. Just couple new objects to learn: HTTP client for external calls and a Dataverse object for CRUD operations. There are plenty of scenarios where client-side Web API is better, like interaction with external services requiring callbacks, for example. As Nick succulently summed it up: It doesn't make anything possible we couldn't do before. It just makes doing a lot of things we did do before a lot easier. References Power Pages server logic overview (preview) | Microsoft Learn Get in touch voice@crm.audio Nick Hayduk @Engineered_Code George Doubinski @georgedude

Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.

Transcript

From the show. Tap a time to play from there.

George: Good afternoon. Nick: Hey, good evening, George. How's it going? George: Good good. Sunshine Nick: sunshine. It's, just, it was just a few weeks ago we were able to see each other in person in Vegas. So it's George: Was too much sunshine of all the too many smart people in the room and too much sunshine. of all the, from all the bright minds. Did you enjoy Vegas? Nick: Do you know what I did, but then I very much didn't. It was the same time as the World Series and I'm a massive Toronto Blue Jays fan and the World Series did not work out for us this year.

George: Is that the one neverending game that I don't follow it. I was boarding the flight. People were watching the game. I was, Offboarding. The flight people were watching the game and then went to a pub and people still watching the game and the like, never ending game. Was that the one Nick: I didn't have a chance to tell you the story. I was actually at that game. George: Oh, like physically, Nick: I was physically at that George: I. Nick: for the first half, and then I had to leave because my flight to Vegas was leaving, and I ended up in Vegas by the time the game ended.

I was at the game had to leave, got on a flight from LA to Vegas and was in Vegas before the game ended. George: So I guess you guys will never complain about, cricket test matches ever again, right? Nick: Fi five days is a little different. This was only six and a half hours, five days. That's a little different. George: Yeah, but it's five days of beer and taking it slow. hope it works out next year. And, uh, yeah, Vegas is good. Like professional is good.

Vegas is exhausting as a, as a place to be. But I have to say that, uh, Vegas on Halloween, it's uh, something. Crazy special. That was something I haven't seen before with my own eyes. Once a year is enough though. Nick: I agree, but I am looking forward to next year already. George: Let's talk about what really matters. And yeah, let's set aside whatever was vibe coded at Ignite. That's a separate conversation altogether what it means for power Pages.

But just curious do you see some organizations. Telling you that, hey, look no longer need power pages, we can vibe, code our stuff Nick: Just the marketing folks at Microsoft. That's the only place I hear that from. George: Okay. But I don't see it affected short term in any shape or form because power Pages is externally facing, which vibe coded apps are not, not yet anyway. Security folks will have a field day with those anyway the reason

why we're here is something that you seem to be very excited about. Nick: This is the biggest news possibly ever since the acquisition, but certainly since the web API was introduced. I think this is other than an API to refresh the cache, which is always number one on everyone's list. The fact that Microsoft recently announced Server Side Logic, so the ability to write server side code right into our Power Pages applications that's what's

got me all hot and bothered these days. George: tell us what does it look like? Hold on. I'm repositioning my cup so I can do some brand management. Nick: So what does it look like? It looks like we can write JavaScript. That runs on the server instead of the browser. Which for those kind of security conscious folks knows, they know that means that you can't, the people in their browsers can't be messing with your JavaScript. They can't see what that JavaScript code is. So you can use it to do all sorts of things like interacting with. Third party APIs and have client secrets and all that sort of goodness in there.

And you can ensure that the logic is running exactly as you intended it not being messed with in people's browsers., George: That, that kind of makes sense. And I assume it runs some kind of. Node flavor. Nick: I would assume. Yep, that's, that would be, if it's not, I think they've spent way too much time with something else. 'cause that seems like the, a pretty logical choice. George: What do you think about the choice of JavaScript versus C# or CSX, you can run as a single source and with do net 10, you can run single file.

Nick: I think it makes sense. I think that's a language. That's when people ask me who are outside of the, the pro dev space when they're like, Hey what language should you learn? That, that's pretty high at the top of the list. Rather than, you're gonna write JavaScript and other parts of your Power Pages. So rather than introducing a different language, why not just go all in with the JavaScript? George: Let me play devil's advocate here, but the problem is that. People think and I've spoken to a few guys and people think that, oh, we just lift the client script and move it to the server site and it all works well.

It doesn't because you don't have client site constructs like fetch or XMLHTTP request. You don't have those. You have special objects that allow you to deal with the, with the external endpoints and submit requests, but they are different from, your client API. that's kind of transition is not gonna be straightforward. It's not lift and shift you'd have to write the code again, skills wise, yeah, it's JavaScript. Nick: I can't imagine there's too many places out there that.

Where we're even talking about lifting and shifting existing code. This should be, if you're lifting and shifting you're lifting from probably C sharp or some something else that was doing it. Yeah. From that perspective, if you have a, a number of Azure functions or companion apps that have that C code in there, would it be nice just to take that and drop it in, into the server logic? Yeah, it would be good. But again, I think there'd be enough work on to, to do that, that it would probably wouldn't make sense to do it anyways. So I don't mind them starting from scratch and saying, Hey,

this is gonna be JavaScript. It's not something that that, that seems like it's gonna be a problem to me. George: Before we dive into a little bit more details, what is available to you and what is not? What do you say that we've seen a few people not objecting, but they voice in their concerns and saying, instead of introducing new way to do things, why don't expand old way to do things like, give me access to custom actions and I'd be happy. So we already have web API on the client and web API can talk to

individual pages, but it cannot sorry, individual tables, but it cannot call custom actions, am I right? Nick: Yeah, I Why we can't call custom actions in web API, I don't quite understand. It seems like that would be a simple thing to do. I don't know if there's a security side to it where, it can't really enforce table permission. I don't know. I don't know why they haven't given us. 'cause that seems like a pretty quick win to do that. But I just don't see. I still think that even if you have that, there's still lots

you would want to do with this. New server logic. So I don't see them as direct competitors complimentary, but I still not not necessarily having to I don't mind that it's specific to Power Pages. I've seen people talk about how, like, why do we have to have a new concept? But I do think that having something specific to Power Pages I don't have a problem with it. George: Where does it live? The script that you create, manage, is it new thing to manage and new thing to push through ALM hurdles?

Nick: I believe that is the case. Yeah. I believe they're storing these. I mean if you create your first kind of server logic file, it seems to exist. And you're, say you're doing that in vs code, you're essentially getting another folder in your, in your kind of folder structure there. So I, I do believe it's just another kind of table of data to to, to worry about when it comes to ALM, I do think that's, that, that is the case. George: And security wise, they're just similar to web API security. So you just have new entries enabled disabled, There are some settings

to restrict cross domain actions. If you want to this service or your function to perform, to talk only to a weather service, for example, then you can restrict the domains that it can talk to, which solves. The problem that I was going to hack through with my vnet explorations recently and discovery that webhooks do not honor any of your vnet settings. I would assume that this. Server side code in Power Pages will not honor your vnet settings either, and

it will allow you to talk to whatever unless you restrict it, which is nice that they have specific settings, at least to restrict cross domain queries. Nick: The Power Pages web server does not reside within your Azure tenant, so I can't imagine it would respect those types of things. George: What do you mean it doesn't reside? Oh, you mean it's hosted by Microsoft, so it's by definition not in your tenant. Nick: I believe that's the case. Yeah. George: Okay, so Vnet. Yeah. We'll, duly ignore Vnet.

Okay. Nick: I think not, I don't know if that I've seen any kind of documentation to con confirm this, but I believe it's running on the actual server, like the Power Pages server. I don't know that it's a, I don't know whether it's a kind of a separate, asset that they have running this stuff. But whether it's on the same servers that are running your app or whether they have something else to run it. But that's all gonna exist in the Microsoft tenant, not in yours. George: Microsoft, I hope it's Microsoft controlled te not the

actual microsoft.com tenant. You never know, but Nick: You never know. George: you never know. Nick: I. George: Okay. That's great. And to only naysayers, you say, oh, give us better constructs to manage whatever we already have. I'm saying you obviously never done payments in Power pages. Because that service site logic, single-handedly solves so many challenges that I personally came across when trying to implement payments.

In Power Pages, and I mean outside of the given constructs which also don't work all the time, and just managing the secrets and managing the callbacks and this and that, and creating sessions. And it's just a nightmare. So to me, like simple, say I've got Share price service, and I have a private key that allows me to access real time and I want to expose some of that. Licensing aside, I want to expose some of information that coming

from that service to my users to authenticated users of my side. go and try to implement that, You're either exposing your secret inside your client's side code. Or you are off on a limb trying to implement it using plugin. So you faking the table. Then you put in plugin with the hooks and retrieve multiple, and you create maybe virtual table. But even if it's not virtual, you faking the service and it's just becomes a just perpetual

Nick: or you're using Power Automate now, that's another option. George: That's another option. Yeah. But here you have just line of code, Technically. Nick: This is the way to do it and yeah. Your ability to like you said the payment scenario is the obvious and it's even the video example they give you on in the blog post that announced it, like there's gonna be. To, to me, we've done our best to a avoid implementing some of these things that require just, oh, if we just had this, it would only have

been a couple lines of code, but let's figure out a different way of doing it. Or, that'll be a future phase. That never happens. There's just gonna be so many of these scenarios that were, hey, with two or three, or, 10 lines of this new server side logic. It's just, it's easy, it looks like it's pretty easy to use and it's gonna just open up so many more possibilities where we're not talking about, Hey, let's add some Azure functions. Let's add all the overhead of all these other different techniques. It's just gonna be a simple, easy way to to achieve something that, again, back in the a DX studio days was something simple to do.

And so it's, we're finally back to where we were 15 years ago. George: Yeah it was extendable, right? It was easy to do, which is first thing a Microsoft shot because it was easy to do, but easy to do things you were not supposed to do. Like about Azure functions, people say, oh, it's easy to do, let's just wire up Azure functions. Yeah, of course it's easy to wire up Azure functions, but if you don't have, if you like a small, medium business that uses dataverse for or uses some dynamics 3, 6, 5 app like sales or whatever, and you have some basic figure it out and you're

working on that and you never deployed. Azure function before, and suddenly you're facing this, the whole scenario of, oh, you need to work out which plan you use. You need to deploy this Azure function. Someone needs to maintain it. Someone needs to maintain secrets and make sure that they're updated and this and that. It's like it's adding extra layer of complexity. Whilst all you need is five lines of JavaScript to figure it out. That is Nick: I'll give you. George: to decline. Nick: Yeah, I'll give you the perfect example.

We're working on a project right now to to add a Google Wallet or Apple Wallet, like a license card to, to, so that you can click there and download a mobile card, like a, rewards card, that sort of thing. And again, it's the same thing. It's like we, you get in there and it's oh, we could use Power Automate, or we could write an Azure for. And what we're doing right now is we're writing an Azure function. And for something that is just a few lines of code, it probably doubles the amount of e overall effort. Now you have to have calls about, okay, which Azure function

pricing model are we doing? Where are we gonna store this code? And it's just, it's a, it's another architectural piece that we can now avoid. So it takes some of these scenarios that before we're probably just, yeah, that's too complicated, we're not gonna do it. And it makes that a lot easier. George: Does it compare to power automate. Nick: Specifically in the case that we're looking at right now, there are some, power automate, you can do a lot of things, but it, especially with you, you'd have to kinda resort to custom connectors to do some of the more fancier things with power automate that. I think we're gonna be able to alleviate some of those kind of extra layers.

I don't think power automate from a per performance standpoint is, super awesome in terms of calling a, George: Does it Nick: the. George: same fidelity? Because with power automate endpoint, you don't have any fidelity how you call it. You just say, I want to call this endpoint, right? This power automate flow. You just trigger it. You don't have fidelity, like in, in server site logic, you have you have get put pa do you have patch? Don't think so. No. Put patch. Yeah. Delete. So you have fidelity of API requests that you don't get

this luxury with power automate. Nick: Yeah, absolutely. That's right. Yep. George: a I hope that we gonna feel like an hour talking about it all being excited, but we seems to agree. Yeah, it's a great construct. We should, was there five years ago? But other than that, it's great. The only thing to go ahead and learn is JavaScript itself. And I'm just looking at documentation, talking about objects. This is something you need to learn to work with. There are some kind of obvious ones like you have access to the site settings and the website and the user, so which is important, like your contact who

authenticated, to your website and you have logger and you have call context. And then two, perhaps the most important ones, you've got HTTP client that allows you to talk to external services. And it's got post, put all the standard requests. So I guess it's a wrap around fetch standard way, that to request. And the other one is dataverse which allows you to.

Create retrieve multiple, your standard eye organization service, so wrapped up nicely as a JavaScript object. So all the ingredients are there. I'm curious what happens if I'm trying, if I try to bring external libraries, I guess that would be a no-no. I've not tried it yet. Nick: Yeah, I believe what I saw was not currently possible something that's being considered, but yeah, I believe that they don't, do not support external packages at this time.

George: Fair enough. Nick: Okay. George: at this time, I mean, for foreseeable future? Nick: Yeah. Yeah. George: that would be opening such a huge can of worms. Very similar to struggle that you have in CSX code in custom connectors. I wish to bring external libraries, but that's just such a huge security challenge Nick: How long did it take to get, to be able to include other libraries in a plugin like, George: took only 15 years Nick: yep. Yeah. So we'll talk to you in 2040 and look forward to announcing that.

End note. Node packages are now supported in Power Powerage Server Logic. George: But interesting I'm looking forward to people trying to take it apart and poking around and, see, does it stack up against other technologies? But certainly I'm looking forward to using it. That will be my first choice over a client side, JavaScript, primarily because. Your laundry. I don't know about your laundry, but mine is dirty As, and I don't

want to expose it to the client, especially when it's vibe coded. Nick: So do you think that you will is this kind of the end of the the web API when would you still use the web API versus, going through server logic? George: Interesting. Help me out here. I've got challenge right now. have a customer we've been using Cloudinary for some time, so they manage visual assets in Cloudinary . We need to have ability to upload in bulk. already provides some widgets that you can use.

You don't have to deal with that. So you just upload and it calls you back in JavaScript and say, I've uploaded this and that. Here's your endpoint. So it's all nice for unauthenticated requests, we'll looked, sorry, unsigned requests. We looked into signed requests where you have a little bit more control over what's going on. Then again, we don't want to expose our cloud ary keys on the clients. So it's I dunno. It's neither here nor there. And we were restricted in previous implementations. We were restricted to what we can do.

was before web API kind of appeared on scene. That's a long story. It the side goes back years and, so the question now is I want to upload when I upload those images, what I want is to create a Dataverse records for each of those images and attach it to the parent record. You have a product, and then product images d. Shapes, phones and aspects and so on. So you upload those images and you want those images, each image recorded in dataverse as a child record and then pointing to

your Cloudinary resource, right? So you upload them both and then you need to put 20 records in for each image, single record. But you need to put those 20 records. So web API is option. You just go and on the callback, you just write web API. It's quite straightforward. You've got all the data that you need, The other one would be to offload it to the server side. And this is scenario where I think Web API still takes precedence. All I need is to create a single record or multiple records, whatever

on a callback from external servers. And I've got all the data. I don't need to feed all, there is no secret to manage. All I have is a record to create. It's a one line of code. If I delegate it to a server logic, suddenly I have to deal with the, each one, calling server logic. But there is no advantage on the server side. I would do the same one line of code. Yes, I will have an external. Layer of extra security, but I don't see any benefits of

delegating it to the server logic. So I'd say that's a good scenario where client side API still makes sense. If all you need is to create or retrieve records at point in time, that works perfectly from the client side I don't see any advantage unless I'm doing some processing. Having said that, if my requirements included, Hey, look, you need to look at the uploaded image. You need to push it through cloudinary AI transformations.

You need to, aspect ratio and let cloud generator to figure out the best. Image and things like that. So there's a lot of cloud in API that you can call and deal with the uploaded image. If I wanted to include that post upload processing, probably would move to a server site and say, Hey look, if I do need to include some transformations and making sure that the best angle is selected and things like that, then yeah. So if it included five steps, extra steps.

those steps, I would need my cloud in key. Then I would definitely go with the service side. Logic. Nick: Yeah. I'm just one curious if they had, if the features had come around in the other order, if we had Server logic and then they announced, Hey, now you have web API, would we really be excited about the web API Would we just be saying, this has just given us, we, we could have done this anyway, so it's are there certain cases where it's just maybe more efficient to go directly to Web API pro? Probably. But would we really care because it's like, ah, the server logic gave us everything we needed anyways, but.

George: That's an interesting way to look at it. Yeah. If you start a new project you can mandate that say, Hey, we are not using, we are not gonna use web API, we are just using server site logic. And that's it. Quite possible. Would you be able to implement everything? That's the question. On the surface, it looks like, yes. And Nick: but yeah. George: there is no reason for you to venture on the client side. There's nothing you can do on the client side with the web API that you

can't do with the service side logic. It's an extra layer, but hey, look, that's not our compute capacity Nick: it's just I've always found enabling the web API just, that's always a little bit scary. So if you can avoid that, then. George: You still Nick: I know. George: server side logic. You need to say server logic slash enabled true, or something like that. Right? Nick: Yeah. But with the web API, you gotta enable it like for a table, right? If you can avoid enabling server side or the web API for a particular table, if you, if you don't otherwise need it, and you hide it behind that wrapper, that is the server side logic, it feels a bit safer.

George: I'm just looking at the docs and something that I think was added a little bit later because I haven't seen in the original drop interacting with Microsoft Graph and SharePoint. So that's answered the questions that you had about companion apps. And I remember even in the old days and you did presentations, multiple presentations on the topic, how to wire up SharePoint companion app, right? By wire up, it's no longer embedded piece, but more intelligent than that.

You manage the same permissions, you flow onto the smart app that operates on documents in SharePoint. But for that, you need server site logic and that's where companion apps would come in. Do you see the death of companion apps you because of service at Logic? Nick: I think I mean from we talked about the, being able to include other packages. I think that there's probably still some.

Some companion apps that are probably complicated enough that would you really want to do it with just some kind of JavaScript files living in. So I think there's probably some, still some complicated companion apps, but I know a lot of the companion apps that were done were just, it's hey, we had a secret. Like we had to write our 10 lines. Like we had no choice. That was the only way to do it. Maybe not death. But the not even retirement, but a very light workload for companion apps moving forward. I would say is what I would see. George: Yeah, lighter. So when you have a complex functionality definitely we're

talking about new deployments. If you already have companion app run perfectly well, don't touch it. Nick: Yeah. George: rewire it for the sake of Nick: Yeah. George: The next step would be take it for a spin go through some external integrations really interesting examples with graph and SharePoint that gives you some extra data that you don't have otherwise, or you need to jump through some hoops to get it even in your function. Getting graph data, it's not trivial. And it would be interesting to see how people wire it to all the Agent iq.

What, whatever Agent 3, 6, 5. People would immediately jump and try to wire some AI pieces to that. Let's see if that makes any sense. Would you use it as opposed to having a web chat? Like web chat control is notoriously difficult to wire. Like co-pilot Non-trivial to wire to power pages. like out of the box, you click and it seems to be wired. But if you wanna do it yourself, there is no set of instructions that allows you to.

Walk through and wire it the way you want it. seems to be a big gap into how easy or difficult it is to wire something trivial like a chat agent. Nick: I'm surprised that's not one of their, not one of their examples. The fact that their example is with graph and SharePoint and not something copilot related is a bit surprising. I. George: Well, um, Leaves room for a bunch of LinkedIn post about how, how exciting and game changer it is.

But this one certainly introduced a functionality personally wish was the, a long time ago. Perhaps I would consider Power Pages for projects I never considered before. of, yeah, complexity of wiring stuff for even tri functionality. And this one certainly solves this closes the gap where complexity is just not enough to justify the whole layer of, server side components, Azure functions,

services that you need to deploy. This one goes with your power pages a LM, right? If you bring Azure function in. You have another thing to deploy outside of your power platform, a LM. So here you Nick: It doesn't make anything possible we couldn't do before. It just makes doing a lot of things we did do before a lot easier, George: on that very succulent summary. Nick: succulent. George: Let's let's wrap it up. Thank you Nick: All right. I can't find a, I can't think of a better ending than succulent.

George: Okay. Thank you very much and until next uh, talk to you later. Nick: Thanks, George. Bye.

Open the transcript file

Hosts and Guests

Nobody is credited on this episode yet.

Credit the people on this episode

Be the first to rate this episode

More episodes

All episodes
  1. Hot SPA time machine in Power Pages

    Oct 19, 202633 minAudio

    AI agent wrote, compiled, and deployed a full Dataverse plugin for George in under thirty minutes with DLL, custom API, pre/post steps and all, rendering him (George, that is) obsolete. This aside, we cover the new...

    Credit the people on this episode

  2. The Very Last Release Wave

    Oct 5, 202627 minAudio

    Better late than never: we look back at what Microsoft put in the Power Pages section of the last-ever Power Platform release wave. The twice-yearly release-wave model is now being replaced by continuous updates on the...

    Credit the people on this episode

  3. jQuery or Not, Client-Side API Will Always Start with a $

    Apr 4, 202622 minAudio

    Power Pages is having a surprisingly good run. In this episode we dig into server-side logic debugging, the new client-side API, and why both feel about 15 years late yet still genuinely useful. We also look at Omar...

    Credit the people on this episode

  4. Contacts Are Users Too - Now with Dataverse Privileges

    Oct 6, 202519 minAudio

    It's one of the biggest Power Pages updates we've seen in years, and we're excited about what it means for the future. We talk about the newest Power Platform release and its biggest change - bringing Power Pages...

    Credit the people on this episode

  5. End Of The World As We Know It: Security Leaks In Power Pages

    Aug 17, 202534 minAudio

    In this episode, we take a close look at the history of security issues in Power Pages. We start with the early days - when simple misconfigurations like unchecked table permissions and enabled OData feeds led to major...

    Credit the people on this episode