GithubHelp home page GithubHelp logo

nikolaia / weather-in-harstad Goto Github PK

View Code? Open in Web Editor NEW
14.0 2.0 3.0 1.03 MB

An example on how to use F# Make (FAKE) 5+ for the entire pipeline when deploying to Azure App Service

F# 30.46% C# 19.75% CSS 12.17% JavaScript 0.09% HTML 37.53%

weather-in-harstad's Introduction

An example of Immutable application deployments to Azure App Service with F# Make

See the talk about this approach here: https://www.youtube.com/watch?v=_sZT0CpJ6Vo

Build, provision and deploy the project to an Azure WebApp

Install .NET Core 2.1 SDK (v2.1.300) or higher. This is the version that introduced global tools.

Install Azure CLI 2.0+, run az login and make sure you are on the correct subscription, then:

dotnet tool install fake-cli -g --version 5.1.0*
fake run build.fsx
fake run provision.fsx appName=yourWebAppName parameterSet=test

If you want provision.fsx to take a specific zip-file (it will default to the first appName*.zip it can find recursively), provide it as an argument: zip=./artifacts/Weather.1.0.0-beta4.zip

The deploy.fsx deployment script is made to be run from inside of Kudu and is packed inside the zip file during build.fsx. Kudu is triggered to launch deploy.fsx through the .deployment-file:

[config]
command = dotnet tool install fake-cli -g --version 5.1.0* & D:\local\UserProfile\.dotnet\tools\fake run deploy.fsx stageFolder=app/

Global tools on KUDU

Global tools are not in PATH by default inside the kudu sandbox:

PS D:\home\site\wwwroot> dotnet tool install fake-cli -g --version 5.1.0*
dotnet tool install fake-cli -g --version 5.1.0*
Tools directory 'D:\local\UserProfile\.dotnet\tools' is not currently on the PATH environment variable.

You can add the directory to the PATH by running the following command:

setx PATH "%PATH%;D:\local\UserProfile\.dotnet\tools"

You can invoke the tool using the following command: fake
Tool 'fake-cli' (version '5.1.0') was successfully installed.

We are not allowed to run the suggested command, but since the UserProfile folder is predictable we can simply run it from the hardcoded path inside of the .deployment-file.

weather-in-harstad's People

Contributors

dependabot[bot] avatar nikolaia avatar thor-kristian-valderhaug avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.