Loading...

Azure Tips and Tricks - How to use GitHub Actions from Azure App Service

Azure Tips and Tricks - How to use GitHub Actions from Azure App Service

How to use GitHub Actions from Azure App Service

 

 

 

Automated deployments create better software

When you need to manually build and deploy your app, each time that you make a change, you will make mistakes, which result in bugs and downtime for users. Automating your build and deployment processes makes them less error-prone and allows you to deploy as often as you want. GitHub Actions can help to automate your builds and deployments and integrates with Azure App Service.

 

In this post, we'll automatically build and deploy code to an Azure App Service using GitHub Actions.

 

Prerequisites

If you want to follow along, you'll need the following:

  • An Azure subscription (If you don't have an Azure subscription, create a free account before you begin)
  • An Azure App Service Web App. You can create one using this tutorial.
  • A GitHub account with a repository in it that contains code that can run on Azure App Service (like an ASP.NET Core website)

 

Create a GitHub Action from an Azure App Service

We already have an Azure App Service Web App, and a GitHub repository that contains an ASP.NET Core application. Let's use GitHub Actions to deploy the code from the repository to the Web App.

  1. Go to the Azure portal.
  2. Navigate to the Azure App Service Web App
  3. Select the Deployment Center menu
  4. In the deployment center, select GitHub as the source control location
    1. If you haven't used your GitHub account with your Azure account before, you need to click the Authorize button to authorize Azure to access GitHub
  5. Select Continue to go to the next step
  6. In the Build providers step, select GitHub Actions

 

manojsrinivas_1-1655500235303.png

(Select GitHub Actions in the Deployment Center)

 

  1. Select Continue
  2. In the Configure step:
    1. Select the Repository that you want to use
    2. Select the code Branch to build and deploy from
    3. Select the Runtime stack. In our case, this is .NET Core with the latest version

 

manojsrinivas_2-1655500235323.png

(Configure GitHub access in the Deployment Center)

 

  1. Select Continue to proceed
  2. You'll now see the GitHub Action workflow configuration file that describes the GitHub action. Select Finish to finalize the workflow

We have now successfully created a GitHub Action for the Azure Web App. After a few minutes, the workflow will be finished and the code from the repository should be deployed to the Web App. You should be able to see the deployed code run in the Web App when you click on the Browse button from the Deployment Center.

 

manojsrinivas_3-1655500235262.png

 

 

(Application running in Azure App Service Web App)

 

And from the Deployment Center, you can click on the GitHub Action link to go to the action in GitHub. Here, you can see all the GitHub Action workflows that are configured and their builds and deployments and drill down into the logs of already executed, or in-progress workflows.

 

manojsrinivas_4-1655500235494.png

 

(Details of a GitHub Action workflow)

 

Conclusion

 

Automating your build and deployment processes improves the quality of your software. GitHub Actions allow you to easily automate your builds and deployments and integrate with Azure App Service.

 

Create a trial account today and go and check it out!

 

Published on:

Learn more
Azure Developer Community Blog articles
Azure Developer Community Blog articles

Azure Developer Community Blog articles

Share post:

Related posts

Setting up Team-Based Access for Dynamics 365 CRM Documents Stored on SharePoint, Dropbox or Azure Blob Storage

Attach2Dynamics by Inogic is a seamless document management solution for Dynamics 365 CRM that integrates with popular cloud storage platforms...

21 hours ago

Azure SDK Release (October 2024)

The Azure SDKs release every month. This post includes the month's highlights and release notes. The post Azure SDK Release (October 2024) app...

1 day ago

Using Entra profile information in Azure DevOps

We’re excited to announce the ability to use Entra profile information in Azure DevOps. This has been a long-standing feature request from the...

1 day ago

Exploring SUSE Enterprise Linux on Azure

Exploring SUSE Enterprise Linux on Azure In today's cloud-centric world, leveraging robust and reliable operating systems is crucial for busin...

1 day ago

Azure Adaptive Cloud Pre-Days at Microsoft Ignite 2024

As the excitement builds for Microsoft Ignite 2024, tech enthusiasts and professionals worldwide are eagerly anticipating the Azure Adaptive C...

1 day ago

Build Intelligent Apps Code-First with Prompty and Azure AI

      Building Generative AI applications can feel daunting for traditional app developers. What does the end-to-end applicati...

3 days ago

Soccer Analytics Copilot with Azure SQL and OpenAI

The Football (aka Soccer in US 😀) Analisys Copilot provides an intuitive interface for users to interact with complex football data without n...

3 days ago

End-to-End Full-Stack Web Application with Azure AD B2C Authentication: A Complete Guide

Application Overview The purpose of this sample application is to demonstrate the usage of Azure Active Directory B2C (Azure AD B2C) for authe...

4 days ago

Updates to Azure Cosmos DB’s Portal Networking Settings

We are happy to share with you an update to the Azure Cosmos DB networking configuration options within the Azure Portal. This update introduc...

4 days ago
Stay up to date with latest Microsoft Dynamics 365 and Power Platform news!
* Yes, I agree to the privacy policy