{"id":94,"date":"2022-01-24T22:48:37","date_gmt":"2022-01-24T22:48:37","guid":{"rendered":"http:\/\/vargas-solar.com\/cloud-bigdata\/?page_id=94"},"modified":"2022-01-26T18:32:02","modified_gmt":"2022-01-26T18:32:02","slug":"ho-1-services-as-a-unit-of-construction","status":"publish","type":"page","link":"http:\/\/vargas-solar.com\/cloud-bigdata\/ho-1-services-as-a-unit-of-construction\/","title":{"rendered":"HO-1 Services as a unit of construction"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\"><strong>Objective<\/strong><\/h3>\n\n\n\n<p>Start getting acquainted with the use of IaaS and PaaS cloud services for building and deploying applications on the cloud.&nbsp;<\/p>\n\n\n\n<p>The hands-on exercise will be inspired&nbsp;by&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/app-service\/quickstart-python?tabs=bash&amp;pivots=python-framework-flask\" target=\"_blank\">https:\/\/docs.microsoft.com\/en-us\/azure\/app-service\/quickstart-python?tabs=bash&amp;pivots=python-framework-flask<\/a>,&nbsp;<strong>but we will add Google Collab to externalise the whole task.<\/strong><\/p>\n\n\n\n<p>The general aim is to deploy a Python web app to&nbsp;<a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/app-service\/overview#app-service-on-linux\">App Service on Linux<\/a>, Azure&#8217;s highly scalable, self-patching web hosting service (PaaS service).<\/p>\n\n\n\n<p><strong><span class=\"has-inline-color has-blue-color\">Let us make a big step into externalisation!<\/span><\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Material<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>A google account for using Google Collab<\/li><li>ngrok account&nbsp;<a href=\"https:\/\/ngrok.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/ngrok.com<\/a>&nbsp;to expose a web server to the internet.&nbsp;<strong>Do not install a<\/strong>nything in your local machine.<\/li><li>Student free trial access to Microsoft Azure<\/li><li>Code&nbsp;https:\/\/github.com\/Azure-Samples\/python-docs-hello-world<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>ToDo<\/strong><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Building your App<\/strong><\/h4>\n\n\n\n<h5 class=\"wp-block-heading\">1.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Connect to Github to retrive the hands-on:<\/h5>\n\n\n\n<p><a href=\"https:\/\/gist.github.com\/javieraespinosa\/8d9e93cff61c675d74bd862975a84d5e\">https:\/\/gist.github.com\/javieraespinosa\/8d9e93cff61c675d74bd862975a84d5e<\/a><\/p>\n\n\n\n<h5 class=\"wp-block-heading\">2.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set up your initial environment<\/h5>\n\n\n\n<ul class=\"wp-block-list\"><li>Install Azure CLI<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"908\" height=\"42\" src=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image.png\" alt=\"\" class=\"wp-image-99\" srcset=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image.png 908w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-300x14.png 300w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-768x36.png 768w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-624x29.png 624w\" sizes=\"auto, (max-width: 908px) 100vw, 908px\" \/><\/figure>\n\n\n\n<h5 class=\"wp-block-heading\">&#8211;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Instead of having Azures CLI in our local machines. It is running in some server provided by Google. Let us check the version of the CLI that we have installed there.<\/h5>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"908\" height=\"42\" src=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-1.png\" alt=\"\" class=\"wp-image-101\" srcset=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-1.png 908w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-1-300x14.png 300w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-1-768x36.png 768w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-1-624x29.png 624w\" sizes=\"auto, (max-width: 908px) 100vw, 908px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>See the resources that Google has assigned us to run our code<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"638\" height=\"140\" src=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-2.png\" alt=\"\" class=\"wp-image-103\" srcset=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-2.png 638w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-2-300x66.png 300w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-2-624x137.png 624w\" sizes=\"auto, (max-width: 638px) 100vw, 638px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>Configure Azure CLI<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"908\" height=\"300\" src=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-3.png\" alt=\"\" class=\"wp-image-105\" srcset=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-3.png 908w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-3-300x99.png 300w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-3-768x254.png 768w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-3-624x206.png 624w\" sizes=\"auto, (max-width: 908px) 100vw, 908px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>Install ngrok and validate your account (!)<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"908\" height=\"74\" src=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-4.png\" alt=\"\" class=\"wp-image-106\" srcset=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-4.png 908w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-4-300x24.png 300w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-4-768x63.png 768w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-4-624x51.png 624w\" sizes=\"auto, (max-width: 908px) 100vw, 908px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>Config ngrok with your own authtoken (see&nbsp;<a href=\"https:\/\/ngrok.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/ngrok.com<\/a>). Go to your ngrok account and copy your token:<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"908\" height=\"222\" src=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-5.png\" alt=\"\" class=\"wp-image-108\" srcset=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-5.png 908w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-5-300x73.png 300w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-5-768x188.png 768w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-5-624x153.png 624w\" sizes=\"auto, (max-width: 908px) 100vw, 908px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>Copy your token on the notebook. The first line is a Python assignment to a variable. The second is&nbsp;&nbsp;a bang operator that executes a command that configures the application ngrok. ngrok allows you to expose a web server running on your local machine to the internet.&nbsp;<strong>Which is our local machine in our externalized setting?<\/strong><\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"834\" height=\"112\" src=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-6.png\" alt=\"\" class=\"wp-image-109\" srcset=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-6.png 834w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-6-300x40.png 300w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-6-768x103.png 768w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-6-624x84.png 624w\" sizes=\"auto, (max-width: 834px) 100vw, 834px\" \/><\/figure>\n\n\n\n<h5 class=\"wp-block-heading\">3.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Clone the sample<\/h5>\n\n\n\n<p>The sample contains framework-specific code that Azure App Service recognises when starting the app. It lies in the GitHub repository provided by the Azure tutorial&nbsp;<a href=\"https:\/\/github.com\/Azure-Samples\/python-docs-hello-world\">https:\/\/github.com\/Azure-Samples\/python-docs-hello-world<\/a><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Clone the sample provided by the Azure tutorial&nbsp;<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"694\" height=\"42\" src=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-7.png\" alt=\"\" class=\"wp-image-111\" srcset=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-7.png 694w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-7-300x18.png 300w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-7-624x38.png 624w\" sizes=\"auto, (max-width: 694px) 100vw, 694px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>Install python dependencies. The first instruction is a Python line that executes an OS command where % ensures that the result is considered \u201cpersistent\u201d in the Collab server we are using. In that location we are going to install what is specified in the file requirements.txt, in this case it makes sure that it has the flask<a href=\"applewebdata:\/\/4EC9CB50-2248-4EF0-92CA-736CA152DC24#_ftn1\"><sup>[1]<\/sup><\/a>&nbsp;libraries.&nbsp;<strong>Open the file to have a look.<\/strong><\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"508\" height=\"148\" src=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-8.png\" alt=\"\" class=\"wp-image-113\" srcset=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-8.png 508w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-8-300x87.png 300w\" sizes=\"auto, (max-width: 508px) 100vw, 508px\" \/><\/figure>\n\n\n\n<p>The bang operator uses the command pip<a href=\"\/\/4EC9CB50-2248-4EF0-92CA-736CA152DC24#_ftn2\" target=\"_blank\" rel=\"noreferrer noopener\"><sup>[2]<\/sup><\/a>&nbsp;to install.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">4.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Run the sample<\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li>See the Sample file (app.py) content<\/li><li>Load and execute sample in Collab.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"568\" height=\"156\" src=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-9.png\" alt=\"\" class=\"wp-image-114\" srcset=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-9.png 568w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-9-300x82.png 300w\" sizes=\"auto, (max-width: 568px) 100vw, 568px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>Follow the ngrok URL to see the output&nbsp;<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"676\" height=\"152\" src=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-10.png\" alt=\"\" class=\"wp-image-115\" srcset=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-10.png 676w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-10-300x67.png 300w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-10-624x140.png 624w\" sizes=\"auto, (max-width: 676px) 100vw, 676px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>The app displays the message&nbsp;<strong>Hello, World!<\/strong>.<\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">5.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Deploy the sample<\/h4>\n\n\n\n<p>Deploy the code in your local folder (<em>python-docs-hello-world<\/em>) using the&nbsp;az web app up&nbsp;command.&nbsp;The command may take a few minutes to complete. While running, it provides messages about creating the resource group, the App Service plan and hosting app, configuring logging, then performing ZIP deployment. It then gives the message<strong>, &#8220;You can launch the app at http:\/\/&lt;app-name&gt;.azurewebsites.net&#8221;, which is the app&#8217;s URL on Azure.<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Define a unique&nbsp;APP_NAME. This will be part of your app URL (e.g.&nbsp;<a href=\"http:\/\/app_name.azurewebsites.net\/\">http:\/\/APP_NAME.azurewebsites.net<\/a>)<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"482\" height=\"36\" src=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-11.png\" alt=\"\" class=\"wp-image-117\" srcset=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-11.png 482w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-11-300x22.png 300w\" sizes=\"auto, (max-width: 482px) 100vw, 482px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>Deploy the sample<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"536\" height=\"38\" src=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-12.png\" alt=\"\" class=\"wp-image-118\" srcset=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-12.png 536w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-12-300x21.png 300w\" sizes=\"auto, (max-width: 536px) 100vw, 536px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">6.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Browse the app<\/h4>\n\n\n\n<p>Browse the deployed application in your web browser at the URL&nbsp;http:\/\/&lt;app-name&gt;.azurewebsites.net. It can take a minute or two for the app to start, so if you see a default app page, wait a minute and refresh the browser.<\/p>\n\n\n\n<p>The Python sample code runs a Linux container in App Service using a built-in image.<\/p>\n\n\n\n<p><span class=\"has-inline-color has-blue-color\"><strong>Congratulations!<\/strong>&nbsp;You&#8217;ve deployed your Python app to App Service.<\/span><\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>&nbsp;<\/strong><\/h4>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Managing your app<\/strong><\/h4>\n\n\n\n<h4 class=\"wp-block-heading\">1.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Redeploy Updates<\/h4>\n\n\n\n<p>This section makes a small code change and then redeploy the code to Azure. The code change includes a&nbsp;print&nbsp;statement to generate logging output (see below).<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Open&nbsp;<em>app.py<\/em>&nbsp;in an editor and update the&nbsp;hello&nbsp;function.<\/li><li>Save your changes, then redeploy the app using the&nbsp;az webapp up&nbsp;command again:<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"322\" height=\"40\" src=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-13.png\" alt=\"\" class=\"wp-image-120\" srcset=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-13.png 322w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-13-300x37.png 300w\" sizes=\"auto, (max-width: 322px) 100vw, 322px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>This command uses values that are cached locally in the&nbsp;<em>.azure\/config<\/em>&nbsp;file, including the app name, resource group, and App Service plan.<\/li><li>Once deployment is complete, switch back to the browser window open to&nbsp;<code>http:\/\/&lt;app-name&gt;.azurewebsites.net<\/code>. Refresh the page, which should display the modified message.<\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">2.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Stream Logs<\/h4>\n\n\n\n<h4 class=\"wp-block-heading\">You can access the console logs generated from inside the app and the container in which it runs. Logs include any output generated using&nbsp;<code>print<\/code>&nbsp;statements.<\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li>Run the&nbsp;<a href=\"https:\/\/docs.microsoft.com\/en-us\/cli\/azure\/webapp\/log#az_webapp_log_tail\">az webapp log tail<\/a>&nbsp;command<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"442\" height=\"44\" src=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-14.png\" alt=\"\" class=\"wp-image-121\" srcset=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-14.png 442w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-14-300x30.png 300w\" sizes=\"auto, (max-width: 442px) 100vw, 442px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>You can also include the&nbsp;&#8211;logs&nbsp;parameter with then&nbsp;az webapp up&nbsp;command to automatically open the log stream on deployment.<\/li><li>Refresh the app in the browser to generate console logs, which include messages describing HTTP requests to the app.&nbsp;If no output appears immediately, try again in 30 seconds.<\/li><li>To stop log streaming at any time, press&nbsp;<strong>Ctrl<\/strong>+<strong>C<\/strong>&nbsp;in the terminal.<\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">3.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Manage your Azure App<\/h4>\n\n\n\n<p>Go to the&nbsp;<a href=\"https:\/\/portal.azure.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Azure portal<\/a>&nbsp;to manage the app you created. Search for and select&nbsp;<strong>App Services<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"428\" height=\"406\" src=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-15.png\" alt=\"\" class=\"wp-image-123\" srcset=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-15.png 428w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-15-300x285.png 300w\" sizes=\"auto, (max-width: 428px) 100vw, 428px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>Select the name of your Azure app.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"908\" height=\"184\" src=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-16.png\" alt=\"\" class=\"wp-image-124\" srcset=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-16.png 908w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-16-300x61.png 300w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-16-768x156.png 768w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-16-624x126.png 624w\" sizes=\"auto, (max-width: 908px) 100vw, 908px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>Selecting the app opens its&nbsp;<strong>Overview<\/strong>&nbsp;page, where you can perform basic management tasks like browse, stop, start, restart, and delete.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"908\" height=\"320\" src=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-17.png\" alt=\"\" class=\"wp-image-125\" srcset=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-17.png 908w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-17-300x106.png 300w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-17-768x271.png 768w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-17-624x220.png 624w\" sizes=\"auto, (max-width: 908px) 100vw, 908px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>The App Service menu provides different pages for configuring your app.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"570\" height=\"272\" src=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-18.png\" alt=\"\" class=\"wp-image-126\" srcset=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-18.png 570w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-18-300x143.png 300w\" sizes=\"auto, (max-width: 570px) 100vw, 570px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">4.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Clean up resources<\/h4>\n\n\n\n<p>In the preceding steps, you created Azure resources in a resource group. The resource group has a name like &#8220;appsvc_rg_Linux_CentralUS&#8221;, depending on your location. If you keep the web app running, you will incur ongoing costs (see&nbsp;<a href=\"https:\/\/azure.microsoft.com\/pricing\/details\/app-service\/linux\/\">App Service pricing<\/a>).<\/p>\n\n\n\n<p>If you do not expect to need these resources in the future, delete the resource group by running the following command:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"432\" height=\"56\" src=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-19.png\" alt=\"\" class=\"wp-image-128\" srcset=\"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-19.png 432w, http:\/\/vargas-solar.com\/cloud-bigdata\/wp-content\/uploads\/sites\/46\/2022\/01\/image-19-300x39.png 300w\" sizes=\"auto, (max-width: 432px) 100vw, 432px\" \/><\/figure>\n\n\n\n<p>The command uses the resource group name cached in the&nbsp;<em>.azure\/config<\/em>&nbsp;file. Have a look at your portal again.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>To Hand-In<\/strong><\/h3>\n\n\n\n<p>Once you have completed the hands-on, prepare a document with the following content. Name your document as&nbsp;lis-4112-&lt;your ID&gt;-ho-1.pdf&nbsp;upload it here:&nbsp;<\/p>\n\n\n\n<p><a href=\"https:\/\/drive.google.com\/drive\/folders\/16K5-Zk0N0yIukhTK_eAFSZgR2M1iLttG?usp=sharing\">https:\/\/drive.google.com\/drive\/folders\/16K5-Zk0N0yIukhTK_eAFSZgR2M1iLttG?usp=sharing<\/a><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Draw a functional architecture showing how the different cloud services interact for building your App.&nbsp;<ul><li>You can choose to draw several architectures for the different steps that you performed.&nbsp;<\/li><\/ul><ul><li>Exhibit in your figures the cloud provider and tag the services according to their type (IaaS, PaaS, SaaS).<\/li><\/ul><\/li><li>Draw the process that summarizes the main steps and substeps of the exercise. The figure must be synthetic but also explicitly labelled insisting on the I\/O of the different steps. Do not forget to explain:<ul><li>the authentication process (with ngrok);<\/li><\/ul><ul><li>the management of the \u201cdownload\u201d process of the sample files.<\/li><\/ul><\/li><li>Compare the tutorial process proposed by the Azure Tutorial&nbsp;&nbsp;(<a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/app-service\/quickstart-python?tabs=bash&amp;pivots=python-framework-flask\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/docs.microsoft.com\/en-us\/azure\/app-service\/quickstart-python?tabs=bash&amp;pivots=python-framework-flask<\/a>)&nbsp;and the one implemented in the lab under a complete externalized setting.<\/li><\/ul>\n\n\n\n<p>Create a glossary in a document including the explanation of ngrok, flask, CLI, notebook, magic, C<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p><a href=\"applewebdata:\/\/4EC9CB50-2248-4EF0-92CA-736CA152DC24#_ftnref1\"><sup>[1]<\/sup><\/a>&nbsp;<a href=\"https:\/\/flask.palletsprojects.com\/en\/2.0.x\/\">https:\/\/flask.palletsprojects.com\/en\/2.0.x\/<\/a>&nbsp;Flask is a micro web framework written in Python. It is classified as a microframework because it does not require tools or libraries.&nbsp;A&nbsp;web framework&nbsp;(WF) or&nbsp;web application framework&nbsp;(WAF) supports the development of&nbsp;web applications. A WF provides a standard way to build and deploy applications on the Web to automate the overhead associated with typical activities performed in&nbsp;web development (see https:\/\/en.wikipedia.org\/wiki\/Flask_(web_framework)).&nbsp;<\/p>\n\n\n\n<p><a href=\"applewebdata:\/\/4EC9CB50-2248-4EF0-92CA-736CA152DC24#_ftnref2\"><sup>[2]<\/sup><\/a>&nbsp;Pip is a recursive acronym that can stand for either &#8220;Pip Installs Packages&#8221; or &#8220;Pip Installs Python&#8221;. Alternatively, pip stands for &#8220;<strong>preferred installer program<\/strong>&#8220;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Objective Start getting acquainted with the use of IaaS and PaaS cloud services for building and deploying applications on the cloud.&nbsp; The hands-on exercise will be inspired&nbsp;by&nbsp;https:\/\/docs.microsoft.com\/en-us\/azure\/app-service\/quickstart-python?tabs=bash&amp;pivots=python-framework-flask,&nbsp;but we will add Google Collab to externalise the whole task. The general aim is to deploy a Python web app to&nbsp;App Service on Linux, Azure&rsquo;s highly scalable, self-patching [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"page-templates\/full-width.php","meta":{"footnotes":""},"class_list":["post-94","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-json\/wp\/v2\/pages\/94","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-json\/wp\/v2\/comments?post=94"}],"version-history":[{"count":13,"href":"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-json\/wp\/v2\/pages\/94\/revisions"}],"predecessor-version":[{"id":129,"href":"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-json\/wp\/v2\/pages\/94\/revisions\/129"}],"wp:attachment":[{"href":"http:\/\/vargas-solar.com\/cloud-bigdata\/wp-json\/wp\/v2\/media?parent=94"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}