Creat­ing a Web Ap­pli­ca­tion Us­ing Azure App Ser­vices

‘Azure App Ser­vices’ en­ables the de­vel­op­ment of pow­er­ful apps for any plat­form and any de­vice. Let’s try and build a sim­ple Web ap­pli­ca­tion us­ing this PaaS of­fer­ing from Mi­crosoft Azure.

OpenSource For You - - Contents - By: Mitesh S. The au­thor has writ­ten the book, ‘Im­ple­ment­ing DevOps with Mi­crosoft Azure’. He oc­ca­sion­ally con­trib­utes to https://clean­clouds.com and https://etu­to­ri­alsworld.com. Book link: https:// www.ama­zon.com/DevOps-Mi­crosoft-Vis­ual-Stu­dio-Ser­vice­seb

The global in­dus­try is in­creas­ingly lean­ing to­wards Plat­form as a Ser­vice (PaaS), which has ad­vanced con­sid­er­ably over time. To­day, PaaS uses sev­eral pro­gram­ming lan­guages such as .NET, Java, PHP, Python and Ruby.

Mi­crosoft Azure and its ser­vices

Mi­crosoft Azure is one of the most dom­i­nant cloud ser­vices providers in the mar­ket. Mi­crosoft Toolsets pro­vides an easy way to de­ploy ap­pli­ca­tions that are built on a plat­form like Java and .NET.

Mi­crosoft Azure comes with some core con­cepts that are im­por­tant to un­der­stand. Its ser­vices are avail­able in 36 re­gions around the world, with plans an­nounced for four ad­di­tional re­gions. De­tails re­gard­ing these re­gions are avail­able at https://azure.mi­crosoft.com/en-in/re­gions/. To view prod­ucts or ser­vices avail­able, based on the re­gion, you can go to https://azure.mi­crosoft.com/en-in/re­gions/ ser­vices/. ‘Re­source Groups’ in Mi­crosoft Azure is a log­i­cal con­tainer. It can be used to group dif­fer­ent re­sources such as Mi­crosoft Azure App Ser­vices, SQL data­bases, and stor­age ac­counts avail­able in Mi­crosoft Azure.

An App Ser­vice Plan (ASP) com­prises the in­stance size and in­stance count on which the ap­pli­ca­tion is hosted, as well as its fea­tures. There are dif­fer­ent ca­pa­bil­i­ties and lim­its within ASPs. It is im­por­tant to un­der­stand that ASPs can be shared by mul­ti­ple ap­pli­ca­tions and de­ploy­ment slots are usu­ally on the same ASP; how­ever, we can change the ASP for the slots too. If you want to un­der­stand how pric­ing works in Mi­crosoft Azure, you should ex­plore Azure Cal­cu­la­tor at https://azure.mi­crosoft.com/en-in/pric­ing/cal­cu­la­tor/.

Mi­crosoft Azure App Ser­vices

App Ser­vices is one of the most pop­u­lar of­fer­ings from Mi­crosoft Azure. Web Apps are a PaaS of­fer­ing that have com­put­ing re­sources and run­time en­vi­ron­ments man­aged by Mi­crosoft Azure.

For Azure App Ser­vices, five pric­ing tiers are avail­able – free, shared, ba­sic, stan­dard and pre­mium.

ƒ Free: Try this to im­ple­ment a proof-of-con­cept.

ƒ Shared: This is for ba­sic Web ap­pli­ca­tions or static web­sites. ƒ Ba­sic: This is for de­vel­op­ment/test en­vi­ron­ments. ƒ Stan­dard: This is for Web and mo­bile ap­pli­ca­tions in the pro­duc­tion en­vi­ron­ment.

ƒ Pre­mium: This is for en­ter­prise scale and in­te­gra­tion.

App Ser­vices can be eas­ily used in DevOps prac­tices too. Vis­ual Stu­dio Team Ser­vices can be used for con­tin­u­ous in­te­gra­tion and de­liv­ery, or con­tin­u­ous de­ploy­ment us­ing dif­fer­ent tasks and ways in dif­fer­ent en­vi­ron­ments, with ap­proved sce­nar­ios.

To check how these ser­vices work, go to https://azure. mi­crosoft.com/en-us/try/app-ser­vice/. Se­lect Web App. Click on Con­tinue and fol­low the rest of the steps in­di­cated.

Creat­ing a Web ap­pli­ca­tion

If you have a valid Mi­crosoft Azure sub­scrip­tion, you can go

