Exploring GitHub as Deployment Options for Azure Web Apps and Web Apps on Linux
In this article, the author will be showing you all how to deploy files on Microsoft Public Cloud i.e. Microsoft Azure, using GitHub.
Join the DZone community and get the full member experience.Join For Free
deployment is always a hot topic of discussion among developers.
files can also be deployed to azure using visual studio . in this article, i will be showing you all how to deploy files on microsoft public cloud i.e. microsoft azure, using github.
- microsoft azure account: if not, create your free account clicking here .
- github account: if not, create your free account clicking here .
once done with the above-mentioned prerequisites, let's start!
step 1 - create azure web app
microsoft azure portal
click on new => web + mobile => web app.
enter details as mention below,
- app name - enter a unique name for your application. this name is unique across azure.
- resource group - group of related azure products/service created in azure portal. you can select existing resource group or create new.
- app service plan / location - you can select existing app service plan or create new, files will be deployed/hosted at this given location.
once done with entering required details, click on create.
notification message could be seen once the deployment starts.
and then, finally with deployment succeeded.
now, click => app services => ' web app name entered'. here, we entered as 'deploytoazureusinggithub'.
once clicked on our web app, portal will display details with its overview, as seen in the below image.
step 2 - now, we need to link our github account with web app we created in above step.
to accomplish above task, we need navigate to 'deployment options' under app deployment section.
trick - enter required action at search box, here in case, enter 'guthub' and it will open the required option from current blade in portal window,
select deployment options => choose source (this will list all options available for linking as source) => github.
once selecting source as github, next step is to authorize our web app with github account to be used.
click => authorize, as shown in below image.
when clicked on authorize, it will open a popup window, with github account details asking for permission to get linked.
verifying github details, click => authorize application,
authorizing will close pop window, and below success message would be displayed in azure portal.
authorization section would display your github username.
as my github account username is kasamshaikh, the same is being displayed at authorization section as seen in below image.
now, it's time to select repository or project to be selected as file source. as seen below, all repositories are listed for selection. here, we will select 'deploytoazure'.
selecting, will add selected project and its 'master' as branch under choose branch section.
refer to the below image.
the below notification will get displayed, stating our set up to be completed successfully. also, this will deploy files from repository to azure web app.
let's test it!
here, i have one index.html file added to repository we selected, as seen below.
browse web app url to view,
great! by now we created our web app and linked it with github account. the steps also deployed files from repository to azure web app account.
let's do one more round of testing. modify index.html from deploytoazure repository, with adding hyperlink, as shown in the below image.
enter commit comments => commit changes.
committing any changes will deploy file to azure web app,
browse azure web url to verify changes,
so, changes got reflected.
also, we can view this commit comment ( highlighted in above image ) and deployed file logs in azure portal, under deployment options.
in this article, we have gone through how seamlessly we can deploy files using github as the source. also, having deployment logs with no extra settings or coding, makes tracking in place effortless.
i would recommend you try this out once. let me know in case of any queries or concerns with respect to the same. thank you!
Published at DZone with permission of Kasam Shaikh. See the original article here.
Opinions expressed by DZone contributors are their own.