Metadata-Version: 2.1
Name: azure-integration
Version: 0.0.3
Summary: Microsoft Azure Integration
Home-page: https://github.com/IOMehran/azure-integration
Author: Mehran Zolghadr
Author-email: mehran@keyleadhealth.com
License: UNKNOWN
Download-URL: https://github.com/IOMehran/azure-integration/archive/refs/tags/v0.0.3.tar.gz
Project-URL: Bug Tracker, https://github.com/IOMehran/azure-integration/issues
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: azure-common (==1.1.27)
Requires-Dist: azure-core (==1.13.0)
Requires-Dist: azure-identity (==1.5.0)
Requires-Dist: azure-keyvault (==4.1.0)
Requires-Dist: azure-keyvault-certificates (==4.2.1)
Requires-Dist: azure-keyvault-keys (==4.3.1)
Requires-Dist: azure-keyvault-secrets (==4.2.0)
Requires-Dist: build (==0.3.1.post1)
Requires-Dist: certifi (==2020.12.5)
Requires-Dist: cffi (==1.14.5)
Requires-Dist: chardet (==4.0.0)
Requires-Dist: cryptography (==3.4.7)
Requires-Dist: idna (==2.10)
Requires-Dist: isodate (==0.6.0)
Requires-Dist: msal (==1.11.0)
Requires-Dist: msal-extensions (==0.3.0)
Requires-Dist: msrest (==0.6.21)
Requires-Dist: oauthlib (==3.1.0)
Requires-Dist: packaging (==20.9)
Requires-Dist: pep517 (==0.10.0)
Requires-Dist: portalocker (==1.7.1)
Requires-Dist: pycparser (==2.20)
Requires-Dist: PyJWT (==2.0.1)
Requires-Dist: pyparsing (==2.4.7)
Requires-Dist: python-dotenv (==0.17.0)
Requires-Dist: requests (==2.25.1)
Requires-Dist: requests-oauthlib (==1.3.0)
Requires-Dist: six (==1.15.0)
Requires-Dist: toml (==0.10.2)
Requires-Dist: urllib3 (==1.26.4)
Requires-Dist: gobject

# Azure Integration

this package is an azure integration to use in the DTRG team.

for now, we just have vault integration in the package.

# HOW TO USE
### - From pypi
first, you need to install the package. to do so create a personal access token and then connect to the feed [according to these instructions.](https://dev.azure.com/keyleadhealth/Klinik/_packaging?_a=connect&feed=azure-integration) (choose pip)

then install the package:
```shell
$ pip install azure-integration==0.0.2
```

### - From Azure Artifacts
there's another way to get the package from azure artifacts, by running this command:
```shell
$ az artifacts universal download \
  --organization "https://dev.azure.com/keyleadhealth/" \
  --project "da4824a3-d087-4024-a144-a3d3265a9d6e" \
  --scope project \
  --feed "azure-integration" \
  --name "azure-integration" \
  --version "0.0.2" \
  --path .
```

then install the package using pip through your environment:
```shell
$ pip install azure_integration-0.0.1-py3-none-any.whl
```

you need to set these env variables to access to azure:
```shell
AZURE_CLIENT_ID=YOUR_CLIENT_ID
AZURE_CLIENT_SECRET=YOUR_CLIENT_SECRET
AZURE_TENANT_ID=YOUR_TENANT_ID
```

then you can use it like this:
```python
from keyvault import SecretClient

client = SecretClient(VAULT_NAME)
client.get_secret(SECRET_NAME)  # this returns KeyVaultSecret object
client.get_secret(SECRET_NAME).value  # this returns secret value as string
```

also, you can get a dict of secrets wherever you need, ex setting.py:
```python
from keyvault import SecretClient

[... whatever settings ...]

client = SecretClient(VAULT_NAME)
needed_secrets = {
    "SECRET_NAME": "SECRET_VERSION", # you can leave version blank
    "SECOND_SECRET_NAME": "SECOND_SECRET_VERSION"
}
c.get_secrets(needed_secrets)  # this will return results as KeyVaultSecret
c.get_secrets_values(needed_secrets)  # this will return results as str
```
note that you don't need to assign `get_secrets` and `get_secrets_values` functions' return value and that's because it will modify the given dict object and you can access the values within it.

# HOW TO BUILD
if you want to build the module yourself follow the steps:
- clone this repository.
- create a venv inside it.
- install requirements by running:
```shell
$ pip install -r requirements.txt
```
- then build it:
```shell
$ python -m build
```