to https://por­tal. azure.com/. To get some quick hand­son ex­pe­ri­ence on creat­ing an ap­pli­ca­tion, fol­low the steps given below.

Log in with valid cre­den­tials and you will get the Azure dash­board.

First, let’s cre­ate an App Ser­vice Plan

(ASP) so that we can host Azure App

Ser­vices on it. Click on ASP in the left side­bar, and then click on + Add.

Give the name of the ASP, then the name of the New

Re­source Group, the op­er­at­ing sys­tem, the lo­ca­tion where ASP must be hosted, and the most im­por­tant part — the pric­ing tier. Next, click on Cre­ate.

Once we have ASP ready, click on App Ser­vices in the left side­bar and then on +Add.

Se­lect Web App. Click on Cre­ate. Give the App Name, and se­lect the Re­source Group that we have cre­ated while creat­ing the ASP. Click on Cre­ate.

Wait for some time, and once the Azure Web App is ready, you can ac­cess it from the Azure dash­board.

Ver­ify the Re­source Group, the sta­tus of the Web App (its lo­ca­tion and URL), the App Ser­vice Plan, FTP de­tails and mon­i­tor­ing re­lated de­tails.

Visit the URL in the browser.

Go to the Azure Web App just cre­ated and click on Ap­pli­ca­tion Set­tings. When we cre­ate an Azure Web app, by de­fault, it is a .NET app. Let’s look at how to change it to a Java ap­pli­ca­tion.

Se­lect the Java ver­sion as Java 8. Se­lect the Java Mi­nor ver­sion and Web Con­tainer too.

To keep a 64-bit plat­form for the ap­pli­ca­tion, we need to change the pric­ing plan to Stan­dard.

Put the Al­ways On switch on, and click on Save.

Visit the URL of the Azure Web App and ver­ify the change in the Java ap­pli­ca­tion. Go to Prop­er­ties, check the sta­tus, the vir­tual IP ad­dress, the out­bound IP ad­dress, and FTP re­lated de­tails.

For check­ing logs, and to know more about the struc­ture, go to the Kudu ed­i­tor us­ing the URL https://os­fytestapp.scm. azureweb­sites.net. Add SCM in the orig­i­nal URL. Ver­ify the Web Apps di­rec­tory.

There are two types of scal­ing – ver­ti­cal and hor­i­zon­tal. When scal­ing up, we can per­form ver­ti­cal scal­ing. Ac­tu­ally, this is a scal­ing up of the App Ser­vice Plan. In the Ba­sic pric­ing tier, hor­i­zon­tal scal­ing is not sup­ported, but it is sup­ported in the Stan­dard pric­ing tier. Log­ging is an im­por­tant as­pect in case of trou­bleshoot­ing and, by de­fault, log­ging is not en­abled.

All log files can be ac­cessed from the Azure por­tal as well as the Kudu ed­i­tor.

In this ar­ti­cle, we have cre­ated a Web ap­pli­ca­tion us­ing Mi­crosoft Azure App Ser­vices, which is a PaaS of­fer­ing from Mi­crosoft. The road ahead can be con­tin­u­ous in­te­gra­tion and de­liv­ery us­ing Vis­ual Stu­dio Team Ser­vices to im­ple­ment DevOps prac­tices.

Fig­ure 5: Azure App Ser­vice in the browser

Fig­ure 1: Mi­crosoft Azure dash­board

Fig­ure 2: App Ser­vice Plan in Mi­crosoft Azure

Fig­ure 6: Ap­pli­ca­tion set­tings of the Azure App Ser­vice (Azure Web apps) in the Mi­crosoft Azure dash­board

Fig­ure 7: Con­fig­ure the Java ap­pli­ca­tion in Ap­pli­ca­tion Set­tings of Azure App Ser­vices

Fig­ure 4: Azure Web App overview in Mi­crosoft Azure

Fig­ure 3: Azure Web App in Mi­crosoft Azure

Fig­ure 13: Log con­fig­u­ra­tion of Azure App Ser­vices in Mi­crosoft Azure

Fig­ure 10: Kudu ed­i­tor of Azure App Ser­vices in Mi­crosoft Azure

Fig­ure 9: Prop­er­ties of Azure App Ser­vices

Fig­ure 12: Scal­ing out the App Ser­vice Plan

Fig­ure 11: Scal­ing up the App Ser­vice Plan

Fig­ure 8: Java based Azure Web App

Newspapers in English

Newspapers from India

© PressReader. All rights reserved.