Azuredev - Info.microsoft

3y ago
15 Views
2 Downloads
5.25 MB
25 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Noelle Grant
Transcription

Azure Tips and Tricks:Webazuredev.tipsISBN 978-1-7327041-2-1

IntroductionHi, folks!When I reflect back on Azure Tips and Tricks a year ago, I was only thinking that I’d writea couple of posts and move on. Fast-forward to today, the collection has grown to over150 tips, as well as videos, conference talks, and now an e-book spanning the entireuniverse of the Azure platform. What you are currently reading is a special collection oftips based on page views of the entire series over the last year. Before we dive in, you’llnotice my pixelated form as you turn each page.These represent:Something I foundinteresting and youmay too.Additional resourcesto get the most outof this tip.You can stay up to date with the latestAzure Tips and Tricks at: Blog - azuredev.tips Videos - videos.azuredev.tips eBook - ebook.azuredev.tips Survey - survey.azuredev.tipsI hope you enjoy reading the eBookas much as I did writing it.Thanks,Michael Crump (@mbcrump)A key takeaway fromthe tip.

WEBIf you’ve used Azure, you’ve more than likely used Azure App Serviceto easily host web applications, REST APIs, and mobile back ends. Inthis e-book, I’ve pulled out the top 6 tips since the creation of AzureTips and Tricks for Azure App Service. They include easily workingwith files in the console, easily setting up staging environments andswapping between them, and routing traffic to different versionsof your app to “Test in Production”. I’ll also cover how you canimplement performance testing, best practices for App Settings inAzure App Service, and cloning a web app that is especially helpful ifyou have customers all over the world.

Working with Files in Azure App ServiceWe’ll take a look at the files inside an Azure App Serviceweb site and how you can easily work with them.You can learnmore aboutAzure AppServicehereConsole Access to my App ServiceGo to the Azure Portal and select my App Service. Click onConsole under Development Tools to have a commandprompt to quickly work with my Azure App Service.As you can tell from the screenshot, I start in D:\home\site\wwwroot. I can type dir to see acurrent directory listing.

Quick Tip You cantype help from theconsole window fora list of availablecommands.I can do basic commands here and even use TYPE FILENAME to parsethe output of a file to the screen. You can make directory and so forth, butkeep in mind that this is a sandbox environment and some commandswhich require elevated permissions may not work.

A VS Code Experience to an Azure App ServiceIf you’re familiarwith VS Code, thenyou’ll be right athome as you canexplore, searchand add to Git.You can alsomanipulate filesfrom within thewindow. Thismakes it easy toadd, edit ordelete files.A VS Code Experience to an Azure App ServiceThere is also another option that is called “App Service Editor” located justtwo items down from “Console” that you picked before.Just like in VS Code, you can modify yoursettings and even change your theme.Kudu Diagnostic ConsoleNo App Service tutorial is complete withoutmentioning Kudu Diagnostic Console. You canaccess it from within the App Service Editorunder your app name - Open Kudu Consoleor through the portal under Advanced Tools.

You can just click on the folder name to navigate or type in the command.You can also easily manipulate the files, but I like the App Service Editorbetter for that functionality.Quick Tip The AppService Editor is agreat choice if everin doubt and youcan access itdirectly hereEditor is perfect for lightweight work such as editing files whereasKudu puts you deep into the weeds with debugging information, filemanipulation and more.The main reason that I typically come to the Kudu Diagnostic Consoleis to download files.

Test Web Apps in Productionwith Azure App ServiceWe’ll take a look at the files inside an Azure App Serviceweb site and how you can easily work with them.You can learnmore about AzureDeployment SlotshereCreating Deployment SlotDeployment slots let you deploy different versions of yourweb app to different URLs. You can test a certain version andthen swap content and configuration between slots.Go to the Azure Portal and select my App Service and clickon Deployment Slots under Deployment to get started.Then click on the Add Slots button. Give it a name suchas staging then use an existing configuration source. We’lluse our “production” web app. You know, the cool quizapplication. Aka.ms/azuretips/myquizappGreat, now if we go back to Deployment Slots, we should see it running.

Click on the new staging site that we just created and you’ll notice that ithas appended the word staging. You’ll also notice we havea new site: Aka.ms/azuretips/quizsourcegitWe need to push a new version of our existing quiz application to thisstaging slot. Go to Deployment Options and select External Repository.Give it the following URL: Aka.ms/azuretips/quizsource and hit OK.”Youmight have to hit Sync, and you’ll eventually see the following:

Give it a couple of minutes until you see that it has completedpulling down your code from Git and then go to the new URL ofyour site. You can find the URL on your overview page. In my caseit is, /We could now return to theoriginal app service that wecreated and swap betweenthe two sites that we have.For example, you mightwant to move the stagingsite over to the productionsite and vice versa. Thepower of this is that yourusers don’t experience adowntime and you cancontinue working in yourpreferred space until readyto move to production.Success! This is our new site as indicated by the awesome largefont that says jsQuizEngine version 2.Source Code The sourcecode to the stagingenvironment can befound hereIn this tip, we’ll look at a feature called Testing in Production whichallows you to test your application in production. Not scary at all!

