Giter VIP home page Giter VIP logo

flask-ml-azure's Introduction

flask-ml-azure

Sample project to deploy a Flask app on Azure pipelines.

Install Azure Cli

Check other install procedures on the Azure docs

On OSX:

$ brew update && brew install azure-cli

It is required to login into Azure, which authenticates locally to that cloud:

image

Azure Cloud Shell

After logged in, go to Azure's Cloud Portal, and click on Cloud Shell. If you don't have any valid subscriptions to Azure you will need to create an active one. If no storage has been provisioned, it needs to be created and associated with the project. This process may take a few minutes.

alfredo@Azure:~$ git clone https://github.com/alfredodeza/flask-ml-azure
Cloning into 'flask-ml-azure'...
...
Unpacking objects: 100% (12/12), done.
Checking connectivity... done.
alfredo@Azure:~$ cd flask-ml-azure/
alfredo@Azure:~/flask-ml-azure$ az webapp up -n flask-ml
webapp flask-ml doesn't exist
Creating Resource group 'alfredodeza_rg_Linux_centralus' ...
Resource group creation complete
Creating AppServicePlan 'alfredodeza_asp_Linux_centralus_0' ...
Creating webapp 'flask-ml' ...
Configuring default logging for the app, if not already enabled
Creating zip with contents of dir /home/alfredo/flask-ml-azure ...
Getting scm site credentials for zip deployment
Starting zip deployment. This operation can take a while to complete ...
Deployment endpoint responded with status code 202
You can launch the app at http://flask-ml.azurewebsites.net
{
  "URL": "http://flask-ml.azurewebsites.net",
  "name": "flask-ml",
  "os": "Linux",
  "runtime_version": "python|3.7",
  "runtime_version_detected": "-",
  "src_path": "//home//alfredo//flask-ml-azure"
}

Visit the link in the JSON output and the sample app should be available. To stop the service:

alfredo@Azure:~/flask-ml-azure$ az webapp stop -n flask-ml

Sign into Azure Devops

This is necessary to connect the web application to Azure Pipelines. Go to Azure Dev Portal and create a new project. Once created, A Service Connection needs to be connected to enable the Pipeline.

There are a few clicks and menus to get to this, starting with the Settings -> Pipelines (section) -> Service Connections. This project doesn't have any service connections, so a "Create your first service connection" message shows.

Select Azure Resource Manager -> Service Principal (Automatic). Make sure to allow popups in the browser for the Azure domain.

image

Fill out the form, not sure why the Resource Group never populates for me, it just keeps loading. Click Save to continue:

image

Create the Pipeline

Finally, create the pipeline, you will get prompted to authenticate multiple times. Select the repository from your Github account, granting permissions to Azure to access your repository. A YAML file will get generated to produce the application which will be committed to the repo after approving it. The pipeline process will now show something similar to this:

image

flask-ml-azure's People

Contributors

alfredodeza avatar dependabot[bot] 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.