File: README.md

package info (click to toggle)
python-azure 20230112%2Bgit-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 749,544 kB
  • sloc: python: 6,815,827; javascript: 287; makefile: 195; xml: 109; sh: 105
file content (56 lines) | stat: -rw-r--r-- 1,752 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
page_type: sample
languages:
  - python
products:
  - azure
  - azure-app-configuration
---

# Azure App Configuration Provider Library Python Samples

## Prerequisites

You must have an [Azure subscription][azure_sub], and a [Configuration Store][configuration_store] to use this package.

To create a Configuration Store, you can either use [Azure Portal](https://ms.portal.azure.com/#create/Microsoft.Azconfig) or if you are using [Azure CLI][azure_cli] you can simply run the following snippet in your console:

```Powershell
az appconfig create --name <config-store-name> --resource-group <resource-group-name> --location eastus
```

### Create Keys

```Powershell
az appconfig kv set --name <config-store-name> --key message --value "hi"
az appconfig kv set --name <config-store-name> --key test.message --value "Hi with test Prefix"
```

### Create Key Vault Reference

Requires Key Vault with Secret already created.

```Powershell
az appconfig kv set-keyvault --name <config-store-name> --key secret --secret-identifier <key-vault-reference>
```

## Setup

Install the Azure App Configuration Provider client library for Python with pip:

```commandline
pip install azure.appconfiguration.provider
```

## Contents

| File | Description |
|-------------|-------------|
| aad_sample.py | demos connecting to app configuration with Azure Active Directory |
| connection_string_sample.py | demos connecting to app configuration with a Connection String |
| key_vault_reference_sample.py | demos resolving key vault references with App Configuration |

<!-- LINKS -->
[azure_sub]: https://azure.microsoft.com/free/
[azure_cli]: https://docs.microsoft.com/cli/azure
[configuration_store]: https://azure.microsoft.com/services/app-configuration/