From Zero to Azure with Python, Docker containers, and Visual Studio Code
This is a modal window.
The media could not be loaded, either because the server or network failed or because the format is not supported.
Formal Metadata
Title |
| |
Title of Series | ||
Number of Parts | 132 | |
Author | ||
License | CC Attribution - NonCommercial - ShareAlike 3.0 Unported: You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal and non-commercial purpose as long as the work is attributed to the author in the manner specified by the author or licensor and the work or content is shared also in adapted form only under the conditions of this | |
Identifiers | 10.5446/44973 (DOI) | |
Publisher | ||
Release Date | ||
Language |
Content Metadata
Subject Area | ||
Genre | ||
Abstract |
|
00:00
Taylor seriesComputer programCodeLocal ringDatabaseMobile appSoftware developerPower (physics)Service (economics)Data storage deviceMachine learningStapeldateiVisual systemExtension (kinesiology)FreewareSource codeComputing platformView (database)Gastropod shellWindowComputer fileTask (computing)Price indexComputer fileType theoryCartesian coordinate systemExtension (kinesiology)RoutingWeb 2.0System callObject (grammar)Home pageSubject indexingWeb applicationOpen sourceWeb serviceMobile appLaptopStapeldateiCASE <Informatik>Clique-widthCross-platformText editorVisualization (computer graphics)Wave packetService (economics)AudiovisualisierungAddress spaceCodePay televisionDatabaseFreeware3 (number)Virtual machineKey (cryptography)Computer programmingServer (computing)Variable (mathematics)Demo (music)Template (C++)VolumenvisualisierungProduct (business)Right angleData managementBoilerplate (text)Set (mathematics)TouchscreenFunctional (mathematics)INTEGRALMachine learningLocal ringSoftware developerKeyboard shortcutPoint (geometry)WindowNormal (geometry)MathematicsSource code
06:18
Service (economics)Visual systemCodeWindowComputer fileTask (computing)WritingMathematicsComputer-generated imageryDirectory serviceInstallation artExtension (kinesiology)Mobile appBookmark (World Wide Web)Graphical user interfaceView (database)Boom (sailing)Frame problemLoginTranslation memoryTaylor seriesSign (mathematics)Web 2.0Server (computing)Local ringScripting languageExtension (kinesiology)Multiplication signComputer fileIntegrated development environmentMobile appCartesian coordinate systemVirtual machineMereologyRun time (program lifecycle phase)Parameter (computer programming)CodeMedical imagingBuildingFormal languageTemplate (C++)Different (Kate Ryan album)Web applicationBoilerplate (text)Product (business)Goodness of fitType theoryComputing platformAddress spacePay televisionDefault (computer science)Shift operatorWindowGame controllerWebsiteQuicksortInternetworkingDampingLoginService (economics)Right angleMathematicsWindows RegistrySource code
12:37
Computer fileWindowView (database)Bookmark (World Wide Web)Simultaneous localization and mappingMetropolitan area networkData storage deviceComputerLoginDuality (mathematics)Task (computing)Group actionMedical imagingWindows RegistrySoftware developerSet (mathematics)Point (geometry)Sign (mathematics)Selectivity (electronic)LoginOpen setMaxima and minimaPasswordUniform resource locatorComputer fileGame controllerDefault (computer science)Revision controlNumberCodeKey (cryptography)Virtual machineSource code
16:09
WindowComputer fileBookmark (World Wide Web)LoginVisual systemCodeView (database)Task (computing)Duality (mathematics)CAN busPlanningSet (mathematics)Group actionMobile appWebsiteService (economics)Selectivity (electronic)Medical imagingWeb browserLevel (video gaming)Windows RegistryDemo (music)Revision controlWindowSystem callNumberCodeLoginUniform resource locatorWeb applicationFunction (mathematics)Multitier architectureSource code
18:26
View (database)Computer fileTask (computing)WindowHaar measureContext awarenessTaylor seriesMobile appWeb 2.0WebsiteWeb applicationPlanningService (economics)Different (Kate Ryan album)Cartesian coordinate systemSet (mathematics)Variable (mathematics)Integrated development environmentExtension (kinesiology)Source code
19:23
WindowView (database)Bookmark (World Wide Web)Computer fileComputer virusLoginSign (mathematics)Web browserCodeWindows RegistryLocal GroupComputer-generated imageryBuildingData typeWebsiteWeb 2.0DemosceneMathematical analysisCloningEwe languageLibrary (computing)outputMetropolitan area networkArchaeological field surveyCellular automatonCross-site scriptingLoginFormal languageFunction (mathematics)Cellular automatonCloningString (computer science)Total S.A.Demo (music)Buffer overflowMultiplication signConnected spaceArchaeological field surveyDifferent (Kate Ryan album)Configuration spaceLaptopStack (abstract data type)InformationDivisorData storage deviceDatabaseMereologyType theorySoftwareMathematical analysisDefault (computer science)View (database)CodePoint (geometry)Uniform resource locatorWeb applicationVirtual LANService (economics)VirtualizationCountingWindows RegistryQuicksortGroup actionMobile appStructural loadWeb browserWebsiteMedical imagingWeb 2.0Library (computing)Computer animation
24:12
Computer fileTaylor seriesTask (computing)WindowDemo (music)DatabaseQuery languageGroup actionString (computer science)Connected space1 (number)CASE <Informatik>Uniform resource locatorSequelGeometrySource code
25:17
Bookmark (World Wide Web)Computer fileMountain passHaar measureTabu searchWindowView (database)Line (geometry)Inclusion mapClient (computing)Total S.A.Gastropod shellCodeTask (computing)Taylor seriesArchaeological field surveyResultantCodeMobile appDatabaseInformationQuery languageInsertion lossKey (cryptography)Different (Kate Ryan album)Cellular automatonBitClient (computing)Variable (mathematics)Integrated development environmentString (computer science)Buffer overflowConnected spaceLibrary (computing)Revision controlCASE <Informatik>
28:00
WindowMIDIUniformer RaumLink (knot theory)Bookmark (World Wide Web)CodeGastropod shellCellular automatonView (database)Computer fileTask (computing)System callDemo (music)DatabaseRevision controlMultiplication signWebsiteSet (mathematics)Local ringKey (cryptography)Source code
29:05
View (database)Bookmark (World Wide Web)WindowCodeLocal GroupString (computer science)Internet service providerMobile appInformationBlogCodeUniform resource locatorSlide ruleCartesian coordinate systemVariable (mathematics)Extension (kinesiology)BlogIntegrated development environmentLaptopMobile appSet (mathematics)Computer animation
Transcript: English(auto-generated)
00:03
All right everyone, I'm gonna go ahead and get started. Thank you all for coming to the session today. My name is Dan Taylor, I'm a program manager for our Python developer tools at Microsoft. And this is a sponsored session, so I'm gonna be going through how you can deploy a Python application to Azure in a Docker container
00:22
using Visual Studio code. So together with Azure and Visual Studio code, you get a really productive developer experience. And I'm basically gonna show how we start with just these prerequisites here on the screen. If you have an Azure subscription, Visual Studio code and Git command line tools and Docker,
00:40
kinda how you can deploy an app starting from basically a command line. And so the steps we're gonna run through today, we're gonna create an application and run it in a local Docker container running on this local machine. Then we're gonna deploy this to Azure web apps for containers using VS code. And then we're gonna add some data to a Cosmos DB database using our Azure notebooks.
01:04
And then we're gonna update the code and redeploy it. So just a quick summary of some of the key services in Azure that you might be thinking of if you're a Python developer. We've got web app hosting and app service and Azure Kubernetes. You can, we'll be using Azure notebooks, but there's also things like Azure Machine Learning
01:21
and Batch AI for doing training of ML. And then we've got various data services like hosted Redis and Azure database for Postgres. And then we've got Cosmos DB, which we'll be going through today. And then finally, we'll be using Visual Studio code, which is Microsoft's free cross platform and open source editor.
01:40
It's very lightweight and fast and it's got a very rich extension ecosystem. And the extensions that we'll be using today are the Python extension, which is actually what my team builds at Microsoft, the Docker extension, and then some of the Azure extensions that make it really easy to package up and deploy this application. So let's go ahead, dive right in
02:01
and get started from zero. All right, so I've got a command line here. So Visual Studio code is a very lightweight editor. As I mentioned, it's meant to work with a command line plus editor. So I usually start out from the command line. And the first thing I do is just make a new folder and we'll make a new folder called zero to Azure.
02:22
I'm gonna change CD into that folder, zero to Azure. And then from here, I'm gonna type code dot, right? So one of the things, if you install Visual Studio code on Windows, it automatically puts VS code on the path. On Mac or Linux, there's a simple command that you can run to put VS code on the path.
02:41
And that just makes it nice and easy for you to type code dot and then it opens up in the folder and then I can start working with Visual Studio code in the folder. Alternatively, you can come in here and click open folder to open up that folder. So the first thing I wanna do is define my entry point for my application. So I'm gonna click this new file button.
03:01
When I click that, it lets me name the file and I'm gonna put my file into a folder called app and I'm gonna name it main.py. So what's really cool about this, if I just hit enter here, it's gonna create a folder called app and put a Python file in that folder. So really neat little shortcut trick there.
03:22
Can everyone see okay on the screen? Great. The first thing I'm gonna do is go to write a basic Flask application. How many people here are familiar with Flask as a web service? Great, looks like 60% or so of the room. I'm gonna use a little snippet that I've written, Flask app tab
03:40
that I've just customized my user snippets here in VS code so you don't have to watch me type this out. But this command has to save. This here, just the most basic Flask application you can write, we import the Flask object, we define our app, we define a homepage route there, we render a template index.html
04:01
and then this little piece of code here, if you run this main.py file directly, it will run the web server. Alternatively, web servers typically grab this app variable and then use that to run the host, which is how we're gonna run it in the Docker container. Okay, so now we need to add this index.html file that I have here.
04:20
So I'll create another file here and I'll use that same trick where I'll put templates slash index.html. That's where this render template function expects it to be and I'll use another cool trick in VS code. Here we have integration with Emmet. So I can type exclamation mark and press enter and that'll give me some boilerplate HTML code
04:42
which does some nice things like sets the device width and the scaling so that it'll render nice on a mobile application. So we'll call this hello-euro Python and then we're gonna say, you know, hello Flask plus Docker plus euro Python plus,
05:01
anyway, anyone got Edinburgh? What was that? Kiti. Plus kitty. And then all the things. Okay, great. So this is our application here, very fancy. This is what we're gonna go ahead and deploy to Azure. So I mentioned this is with Docker. I could go ahead and just right click
05:21
and run this file locally but I'm actually gonna run it inside of a Docker container. So what do I need to do? I need to add some Docker files to my workspace here. So, so far I actually haven't installed any extensions yet. This is just with vanilla VS code. So let me go ahead and install all the extensions I need. From here, actually, I've got these all saved offline
05:44
in case the Wi-Fi drops out on me. I've actually got Wi-Fi in my pocket because this is a very connected demo. So the first thing I'm gonna do is search for the Python extension. Normally you'd install it. For me, I just need to enable it. So we'll enable that Python extension.
06:02
We're gonna turn on the Docker extension as well. I'll come in here and click enable on that. And then as I mentioned, we've got some Azure extensions that we want to turn on. So we'll add the Azure app service extension. So we're deploying to Azure web apps,
06:20
which is part of app service. And this is gonna turn on our Azure account extension. And then later in the talk, I'll need a Cosmos DB. So I'm gonna turn on the Cosmos DB extension. Great. So let's reload VS code. So I just clicked that reload button. Every time you install an extension, you need to reload VS code so that it can start up
06:40
with all the extensions turned on and those things. Great. Okay, so now that I've installed particularly the Docker extension, I can use command shift P or control shift P if you're on Windows to bring up this command palette. And one of the things that the Docker extension does is it adds a bunch of Docker commands to this command palette.
07:01
The one that I'm going to use is the add Docker files to workspace command. So when I run that command, that was at the top there, it's got some templates for different languages. One of those languages being Python. So if I select the Python application platform, it will have some boilerplate stuff there and it's asking me which port my app listens on.
07:21
It listens on port 8000. So that's important. Okay, so this adds some Docker files here. I'm gonna go in and actually customize these Docker files. They don't know anything about Flask or anything like that just yet. So if you're not familiar with Docker, it's composed of various layers, right?
07:41
The first thing you define is what is the base image that you want to depend upon and then you just add the little pieces of code that your application depends on. So one of the neat things, I'm gonna use a Docker image base that's publicly published on Docker Hub. And one of the cool things about this Docker extension
08:02
is it actually has autocomplete for the base images so that as I type, I'm actually gonna use this one by this member of the community, user Tiangolo, that's created a really good Docker image for hosting Flask applications. So I'm gonna use this uwhisgee-nginx-flask.
08:21
This puts Flask behind a production web server so that it's nice and fast. And then as I type out my tags here, it gives me autocomplete for the tags. So I want this to run in Python 3.6 using Alpine Linux because Alpine Linux is very small, makes the Docker image much smaller
08:40
than a full Ubuntu or Debian image. This just makes everything faster as you're deploying and running your application. So a couple other quick customizations that I want to make to this file. It's exposing this port on this Docker container so when it runs, you can connect into port 8000 but I also am gonna set an environment variable listen port
09:02
which basically tells the base image to start the Flask application up on port 8000 so those things are aligned. And then I'm going to make one other customization here. I'm going to add, I want to add this app folder into the app folder of the Docker container and then I'm just gonna comment out these commands
09:23
because this would install additional packages but the container already has Flask built into it and has a startup script so I don't need these, right? So if I look at the Docker compose file here, this has some like local build time, run time parameters here so it tells the tools on my local machine for the most part what to do.
09:43
It has the image name that I want to run this at and then it has the port to map this to. So when I run this locally, it'll be available on port 8000. So I've set up those containers, those files to have what I need. I'm just going to run compose up which is a command added by the Docker extension.
10:04
So if I run compose up, it's going to, that was pretty quick, it'll create a Docker image, building that Docker file. It actually runs, it starts up the Docker container running on port 8000 locally and if I go into my Docker tab over here, I can see that it's actually started up a Docker container
10:24
here called zero to Azure and I can actually manage these containers, I can start, stop, remove and one of the other things is that I can show logs. So if I right click and show logs, I can actually see the log of the running NGINX web server inside of this container here. I can see that it started up,
10:41
it ran a bunch of commands and then of course I can also run, I can also connect to port 8000 locally and there we go, we've got hello all the things including the kiddies. Cool. Right, so we just created our app from scratch and ran it in a local Docker container.
11:00
So quick review, we made a folder, we launched VS code with code dot, we installed the Azure and Python and Docker extensions, we created a hello world flask app using some snippets that are available, we added the Docker files and we made some changes to the base image including setting, using one of the images from Docker hub
11:20
and changing the listen port and just copying the right files over. And then we used compose up to build and run the container locally, showed the logs and browsed it to it on local host. All right, so the next thing that we wanna do is take this container and shove it up into Azure.
11:44
Right, we wanna host this as a web application that the public internet can see because this is the best website in the world. All right, so let me just minimize this, that's for later in the talk. So the first thing I'm going to do
12:02
is go to the Azure portal and create an Azure container registry. So when you publish a Docker container it has to live in a registry somewhere and you can publish it to Docker hub, that's sort of the default container registry. You can also create an Azure container registry
12:24
for hosting that Docker image, so that's what I'm going to do. So I went to portal.azure.com and I'm going to sign into the Azure portal. This is where the Azure subscription comes in. You can get a free subscription, you can get $200 in free credits if you wanna just play with Azure
12:40
and try out all these steps. So when you come into the portal, I've got some resources here created already, but the first thing I wanna do is create a resource and for that I want them to create a container registry. So I'll select that, there we go.
13:01
So here's the container registry, I'll select create. It's gonna put this into, so this is gonna create a registry, I'll just call it my new registry and this will create a registry that's available at azurecr.io and I get to create a new resource group.
13:22
So a resource group is basically a set of folders for all your Azure resources. So I'll just say my new resource group. We'll put it in North Europe because I think that's pretty close to where we are. And then I'll pick the basic SKU because that's the cheapest and I'm just a developer playing with things.
13:41
So all these things you can do with the free credits that you get with the Azure trial. So I will select create here and at this point just to minimize potential, again, Wi-Fi gotchas, I'm gonna switch over to a zero to Azure resource group
14:03
that I have that already has a container registry created and it's called epregistry. So I'm gonna go into the access keys and copy the password here so that I can log into this registry with VS code.
14:20
So let's hit control C here, stop this container. So the first thing I'm gonna log into that registry from the command line. So docker login epregistry.azurecr.io. The default username works and then press command V to paste that password
14:42
that I just copied with the portal. And then that's gonna allow me to push this container image over to Azure. So if I come back to this file here, I need to change the image name so that it's prefixed with the location where this container is gonna be pushed. So I will prefix it with,
15:03
that's the registry I wanna push this to and we'll throw a version number tag on it just for, it's just a good practice. So now if I go and run that compose up command, it'll rebuild this container. I'll select that docker compose file.
15:22
So it'll rebuild this container and then if I go and see the images that I have on my local machine, there's the container image that we just built. I can right click this and say push. So if I push that container, it knows where to push it using the docker command line and because I've prefixed the image name
15:42
with the registry URI and so it's gone ahead and pushed that up to my container running in Azure. Now I can also browse my container registries that are running into Azure but now I need to sign in for this step. So if I click here to sign in,
16:02
VS Code has this really nice sign in experience where it just has this code that it copies to the clipboard and I can click copy and open and it gives me a login prompt in the browser. So I can just paste this code into that browser, hit continue and it just asks me to sign in
16:21
to confirm who I am and then that should be it and I should now be signed into Azure with VS Code. So we can see there it says Python demos at outlook.com. I'm signed into Azure with VS Code and now VS Code can see my Azure resources including the Azure registry. This is the one I just created,
16:41
this is the one that we're actually using. I can actually expand this and browse through all the containers and version numbers that are deployed. So if I had multiple versions I could see them here but this is the zero to Azure container that I just pushed and then this is the version that I just deployed. And so I can right click this
17:01
and from here I can just deploy this container directly to a new web app running in Azure. So I'll select deploy image to Azure app service. It's gonna take me through a set of questions. Here I've got a resource group, again that's a folder for all of my different Azure resources called zero to Azure.
17:20
I'll select that. We're gonna create a new app service plan. So a plan is the actual physical VM on which the container runs. You can host multiple containers running on the same plan and you only pay for the one plan. So if we, we'll call this the zero to Azure plan. Hit enter. And we'll pick again the B1, the basic pricing tier.
17:41
This actually allows us to run three containers on the same set of resources. So if you have a dev staging and prod site you can host them all on one set of resources. And then let's call this your Python app. And so this is the actual location
18:02
where the app is gonna be available. So in the output window it's creating the app service plan that I have there. And if I switch back to the portal and back to this resource group here I'll actually be able to see these resources
18:21
come in as they're being created by VS code. So it says the plan's been created. So if I refresh, there's the host for the web app. And then it says that the web app's been created there. So there's the actual website there, EuroPython app.
18:41
Now one final thing that I need to do before this website will be available is I need to tell the app service which port my container's listening on. So that was port 8000. That's what I had used. So if I go to, I went to the Azure tab here which is added by the app service extension.
19:00
There's the EuroPython app that I just created. Here is the different application settings which are all my environment variables. So if I right click here, add a new setting, say websites, port, put 8000 in there, this container will now be available.
19:22
So now I'll browse to the website. So the first time the website gets hit it actually takes about a minute to load because it's downloading that Docker container from the Azure registry. So I thought right now I'd just take any quick questions. I have time for one question if anyone is sort of lost or has anything. Yes sir.
19:54
Yeah, so the question was can we do it in different locations and can we isolate it from the outside web?
20:01
So yes, so I deployed this one to Northern Europe. We have locations all around the world. Actually there was a point where I could pick which region to deploy to. So yeah, you would just pick which region that you want it to go to. And yes, there is a way to configure things behind virtual networks and VLANs and stuff like that.
20:22
Just the default is that it's publicly exposed because that's the easiest thing to get started with. But yeah, I'd be happy to talk to you afterwards about how to get it behind a virtual network. Cool, so I said I had time for one question. There's the app now deployed, europythonapp.azurewebsite.net. You can all hit this on your phones if you feel like confirming
20:42
that we're actually live out there online. All right, so moving along. So just a quick recap. So we signed into Azure with VS code using the Azure sign in command. We posted that code into the browser to authenticate it. We created an Azure container registry so that we could actually host our Docker container.
21:00
As part of that, we created a resource group which would hold all of the other resources that we have for this web app. We then logged in using Docker login and then we built the image and we gave it a new tag and pushed it to that registry. And then finally, we right clicked, I deployed the image to Azure App Service
21:20
and then we set the website port on it to 8,000 there. Cool, so now we're gonna add some data to this website using our hosted Jupyter Notebook service, Azure Notebooks and Cosmos DB which is a globally distributed document storage database but with very configurable trade-offs
21:42
between throughput, latency and things like that. So it provides a lot of different flexibility for the schema you need so you can sort of get guaranteed performance and you can trade off performance for various other factors. Okay, so the first thing I'm going to do is,
22:03
I've got this, if you go to notebooks.azure.com, I have, again, it's a hosted Jupyter Notebook service but one of the cool things it allows you to do is make notebooks available publicly. So I've got a notebook where I've done some analysis
22:20
of some Stack Overflow surveys over the various years and so we're gonna take this data and we're actually going to put it into a database and then render a chart with our web app. I'm gonna pull down the code for the chart stuff, I'm not gonna type all that here. But, so this is a public library, you can actually clone this and then start running this code locally
22:43
and so if you do that, you should probably uncheck it just so that, you know, if you put some connection, if you should, you can clone it as a private notebook so that if you put any connection strings or anything like that in there, people won't be able to get your credentials. So I'll switch, I would click this clone button here but I'm gonna switch over to one
23:00
that I've already got cloned. How many people here are familiar with Jupyter notebooks? Great, so I don't need to tell you too much about them but for people who are new to them, basically it allows you to run interactively and you can run code cells one at a time and view the output. So I'm not gonna spend too much time on how this works but basically I've got some code in here
23:20
that downloads Stack Overflow survey data, it's one of my favorite demos to do because the data's all public, for the last eight or so years and it grabs the totals of people who have indicated they're using all the different languages. So one of the neat things here is that you can kind of view the intermediate data one cell at a time and so I kind of take you through
23:41
how I actually go through and analyze and crunch this data to get to basically this language and percent by year information. At the very end, it's all in this totals dictionary which has the years, the counts and the percents. So this dictionary is what I actually wanna push into Azure Cosmos DB.
24:01
So this is kind of where we're gonna start with this demo is pushing this data from this notebook into Cosmos. So let me switch over here to VS Code. So the first thing I'm going to do is open up this Cosmos DB tab.
24:22
You can create a new Cosmos database in here by clicking again the plus sign. Cosmos DB, one, two, three, four. So we give the database a name. We pick the API schema that we want to use. Microsoft has a DocumentDB SQL query language. We also support MongoDB. So if you want geo-distributed Mongo,
24:42
you can use this Mongo API and we have a few other ones. But we're gonna use the SQL one in this case and we put that in that same zero to Azure resource group. We'll all put it in this my new resource group and here we pick the location. So I'm gonna put this one in North Europe where the other ones are.
25:03
But I already have this your Python database here that I've created and just for expediency, I'm gonna use this because it takes about a minute to create this database. So I've got a, the first thing I'm gonna do is copy the connection string.
25:20
So I'll just run this cell that imports the Cosmos DB libraries and I'm gonna paste the connection string here into these variables. So there's the key, put the key there and there's the host name. So we'll put that in there and I've got about five minutes to get this all out the door.
25:42
All right, so run this. This defines our variables. This cell here creates a client to the document DB or to the Cosmos DB. This one creates a database. In this case, we're gonna create a database called stack overflow and then this one will create a collection.
26:03
We'll call the collection the results collection. So we're gonna create basically a place to shove our pre-computed results from these surveys and then finally, this query actually takes this totals dictionary that we had from above and inserts it as a document. And then okay, so it's inserted that into Cosmos DB and just to make sure that we have it,
26:21
I've got a query here that selects basically from that database and shows the result down here. Okay, so now I'm gonna switch over to an, now we want to actually display this information within the app so I'm gonna switch over to an app which has a little bit more code in it. So go back to the command line here
26:45
and go to zero to Azure, flask, Cosmos and again, I'll run code dot which I showed you earlier so that will just open up this version. I've got this code on GitHub. Same app with just a little bit more code
27:04
and the main difference here is that we've added an API that reads the information from Cosmos DB. So the other thing is we've got the host and the key are read from environment variables here. So what I want to do is go back to my,
27:21
well the first thing is I'm just gonna rebuild this container, compose up and then we'll go to the Azure tab and add those keys to the Cosmos DB.
27:42
There's the Euro Python app and the first one is Cosmos DB host. Sorry I did that wrong.
28:01
We'll copy that from our database and there is the key to add Cosmos DB.
28:32
So we'll set that there. Okay, so we've built our container locally. We just want to repush. So if we want to update code and redeploy
28:40
all we need to do is push a new version of the container and that will just only push the delta layers that we've added and this time it actually should load faster. So I'll just give it a quick restart to make sure it picks up the latest container and then I will browse to that site.
29:09
I just caught it in the middle of the restart there. So with any luck crossing my fingers we'll see a nice chart here.
29:22
There we go. We pulled data from Cosmos DB and deployed it to the app. You weren't expecting that to work, were you? Thank you. So just a quick recap and then we'll wrap up here. We created the Cosmos DB account from within the Azure extension.
29:42
We ran code in our Jupyter notebook to push that document into Cosmos DB and then we added some environment variables to our application settings, rebuilt the container, pushed and restarted. Thanks for coming to the talk. That's everything. The code is available including slides and everything on this GitHub URL. If you want to know more about anything we're doing
30:02
at Microsoft with Python aka.ms slash Python blog and I'm available here if you have more questions. Thank you.