Skip to main content

Tools for Azure

Project description

AzureToolbox

Build, test and Package

Utilities for working with Azure services. This version provides tools for:

  • Keyvault
  • Database

Installation

pip install azuretoolbox

Keyvault

Get secrets from Azure Keyvault.

Prerequisites

To use the Keyvault utilities, you need to have the following environment variables set:

  • AZURE_TENANT_ID
  • AZURE_CLIENT_ID
  • AZURE_CLIENT_SECRET
export AZURE_TENANT_ID="<your-tenant-id>"
export AZURE_CLIENT_ID="<your-client-id>"
export AZURE_CLIENT_SECRET="<your-client-secret>"

Usage

from azuretoolbox.keyvault import KeyVault

vault_url = "https://<keyvault-name>.vault.azure.net"
secret = KeyVault(vault_url).get_secret("SecretName")
print(secret)

Database

Connect to and query an Azure SQL Database.

Prequisites

To use the Database utilities, you need to have ODBC Driver 18 for SQL Server installed. You can download it from here.

Usage

from azuretoolbox.database import Database

db = Database()
server = '<server>' # Typically 'tcp:<server-name>.database.windows.net,1433'
database = '<database-name>'
username = '<username>'
password = '<password>'
db.connect(server, database, username, password)

print(db.query('<query-string>'))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

azuretoolbox-1.0.6.tar.gz (5.4 kB view hashes)

Uploaded Source

Built Distribution

azuretoolbox-1.0.6-py3-none-any.whl (4.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page