GithubHelp home page GithubHelp logo

isabella232 / dotnet-sample Goto Github PK

View Code? Open in Web Editor NEW

This project forked from azure-samples/dotnet-sample

0.0 0.0 0.0 855 KB

Setup CI/CD workflow for dotNet sample app using GitHub Actions

License: MIT License

C# 22.68% CSS 6.06% ASP 0.54% JavaScript 50.08% HTML 20.64%

dotnet-sample's Introduction

page_type description products languages
sample
Deploy dotnet application using GitHub Actions
GitHub Actions
Azure App service
dotnet

Sample ASP.NET Core application for GitHub Actions

For all samples to set up GitHub workflows, see [Create your first workflow](https://github.com/Azure/actions-workflow-samples

Steps to create an End-to-End CI/CD Workflow

Pre-requisites

  • Create a new Web App in Azure Portal with runtime stack as .NET and OS as Windows
  • Copy Publish Profile Settings of the app

Create an ASP.NET App Service in Azure

This template deploys a web app with ASP.NET support. The web app with ASP.NET is an app service that allows you to deploy your ASP.NET website. This will deploy a free tier Windows App Service Plan where you will host your App Service.

If you are new to Azure App Service, see:

Configure secrets in the GH repo:

  • In the GH repo with Application code, Define a new secret under repository by navigating to settings > secrets > Add a new secret
  • Paste the contents for the downloaded publish profile file into the secret's value field
  • Now in the workflow file in your branch: .github/workflows/workflow.yml replace the secret for the input publish-profile: of the deploy Azure WebApp action

test your workflow

  • Commit a change in the app code.
  • You should see a new GitHub Action initiated in Actions tab.
  • At the end of the execution, navigate to the App URL to visualise the change introduced.

Workflow YAML explained

  • Checkout Checks out your Git repository content into Github Actions agent.
  • Environment setup using Setup MSBuild - Sets up a ms-build environment by optionally downloading and caching a version of dotnet by SDK version and adding to PATH .
  • DotNet Build & Publish
  • Deploy to App service using azure/webapps-deploy@v1 action which authenticates using Azure Web App Publish Profile which we configured using the secret set up at the repo level

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

dotnet-sample's People

Contributors

microsoft-github-operations[bot] avatar microsoftopensource avatar n-usha avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.