Skip to content

wesselrooth/python-integrated-authentication

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Integrated security with Azure Active Directory and Key Vault

This sample accompanies the article Integrated authentication for Python apps with Azure services. The sample specifically contains the code described in the article along with Azure CLI scripts to provision the entire sample in your own Azure subscription.

  • main_app contains a simple Flask main app code that's deployed to Azure App Service. The app has a main page that points to its own open API endpoint that generates a JSON response and writes a message to Azure Queue storage.

  • third_party_api contains code that's deployed to Azure Functions to simulate a third-party REST API that's protected by an access key. The main app API endpoint calls this secured third-party API using the access key obtained from Azure Key Vault.

  • scripts contains provisioning and test scripts using the Azure CLI as described in the next section.

To provision the sample

  1. Install the Azure CLI

  2. Install the Azure Functions Core Tools

  3. Change to the scripts folder:

    cd scripts
  4. Run the provision.cmd (Windows) or provision.sh (macOS/Linux) script. On macOS/Linux, run the script using source command to ensure that environment variables are set up in the current shell session.

    chmod +x provision.sh
    source ./provision.sh
  5. The provisioning script runs test.cmd or test.sh at the end of the process to test the deployed sample. You can run test.cmd or test.sh again to repeat the test.

About

A sample that includes a main Flask app deployed to Azure App Service along with a separate API endpoint deployed to Azure Functions, which are used to demonstrate authentication and authorization on Azure.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Batchfile 45.6%
  • Shell 45.5%
  • Python 8.9%