Testing Web Apps in Productionwith Azure App ServiceHold up! You’ll want to takea look at the deploymentslots in the previous tip ifyou haven’t worked withdeployment slots before.Go to the Azure Portal and select my App Service and click onTesting in Production under Development Tools to get started.The first thing you’ll see is Static Routing and you’ll notice that it’slooking for a deployment slot and traffic percentage.We’ll want to split the traffic to our site into two groups to testour new site and see if customers like it. Since this is just a demo,I want to send a large number of folks to our new staging site asshown below.What is Static Routing Thissection lets you controlhow traffic is distributedbetween your productionand other slots. This isuseful if you want to try outa new change with a smallpercentage of requests andthen gradually increase thepercentage of requests thatget the new behavior.Great! Now keep in mind that we have two versions of our site:one that is production and one that is staging. They are identicalexcept for the staging site has a large font that says jsQuizEngineversion 2.We don’t want to swap sites, we just want to distribute trafficbetween the two sites.I can test this by going to my production URL and refreshing thesite until the staging site is shown with the production URL.

Success! It works, but what happens when they leave the site? We actually store a cookiethat keeps track of it. You can find this cookie yourself by inspecting the site and looking forthe cookie shown on the next page.

You could actually force the old production site by setting thex-ms-routing-name cookie to self or providing it in the URLquery string such as outing-name self You could even use the URL to letyour users test different versions of your site. For example, I coulduse outingname staging to let users try my new website before I push it live.This is very neat stuff, folks!Learn more about loadtesting atAka.ms/azuretips/vstsIn this tip, we’ll look at a simple and quick way toperform load testing of your web app.

Load Testing web apps withAzure App ServicesLoad Testing allows you to test your web app’s performanceand determine if your app can handle increased traffic duringpeak times. You can find this tool by logging into your Azureaccount, going to your App service that you created, andlooking under Development Tools.Inside the blade, select New and you willsee the following options:

Use Case Scenario Supposeyou have a web app and youhave something for sale. Youhave an upcoming promothat last year had 175 usersconnected for 5 minutes.Users complained that thesite was slow and sinceyour site has grown, youwant to improve customersatisfaction by reducing thepage load time and testyour web app with a load of250 users for 5 minutes. Letthe test run and you’ll bepresented with the followinginformation once it hascompleted:You have the option to Configure Test and you can leave thisas Manual Test or Visual Studio Web Test. The main differencebetween the two is that with the latter you can select multipleURLs and even use a HTTP Archive file (such as one created byFiddler). Leave the testing option as manual and select a nameand location, and make sure you leave the defaults as 250users for 5 minutes.

Look out! Keep in mindthat there is a charge forperforming a load test interms of virtual users asindicated in the screenshot.We were able to do thiswithout writing code andwith just a couple of clicksin the portal.Learn more about AppSettings atAka.ms/azuretips/appservconfigIn this post, we’ll take advantage of App Settings to storea Key/Value pair securely in Azure and access it in your web app.

Working with App Settingsand Azure App ServicesApp Settings are used to store configurable items withoutmaking any changes to the code. The key/value pairs arestored behind the scenes in a configuration store, which is nicebecause sensitive information never shows up in a web.config,etc. file. In order to take advantage of this, you’ll need to loginto your Azure account and go to your App Service that youcreated and look under Development Tools then you will seeApplication Settings.Open it and scroll down and you’ll see App Settingsas shown below.We’re going to add an App Setting in Azure. I added one withthe key of Environment and the value is set to Staging.

Open or create your ASP.NET MVC app and modify theappSettings section of the web.config file to add ourEnvironment key/value pair as shown below:If you run the application locally, then you’ll see Production as it is coming from theweb.config file, but if you run it inside of Azure, then you’ll see Staging as it is comingfrom the Apps Settings configuration store located in Azure. Neat stuff!

Connection Strings vs. App Settings You may have noticed ConnectionStrings right below the App Settings option and wonder when to use it. Ageneral rule of thumb is to use Connection Strings for database connectionstrings and App Settings for key/value pair application settings. If youexamine your web.config file, then you’ll see there is also a section forconnectionStrings just as there is a section for appSettings.Cloning is the ability toduplicate an existing WebApp to a newly createdapp that is oftenin a different region. Thiswill enable customers todeploy a number of appsacross differentregions quickly and easily.Cloning Web Apps Usingand Azure App ServicesScenario: A company has an existing web app in West US, theywould like to clone the app to East US to serve folks that live onthat site with better performance such as latency.To do this, log into your Azure account and go to yourApp Service that you created. Look under Development Tools andfind Clone App.

Open it andyou’ll see the following:Ensure you give it an:Hold Up Besideschanging the location,this is also a great timeto determine the planneeded. You might notneed all the horsepowerto serve this site if youexpect very low traffic inthat region. App Name - Something unique as this site will live in Resource Group - Create a new one or use an existing one App Service Plan/Location - This is a good time tosomething.azurewebsites.netassociate a new plan that will determine the location,features, and cost, and compute resources associated withyour app.

