Creating and testing a simple Azure Managed Application in the developer's Azure subscription

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello in this video we're going to look at creating and testing simple azure managed application in a developer's azure subscription and in subsequent videos we'll get into more complicated things we just wanted to get this one out of the way first so we'll not go into the details of what a managed application is the assumption is that you already know but if you take a look at the documentation just as a reminder there is going to be a managed resource group to which as a publisher and an isv we will have full access and the customer the consumer whose subscription this resource group is located in will have some limited access that we can provide to them great so how do we begin inside of the documentation there is a lot of examples and samples that are available so for example there is a repo with managed application samples there is also a description of how to create ui how to test the ui and what are different components what i like to do is that you like to use visual studio code for building uh arm templates and for for all kinds of things but in writing code but specifically for managed applications also super convenient and what i also recommend highly is installing a an extension called as a resource manager is this extension right here and you can find it online installing that so that we can build the templates in easier way so if you look online azure resource manager tools it's super convenient okay so let's take a look so i pre-created a few little components the minimum set of things we will need in the application and let's go over what's inside of this super simple application so main one is the template itself this is what will deploy the resources inside of that managed resource group so we're going to take a couple parameters a location for the resources is required and the name will use the name to construct a storage account name by appending some uniqueness to it and a v-net name then we'll give some address spaces for v-net we'll create the v-net and just to show you how convenient the plug-in is you can see it gives me intellisense and it gives me versions for known for known resource types based on the schema here and you can see it's running a language servers there it knows that it's an arm template so very very convenient for that in a storage account with the name no outputs from this template great so this is going to be the template if we just deploy this template using regular azure portal and cli we will get the this created in the regular resource group but we want to try to do it pretend this is a managed application that does something okay great how do we get those parameters fed into the template though right so we need to define what's called the create ui definition and it's basically something that is adjacent again like the template itself where we have different screens basic steps and outputs will not go into the details of each step here i'll show you in the docs where to see it we'll have a text box with a name name restricting the parameter to a certain type and the output will be called name output and we'll take this name from the basics blade and pass it through that's the second file we need for our managed application minimum and the third file is the view definition this will control what we see on the right side of the screen when a managed application is deployed so let's take a quick look at those those concepts view definition you can see more about it here in the docs how to create portal interface you can learn much more about it here and it gets pretty complex in terms of what you can do it's very easy to do it though and to test the portal ui there is a great tool inside of it called create ui definition sandbox so if we open up this ui let's just copy this link and open it up inside of my subscription once it opens up let's clean up whatever is here and put our own code there right so the create ui definition code and just get an idea of how that ui definition looks like in the portal okay and let's do a preview and you can see it will ask for a region and a name and this is that name parameter that we had we can put some values here and we can put an example resource group here okay and we can say create and then we can say create and this is basically the way to test how your ui looks so this is a great testbed for testing the ui testing the template itself you just deployed okay so that that is as simple as uh deploying it great let's go on into the next step so we got our minimum template defined great we need to do one more thing very important when we're going to be publishing templates in for azure marketplace there will be some checking that happens uh on the azure marketplace side and one of the checks that it will run is this type of a tool called arm testing toolkit so you should go download this tool install it into a directory and your machine and then we should run this tool against our own templates before we submit it so that later we don't get a decline from the marketplace saying hey your template does not comply with the best practices there are many best practices to follow so again we need to test the application using that tool i already downloaded it basically clone the repo and put it right here and we can run this command so i'm on windows but there are commands for linux and windows i'm inside of where my code is and i'm going to run the test uh against my code okay so let's see what it's gonna do it's a powershell based testing tool that's testing my files against best practices so green things are great red things are not good so it says location should be in the outputs okay so why why does it say that is well because location is always needed to be provided and should be part of outputs let's take a look at that an output must be present in the template parameter so we have a name output called name output does not exist in the template and the template that we called name does not exist in the output so where is it going to come from so let's go quickly fix these issues so first we're going to fix this name to be named so it matches the name of the parameter and it will fix the two errors out of the three let's see and we have one error will be location missing right and we'll add that just wanted to show you uh that this is the best practice always do these tests before you try the template location should be in the outputs great so what does that mean well let's just go and using this special syntax our parameter is called location and this is called location as a function in the ui definitions this is documented way to pass the location awesome so now we're going to have all green uh on our template so it's pretty good to submit so what's next next is we will want to because we're going to be testing in in our own subscription we will need a couple of things so what we will need is we will need to zip up our code create ui definition main template and view definition and create a zip file so i just have this command for my windows box windows 10 it created my zip file including creator definition and template redefinition then i have an ac copy tool installed this is just a command line tool to copy stuff to storage and i'm going to copy this zip file into a storage account using a shared access signature for example so well where do i get this url because that's a convenient way for testing i usually use the microsoft storage explorer this is my folder let's create an access signature here with write permissions write and read so read create right let's give it a very long lived access signature and create it this is going to be our url into which we're going to upload this file so i'm just going to post paste it here but this url is just a folder we need to put here that we are uploading a zip file and let's take a look if this works great so it seems like it uploads so it's very convenient to iterate i don't need to use this tool to drag and drop i just zip and upload great what do we do next next we need to define the resource group where we're going to store the definition of this managed app so in my subscription i'm already logged in i'm just going to create a resource group in each region called av ama just for that definition okay so let's run this command this does nothing but create a resource group awesome and the resource group is created right here in the subscription it will appear here in a second okay and then let's create ourselves an upload this managed app definition and what manage that definition we'll do is we'll give it the name we'll give it a location we'll put it in the resource group we create it we'll give it the name we'll give it authorization so we'll hear we'll need to put principal id of the azure active directory group or user and this is corresponding to an owner permission you can google this and see and this will be the url of our uploaded file so let's do that so we'll take this url of where the zip file is it will use the zip file to create and we just need to fill this thing with a name of the group so i'm just going to go i have a little group defined or a user let's just pick a user it doesn't matter for our purposes we'll just make it myself so let's grab the object id and let's see if this command works for us okay let's see so the command finished running okay it seems it created successfully let's go and take a look we go to resource groups that's the resource group where we put the definition and we see our definition is here it's called the service catalog managed application because it's in the same subscription the developer subscription where we're at and we can see it's right here and we can deploy from definition let's give it the test and this is basically uh it should show us our ui let's go through this couple steps great it says which subscription you want to put it which resource group let's just keep it in the same let's specify a different region for it for fun let's give this a name hello world the application name will be energy manage application hello world and without dashes and then which managed resource group name should be used we're just going to let it use the default or you know i often like to name it something manage resource group that i can see and understand later we'll see why it's convenient and we'll create a deployment so the deployment finished it took a little bit i had the video post while it was going it created the managed application notice azure managed application this is hello world managed application for demo purposes this is that view definition that we created supports markdown that's awesome we can see our parameters there's going to be that name parameter that we gave it okay we didn't specify any outputs because we kept it super simple we did not assign a managed identity to this application but we can later we'll talk about that in different videos so that's one thing and let's take a look at the resource group just for a second we have the ama and this is where our hello world managed application lives and if we see the managed resource group is called ama hello world mrg this is where we will find our v-net and our storage account because it is in my own subscription i obviously have full access to this and i can show you why if i go here and say give me access keys i will be able to see even though this is a post request to list keys because it is in my own subscription in the next video we'll look into how to publish this into a marketplace the exact same one and then see it from a different subscription and different tenant where we will not be able to do some things from one side but we can do from the other and right here under deployments you can see the actual deployment of our main template right these are the resources from my main template that we created the storage account and resource group so that's it for this video in the next video we're going to take the mazip file and we're going to publish it into marketplace and then try deploying it across tenants and see how that behaves thank you for watching
Info
Channel: AV2Krandom
Views: 1,332
Rating: 5 out of 5
Keywords: azure, azure managed application, azure marketplace, azure resource manager
Id: eCGFmUirLGU
Channel Id: undefined
Length: 14min 8sec (848 seconds)
Published: Tue Sep 15 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.