From 4d53681e537e6e9946ea1ddebcee448733b19730 Mon Sep 17 00:00:00 2001 From: viralpsuzy <83786761+viralpsuzy@users.noreply.github.com> Date: Thu, 6 May 2021 18:50:34 -0400 Subject: [PATCH 01/10] Update requirements.txt --- requirements.txt | 61 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/requirements.txt b/requirements.txt index 32e2d2715..04b891677 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,62 @@ +# This file is used by pip to install required python packages +# Usage: pip install -r requirements.txt + +# Flask Framework Flask>=1.0,<=1.1.2 + +#Flask==1.0.2 + +# Flask Packages +#Flask-Login==0.4.0 +#Flask-Migrate==2.0.2 +#Flask-Script==2.0.5 +#Flask-SQLAlchemy==2.4.0 +#Flask-WTF==0.14.2 +#Flask-User==1.0.1.5 + +# Automated tests +pytest==3.0.5 +pytest-cov==2.4.0 + +#Generic +pyodbc +sqlalchemy +secure-smtplib + +#Google packages +gspread +oauth2client + +#Base +pandas +numpy +openpyxl +xlsxwriter +pyreadstat +word2number + +#stats------ +lightgbm +statsmodels +matplotlib +sklearn +seaborn +factor-analyzer +config-parser + +#AzureCLI---- +#apt-get update +#apt-get install azure-cli +#apt install git-all + + +#apt-get update +#apt-get -y install g++ +#apt-get install unixodbc-dev +#sleep 5 + +#Cron----- +#apt-get update +#apt-get -y install cron +#apt-get install htop +#apt-get install atop From 1a443416101fb1079ccac5dd7bcc869fa35c6cfa Mon Sep 17 00:00:00 2001 From: viralpsuzy <83786761+viralpsuzy@users.noreply.github.com> Date: Thu, 6 May 2021 18:51:23 -0400 Subject: [PATCH 02/10] Add or update the App Service deployment workflow configuration from Azure Portal. --- .github/workflows/master_suzy-analytics.yml | 62 +++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/master_suzy-analytics.yml diff --git a/.github/workflows/master_suzy-analytics.yml b/.github/workflows/master_suzy-analytics.yml new file mode 100644 index 000000000..0a6f5a7a6 --- /dev/null +++ b/.github/workflows/master_suzy-analytics.yml @@ -0,0 +1,62 @@ +# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy +# More GitHub Actions for Azure: https://github.com/Azure/actions +# More info on Python, GitHub Actions, and Azure App Service: https://aka.ms/python-webapps-actions + +name: Build and deploy Python app to Azure Web App - suzy-analytics + +on: + push: + branches: + - master + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python version + uses: actions/setup-python@v1 + with: + python-version: '3.8' + + - name: Create and start virtual environment + run: | + python -m venv venv + source venv/bin/activate + + - name: Install dependencies + run: pip install -r requirements.txt + + # Optional: Add step to run tests here (PyTest, Django test suites, etc.) + + - name: Upload artifact for deployment jobs + uses: actions/upload-artifact@v2 + with: + name: python-app + path: | + . + !venv/ + + deploy: + runs-on: ubuntu-latest + needs: build + environment: + name: 'production' + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v2 + with: + name: python-app + path: . + + - name: 'Deploy to Azure Web App' + uses: azure/webapps-deploy@v2 + with: + app-name: 'suzy-analytics' + slot-name: 'production' + publish-profile: ${{ secrets.AzureAppService_PublishProfile_16c4e5e48b874801bcd7a11a27750c62 }} \ No newline at end of file From f26bc7678b71b76313a3e595ce88949aebf6dc89 Mon Sep 17 00:00:00 2001 From: viralpsuzy <83786761+viralpsuzy@users.noreply.github.com> Date: Thu, 6 May 2021 19:06:51 -0400 Subject: [PATCH 03/10] Update app.py --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index 7f8a1f2e8..8f4a6d159 100644 --- a/app.py +++ b/app.py @@ -3,4 +3,4 @@ @app.route("/") def hello(): - return "Hello, World!" + return "Hello, Azure!" From 263a37eae58db066f06dbe0922a55a4f726a5805 Mon Sep 17 00:00:00 2001 From: viralpsuzy <83786761+viralpsuzy@users.noreply.github.com> Date: Thu, 6 May 2021 20:12:10 -0400 Subject: [PATCH 04/10] Update app.py --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index 8f4a6d159..271cd1e16 100644 --- a/app.py +++ b/app.py @@ -3,4 +3,4 @@ @app.route("/") def hello(): - return "Hello, Azure!" + return "Hello, Test Azure!" From 0ab18a4a3d321003a0e2b6d42c0f7b6e4eec8257 Mon Sep 17 00:00:00 2001 From: viralpsuzy <83786761+viralpsuzy@users.noreply.github.com> Date: Thu, 6 May 2021 20:47:54 -0400 Subject: [PATCH 05/10] Update requirements.txt --- requirements.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 04b891677..98489ffda 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,9 @@ # Usage: pip install -r requirements.txt # Flask Framework -Flask>=1.0,<=1.1.2 +#Flask>=1.0,<=1.1.2 + +Flask #Flask==1.0.2 From 85a3c23afa5ee88fd84faf31949f898df674fd76 Mon Sep 17 00:00:00 2001 From: viralpsuzy <83786761+viralpsuzy@users.noreply.github.com> Date: Thu, 6 May 2021 21:22:33 -0400 Subject: [PATCH 06/10] Update app.py --- app.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app.py b/app.py index 271cd1e16..09c4c3550 100644 --- a/app.py +++ b/app.py @@ -4,3 +4,5 @@ @app.route("/") def hello(): return "Hello, Test Azure!" +import pyodbc +print ("Import Successful") From c800bbd5e9fca453bed9c4142a9d5f324cee47b2 Mon Sep 17 00:00:00 2001 From: viralpsuzy <83786761+viralpsuzy@users.noreply.github.com> Date: Thu, 6 May 2021 21:40:31 -0400 Subject: [PATCH 07/10] Update app.py --- app.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 09c4c3550..80f360db6 100644 --- a/app.py +++ b/app.py @@ -4,5 +4,8 @@ @app.route("/") def hello(): return "Hello, Test Azure!" + import pyodbc -print ("Import Successful") + +def test(): + return "This is hosted web application, run using Python" From 484c7b306492875b027c3073a6b141bf4968054c Mon Sep 17 00:00:00 2001 From: viralpsuzy <83786761+viralpsuzy@users.noreply.github.com> Date: Thu, 6 May 2021 22:13:42 -0400 Subject: [PATCH 08/10] Update app.py --- app.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/app.py b/app.py index 80f360db6..6f9d3f017 100644 --- a/app.py +++ b/app.py @@ -3,9 +3,4 @@ @app.route("/") def hello(): - return "Hello, Test Azure!" - -import pyodbc - -def test(): - return "This is hosted web application, run using Python" + return "Hello, Test Azure! This is hosted web application, run using Python." From 6da3d1256ba3fe2083d1de9a20d12c9f556cfe8d Mon Sep 17 00:00:00 2001 From: viralpsuzy <83786761+viralpsuzy@users.noreply.github.com> Date: Fri, 7 May 2021 09:53:49 -0400 Subject: [PATCH 09/10] Update requirements.txt Added a binary --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 98489ffda..50f3ce8c9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -36,6 +36,7 @@ openpyxl xlsxwriter pyreadstat word2number +dash #stats------ lightgbm From a1e34b51748e610a65f77821071e6d513a229d46 Mon Sep 17 00:00:00 2001 From: Azure App Service Date: Fri, 7 May 2021 11:05:40 -0400 Subject: [PATCH 10/10] Remove the App Service deployment workflow configuration from Azure Portal. --- .github/workflows/master_suzy-analytics.yml | 62 --------------------- 1 file changed, 62 deletions(-) delete mode 100644 .github/workflows/master_suzy-analytics.yml diff --git a/.github/workflows/master_suzy-analytics.yml b/.github/workflows/master_suzy-analytics.yml deleted file mode 100644 index 0a6f5a7a6..000000000 --- a/.github/workflows/master_suzy-analytics.yml +++ /dev/null @@ -1,62 +0,0 @@ -# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy -# More GitHub Actions for Azure: https://github.com/Azure/actions -# More info on Python, GitHub Actions, and Azure App Service: https://aka.ms/python-webapps-actions - -name: Build and deploy Python app to Azure Web App - suzy-analytics - -on: - push: - branches: - - master - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Set up Python version - uses: actions/setup-python@v1 - with: - python-version: '3.8' - - - name: Create and start virtual environment - run: | - python -m venv venv - source venv/bin/activate - - - name: Install dependencies - run: pip install -r requirements.txt - - # Optional: Add step to run tests here (PyTest, Django test suites, etc.) - - - name: Upload artifact for deployment jobs - uses: actions/upload-artifact@v2 - with: - name: python-app - path: | - . - !venv/ - - deploy: - runs-on: ubuntu-latest - needs: build - environment: - name: 'production' - url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} - - steps: - - name: Download artifact from build job - uses: actions/download-artifact@v2 - with: - name: python-app - path: . - - - name: 'Deploy to Azure Web App' - uses: azure/webapps-deploy@v2 - with: - app-name: 'suzy-analytics' - slot-name: 'production' - publish-profile: ${{ secrets.AzureAppService_PublishProfile_16c4e5e48b874801bcd7a11a27750c62 }} \ No newline at end of file