Application Insights - You can turn it on or off to help youdetect and diagnose issues with .NET apps. Clone Settings - Clone will copy the content andcertificates of your app into a newly created application.You can also copy things like App Settings, ConnectionStrings, Deployment Source, and Custom Domains.Finally, there is Automation Options which brings you to theAzure Resource Manager templates that are so valuable.Aka.ms/azuretips/resourcemanager

What is a Azure ResourceManager again? AzureResource Manager enablesyou to work with the resourcesin your solution as a group.You can deploy, update, ordelete all the resources foryour solution in a single,coordinated operation. Youuse a template for deploymentand that template can work fordifferent environments such astesting, staging, and production.Resource Manager providessecurity, auditing, and taggingfeatures to help you manageyour resources after deployment.Aka.ms/azuretips/appservdeployOnce everything is set up thenpress Create and you’ll seethe Deployment in Progressbegin. You can click on it whiledeploying to see details asshown:

ConclusionThere are 130 additional tips waiting on you that coveradditional topics such as : App ServicesCLICloud ShellCognitive ServicesContainersCosmos DBFunctionsIoTLogic AppsPortalPowerShellProductivityStorageSQL and SearchFind all of these and more at azuredev.tipsDon't forget that if you are modernizing an existing applicationor building a new app, you can get startedAzure for free and get: 200 credit toward use of any Azure service 12 months of free services—includes compute, storage,network, and database 25 always-free services—includes serverless,containers, and artificial intelligenceStart freeUntil next time,Michael Crump @mbcrumpsigning off.

Azure Tips and Tricksazuredev.tipsCopyright 2018 by Microsoft Corporation. All rights reserved. No part of the contents of this book may bereproduced or transmitted in any form or by any means without the written permission of the publisher.Made with love By Red Door Collaborative.com

web site and how you can easily work with them. Console Access to my App Service Go to the Azure Portal and select my App Service. Click on Console under Development Tools to have a command prompt to quickly work with my Azure App Service. As you can tell from the screenshot, I start in D:\home\site\wwwroot. I can type dir to see a

Related Documents:

When Restaurant Manager exports its batch sales transactions, the resulting data is in a "horizontal" structure, similar to the following: Ticket Info Employee Info Sale Info Sale Info Sale Info Sale Info Tender Info Member Info Tip Info For Club Office to be able to use the data, it must be converted into the vertical structure that

o Microsoft Outlook 2000 o Microsoft Outlook 2002 o Microsoft Outlook 2003 o Microsoft Outlook 2007 o Microsoft Outlook 2010 o Microsoft Outlook 2013 o Microsoft Outlook 98 o Microsoft PowerPoint 2000 o Microsoft PowerPoint 2002 – Normal User o Microsoft PowerPoint 2002 – Power User o Microsoft PowerPoint 2002 – Whole Test

Business Ready Enhancement Plan for Microsoft Dynamics Customer FAQ Updated January 2011 The Business Ready Enhancement Plan for Microsoft Dynamics is a maintenance plan available to customers of Microsoft Dynamics AX, Microsoft C5, Microsoft Dynamics CRM, Microsoft Dynamics GP, Microsoft Dynamics NAV, Microsoft Dynamics SL, Microsoft Dynamics POS, and Microsoft Dynamics RMS, and

BASPINAL@SHAW.CA (Office Email) Contact Info Contact Info Contact Info Contact Info Contact Info Contact Info Contact Info Contact Info 8 JAG-2013-02024 s.22. FIGR0171 2013-12-04 10:55 AM Business Licences Expiring Between 2013-Dec-

Microsoft, Microsoft Dynamics, logo systemu Microsoft Dynamics, Microsoft BizTalk Server, program Microsoft Excel, Microsoft.NET Framework, program Microsoft Outlook, Microsoft SharePoint Foundation 2010, Microsoft SharePoint Ser

info@wonderware.ru Moscow tel. 7 495 641 1616 info@wonderware.ru Кiev tel. 38 044 495 33 40 info@wonderware.com.ua Helsinki tel. 358 9 540 4940 automation@klinkmann.fi Vilnius tel. 370 5 215 1646 info@wonderware.lt Rīga tel. 371 6738 1617 info@wonderware.lv Мinsk tel. 375 17 200 0876 info@wonderware.by Tallinn tel. 372 668 4500 info .

Microsoft Dynamics 365 for Operations on-premises, Microsoft Dynamics NAV, Microsoft Dynamics GP, Microsoft Dynamics SL, Microsoft Dynamics AX 2012 or prior versions, or Microsoft Dynamics CRM 2016 or prior versions. This guide is not intended to influence the choice of Microsoft Dynamics products and services or provide technical specification.

BEVERAGES. Si avvisa la gentile clientela che per qualsiasi informazione sulla presenza di sostanze che possono provocare allergie ed intolleranze è possibile consultare l’apposita documentazione che verrà fornita, a richiesta, dal personale in servizio. Per garantire la continua presenza del nostro prodotto, alcune materie prime potrebbero essere surgelate all’origine o congelate in .