[PYTHON] Azure table storage with PTVS Flask app

What is Table storage?

Azure Table Storage Service (https://azure.microsoft.com/en-us/documentation/articles/storage-python-how-to-use-table-storage/) stores a large amount of structured data. I will. This service is a ** NoSQL datastore ** that accepts authenticated calls from inside and outside the Azure cloud. The point is that you can store SQL data externally. Using PTVS This is useful when you want to use SQL with Django.

Use Azure table storage with your Flask app

Project creation

** [New project] ▶ ︎ [Python / Sample] ▶ ︎ [Polls Flask Web Projetc] ** Create a new Flask project 1.png

App execution

Run and run to launch the Polls sample. 2.png Select What is your favorite season? 3.png Actually vote 4.png

You will actually be voted! 5.png

Use Azure table storage

If you select ** About ** here, the Current repository will have ** In-Memory **. Make ** Azure table storage available ** 6.png

** [Project / Right click] ▶ ︎ [Debug] ▶ ︎ [Debug Server Command] ** Fill in the Environment as below. Here, we will omit how to create storage in Azure. For details, refer to here

REPOSITORY_NAME=azuretablestorage
STORAGE_NAME=<storage account name>
STORAGE_KEY=<primary access key>
7.png

** * After filling in, right-click the solution and rebuild ** ** After execution, an error will occur, but please press [Continue]! ** ** Press About and it changed from ** In memory ** to ** Azure Table Storage **! 8.png

Deploy on Azure

[Deploy] to Azure (http://qiita.com/saiyuki1919/items/db6f9a2c705a1c9135dc) and ** [App Service] ▶ ︎ [APP] ▶ ︎ [Application Settings] ** Select and fill in the app settings in the same way as you did on VS to get Azure Table Storage.

REPOSITORY_NAME=azuretablestorage
STORAGE_NAME=<storage account name>
STORAGE_KEY=<primary access key>

9.png

After execution, if you select About on the actual web, it will be ** Azure Tbale Storage ** 10.png

Recommended Posts

Azure table storage with PTVS Flask app
Create and deploy a Django (PTVS) app using Azure Table storage
Azure External Storage MySQL Challenges with Django (PTVS)
How to use Azure Table storage from Django (PTVS)
Deploy a Django app made with PTVS on Azure
Run the app with Flask + Heroku
Creating a simple app with flask
Deploy flask app with mod_wsgi (using pipenv)
Getting Started with Flask with Azure Web Apps
Create a simple web app with flask
Easy web app with Python + Flask + Heroku
Getting Started with Heroku, Deploying Flask App
Flask can't be RESTful with azure API Apps
Create an image composition app with Flask + Pillow
Vienna with Python + Flask web app on Jenkins
[Azure Functions / Python] Chain functions with Queue Storage binding
Easy machine learning with scikit-learn and flask ✕ Web app
Storage I / O notes in Python with Azure Functions
Work memo that I tried i18n with Flask app
linux with termux app
IP restrictions with Flask
Hello world with flask
Programming with Python Flask
How to deploy a web app made with Flask to Heroku
Sample to put Python Flask web app on Azure App Service (Web App)
(Failure) Deploy a web app made with Flask on heroku
Try to extract Azure SQL Server data table with pyodbc
Let's create an app that authenticates with OIDC with Azure AD
Easy deep learning web app with NNC and Python + Flask