Duke-GCB / Duke-GCB/DukeDSClient

Determine best method for Azure authentication

Open
#344 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
5
Forks
6
PR merge metrics
No merged PRs in 30d

Description

For Azure backend support we will need to authenticate with various Azure API endpoints via the [Azure python SDK](https://docs.microsoft.com/en-us/azure/developer/python/azure-sdk-overview).
We also want to have support for using the [azcopy](https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10) command line tool to upload and download efficiently.

## Azure python SDK
For authenticating with Azure python SDK there is a [DefaultAzureCredential](https://docs.microsoft.com/en-us/python/api/overview/azure/identity-readme?view=azure-python#defaultazurecredential).
This provides many options to authenticate but many are focused on running with a VM on Azure.
Options that work in a non-Azure VM context:
- [Environment variables](https://docs.microsoft.com/en-us/python/api/overview/azure/identity-readme?view=azure-python#environment-variables) - Allows a user to authenticate as a service principle or via username/password. Not sure if username/password would work with Duke Auth.
- [Azure CLI ](https://docs.microsoft.com/en-us/python/api/overview/azure/identity-readme?view=azure-python#authenticate-via-the-azure-cli) - Uses authentication setup by the `az login` command.
- [InteractiveBrowserCredential](https://docs.microsoft.com/en-us/python/api/azure-identity/azure.identity.interactivebrowsercredential?view=azure-python) - Opens a browser where user logs in via Azure website.
- [DeviceCodeCredential](https://docs.microsoft.com/en-us/python/api/azure-identity/azure.identity.devicecodecredential?view=azure-python) - Prints a URL and a token that the user opens/pastes into a browser.

## azcopy
Users can authenticate via two high level options:
- [Azure Active Directory](https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10#option-1-use-azure-active-directory)
- [SAS token](https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10#option-2-use-a-sas-token)

There is a `azcopy login` command that allows a user to login via a web browser.
There are also [environment variables that can be set to authenticate with azcopy](https://docs.microsoft.com/en-us/azure/storage/common/storage-ref-azcopy-configuration-settings#azcopy-v10-environment-variables).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.