Skip to main content

Azure resource access library for Shopify Apps

The motivation for this library arose out of a data analysis project for a Shopify Store.

This package allows easy access to some Azure resources, particullarly:

  • create/delete a keyvault
  • populate keyvault with Shopify relevant secrets
  • read secrets
  • convert list[dict] data to JSON, CSV and Excel
  • store data in Azure blob

The source for this project is available here.

Sample usage

Install package with pip install azurify

create your environment variables:

AZURE_DEFAULT_OBJECT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
AZURE_TENANT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
AZURE_CLIENT_SECRET=xxxxxx-xxxxxxxxxxxx-xxxxxxxxxx-xxxxxxxx
AZURE_DEFAULT_GROUP_NAME=my-resources
AZURE_SUBSCRIPTION_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
AZURE_CLIENT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
AZURE_DEFAULT_LOCATION=uscentral

Run:

from azure.identity import DefaultAzureCredential
from azurify.azsecrets import AzureSecrets

AZURE_KEYVAULT_NAME = "enter your keyvault name here"

def main():
    """Simple test case"""
    azsecrets = AzureSecrets(
        vault_url=f"https://{AZURE_KEYVAULT_NAME}.vault.azure.net/",
        credential=DefaultAzureCredential(),
    )

    print(azsecrets.SHOPDOMAIN)


if __name__ == "__main__":
    main()

Prints myshop.myshopify.com

Package structure

.
├── LICENSE
├── Readme.md
├── azurify
│   ├── Readme.md
│   ├── __init__.py
│   ├── azconverter.py
│   ├── azkeyvault.py
│   ├── azsecrets.py
│   ├── azstorage.py
│   ├── test_azconverter.py
│   ├── test_azkeyvault.py
│   ├── test_azsecrets.py
│   └── test_azstorage.py
├── requirements.txt
├── run.py
└── setup.py

Package creation

Assuming package resides in directory azurify. First run run.pyto check everthing is functioning.

Creating the package

cd azurify
pip install wheel
python3 setup.py bdist_wheel sdist

Local testing

Directory structure:

.
├── azurify
└── testazurify
cd testazurify
python3 -m venv .venv
source .venv/bin/activate
pip install -e ../azurify

Upload to test repository

cd ../azurify
pip install twine
twine check dist/*
twine upload -r testpypi dist/*

Upload to PyPi

twine upload dist/*

Metadata

Release files for azurify 0.72

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for azurify 0.72
File Size Uploaded
azurify-0.72.tar.gz 9.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for azurify 0.72
File Interpreter ABI Platform
azurify-0.72-py3-none-any.whl Python 3 none any Details

Total release size: 20.6 kB

Release files / azurify-0.72.tar.gz

Download URL azurify-0.72.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ea617b421c571f96050fb3a2dfe7ba8a00ce266f4b2450e16ce9e1d1ab4e3721
BLAKE2b-256 checksum
How to use checksums
089ea641415068a2def7671f0195d3ed1814dfb7c07e76cf2d2246f0b26e8569
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Release files / azurify-0.72-py3-none-any.whl

Download URL azurify-0.72-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5b50d98ca09a6a20f15462507c31a857df333918b7a18ae5c6c26bcceb3a2e69
BLAKE2b-256 checksum
How to use checksums
838abbd93994268c5dd67fd7cf85122252775aff4908c4222cb75cb9695f4424
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Release history Release notifications | RSS feed

This release

0.72 This release

2 release files

0.71

2 release files

0.7

2 release files

0.6

2 release files

0.5

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page