or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

Files

docs

configuration-stores.mdindex.mdkey-values.mdmodels-and-types.mdoperations.mdprivate-networking.mdreplicas.mdsnapshots.md

configuration-stores.mddocs/

0

# Configuration Store Operations

1

2

The `ConfigurationStoresOperations` class provides comprehensive management capabilities for Azure App Configuration stores, including creation, deletion, updates, key management, and soft delete operations.

3

4

## Operations Class

5

6

```python { .api }

7

class ConfigurationStoresOperations:

8

"""

9

Operations for managing Azure App Configuration stores.

10

11

This class provides methods for the complete lifecycle management of App Configuration stores,

12

including provisioning, configuration updates, access key management, and deletion with

13

soft delete and recovery capabilities.

14

"""

15

```

16

17

## Store Lifecycle Management

18

19

### List Configuration Stores

20

21

```python { .api }

22

def list(

23

self,

24

skip_token: Optional[str] = None,

25

**kwargs: Any

26

) -> ItemPaged[ConfigurationStore]:

27

"""

28

Lists all App Configuration stores within a subscription.

29

30

Args:

31

skip_token: A skip token to retrieve the next set of results, if any.

32

**kwargs: Additional keyword arguments for the request.

33

34

Returns:

35

ItemPaged[ConfigurationStore]: A paged collection of configuration stores.

36

37

Example:

38

>>> stores = client.configuration_stores.list()

39

>>> for store in stores:

40

... print(f"{store.name}: {store.provisioning_state}")

41

"""

42

```

43

44

```python { .api }

45

def list_by_resource_group(

46

self,

47

resource_group_name: str,

48

skip_token: Optional[str] = None,

49

**kwargs: Any

50

) -> ItemPaged[ConfigurationStore]:

51

"""

52

Lists App Configuration stores within a specific resource group.

53

54

Args:

55

resource_group_name: The name of the resource group.

56

skip_token: A skip token to retrieve the next set of results, if any.

57

**kwargs: Additional keyword arguments for the request.

58

59

Returns:

60

ItemPaged[ConfigurationStore]: A paged collection of configuration stores in the resource group.

61

62

Example:

63

>>> stores = client.configuration_stores.list_by_resource_group("my-rg")

64

>>> print(f"Found {len(list(stores))} stores in resource group")

65

"""

66

```

67

68

### Get Configuration Store

69

70

```python { .api }

71

def get(

72

self,

73

resource_group_name: str,

74

config_store_name: str,

75

**kwargs: Any

76

) -> ConfigurationStore:

77

"""

78

Gets the properties of an App Configuration store.

79

80

Args:

81

resource_group_name: The name of the resource group containing the store.

82

config_store_name: The name of the configuration store.

83

**kwargs: Additional keyword arguments for the request.

84

85

Returns:

86

ConfigurationStore: The configuration store details.

87

88

Raises:

89

HttpResponseError: If the store is not found or access is denied.

90

91

Example:

92

>>> store = client.configuration_stores.get("my-rg", "my-store")

93

>>> print(f"Store endpoint: {store.endpoint}")

94

>>> print(f"Store SKU: {store.sku.name}")

95

"""

96

```

97

98

### Create Configuration Store

99

100

```python { .api }

101

def begin_create(

102

self,

103

resource_group_name: str,

104

config_store_name: str,

105

config_store_creation_parameters: ConfigurationStore,

106

**kwargs: Any

107

) -> LROPoller[ConfigurationStore]:

108

"""

109

Creates a new App Configuration store with the specified parameters.

110

111

Args:

112

resource_group_name: The name of the resource group.

113

config_store_name: The name of the configuration store (5-50 characters, alphanumeric and hyphens).

114

config_store_creation_parameters: Configuration store creation parameters.

115

**kwargs: Additional keyword arguments for the request.

116

117

Returns:

118

LROPoller[ConfigurationStore]: A poller for the long-running create operation.

119

120

Example:

121

>>> from azure.mgmt.appconfiguration.models import ConfigurationStore, Sku

122

>>> store_params = ConfigurationStore(

123

... location="East US",

124

... sku=Sku(name="Free"),

125

... tags={"Environment": "Production"}

126

... )

127

>>> poller = client.configuration_stores.begin_create(

128

... "my-rg", "my-store", store_params

129

... )

130

>>> store = poller.result() # Wait for completion

131

"""

132

```

133

134

### Update Configuration Store

135

136

```python { .api }

137

def begin_update(

138

self,

139

resource_group_name: str,

140

config_store_name: str,

141

config_store_update_parameters: ConfigurationStoreUpdateParameters,

142

**kwargs: Any

143

) -> LROPoller[ConfigurationStore]:

144

"""

145

Updates the properties of an existing App Configuration store.

146

147

Args:

148

resource_group_name: The name of the resource group.

149

config_store_name: The name of the configuration store.

150

config_store_update_parameters: Configuration store update parameters.

151

**kwargs: Additional keyword arguments for the request.

152

153

Returns:

154

LROPoller[ConfigurationStore]: A poller for the long-running update operation.

155

156

Example:

157

>>> from azure.mgmt.appconfiguration.models import ConfigurationStoreUpdateParameters

158

>>> update_params = ConfigurationStoreUpdateParameters(

159

... tags={"Environment": "Production", "Team": "DevOps"},

160

... sku=Sku(name="Standard")

161

... )

162

>>> poller = client.configuration_stores.begin_update(

163

... "my-rg", "my-store", update_params

164

... )

165

>>> updated_store = poller.result()

166

"""

167

```

168

169

### Delete Configuration Store

170

171

```python { .api }

172

def begin_delete(

173

self,

174

resource_group_name: str,

175

config_store_name: str,

176

**kwargs: Any

177

) -> LROPoller[None]:

178

"""

179

Deletes an App Configuration store. The store enters a soft-deleted state.

180

181

Args:

182

resource_group_name: The name of the resource group.

183

config_store_name: The name of the configuration store.

184

**kwargs: Additional keyword arguments for the request.

185

186

Returns:

187

LROPoller[None]: A poller for the long-running delete operation.

188

189

Note:

190

Deleted stores enter a soft-deleted state and can be recovered within the retention period.

191

Use purge_deleted() to permanently delete a store.

192

193

Example:

194

>>> poller = client.configuration_stores.begin_delete("my-rg", "my-store")

195

>>> poller.wait() # Wait for deletion to complete

196

>>> print("Store deleted (soft delete)")

197

"""

198

```

199

200

## Access Key Management

201

202

### List Access Keys

203

204

```python { .api }

205

def list_keys(

206

self,

207

resource_group_name: str,

208

config_store_name: str,

209

skip_token: Optional[str] = None,

210

**kwargs: Any

211

) -> ItemPaged[ApiKey]:

212

"""

213

Lists the access keys for an App Configuration store.

214

215

Args:

216

resource_group_name: The name of the resource group.

217

config_store_name: The name of the configuration store.

218

skip_token: A skip token to retrieve the next set of results, if any.

219

**kwargs: Additional keyword arguments for the request.

220

221

Returns:

222

ItemPaged[ApiKey]: A paged collection of API keys for the store.

223

224

Example:

225

>>> keys = client.configuration_stores.list_keys("my-rg", "my-store")

226

>>> for key in keys:

227

... print(f"Key: {key.name}, Read-only: {key.read_only}")

228

... print(f"Connection string: {key.connection_string}")

229

"""

230

```

231

232

### Regenerate Access Key

233

234

```python { .api }

235

def regenerate_key(

236

self,

237

resource_group_name: str,

238

config_store_name: str,

239

regenerate_key_parameters: RegenerateKeyParameters,

240

**kwargs: Any

241

) -> ApiKey:

242

"""

243

Regenerates an access key for an App Configuration store.

244

245

Args:

246

resource_group_name: The name of the resource group.

247

config_store_name: The name of the configuration store.

248

regenerate_key_parameters: Parameters for key regeneration.

249

**kwargs: Additional keyword arguments for the request.

250

251

Returns:

252

ApiKey: The regenerated API key with new connection string.

253

254

Example:

255

>>> from azure.mgmt.appconfiguration.models import RegenerateKeyParameters

256

>>> regen_params = RegenerateKeyParameters(id="key-id")

257

>>> new_key = client.configuration_stores.regenerate_key(

258

... "my-rg", "my-store", regen_params

259

... )

260

>>> print(f"New connection string: {new_key.connection_string}")

261

"""

262

```

263

264

## Soft Delete Management

265

266

### List Deleted Stores

267

268

```python { .api }

269

def list_deleted(self, **kwargs: Any) -> ItemPaged[DeletedConfigurationStore]:

270

"""

271

Lists all soft-deleted App Configuration stores in the subscription.

272

273

Args:

274

**kwargs: Additional keyword arguments for the request.

275

276

Returns:

277

ItemPaged[DeletedConfigurationStore]: A paged collection of deleted configuration stores.

278

279

Example:

280

>>> deleted_stores = client.configuration_stores.list_deleted()

281

>>> for store in deleted_stores:

282

... print(f"Deleted store: {store.name}")

283

... print(f"Deletion date: {store.deletion_date}")

284

... print(f"Scheduled purge date: {store.scheduled_purge_date}")

285

"""

286

```

287

288

### Get Deleted Store

289

290

```python { .api }

291

def get_deleted(

292

self,

293

location: str,

294

config_store_name: str,

295

**kwargs: Any

296

) -> DeletedConfigurationStore:

297

"""

298

Gets the properties of a soft-deleted App Configuration store.

299

300

Args:

301

location: The location where the store was deleted.

302

config_store_name: The name of the deleted configuration store.

303

**kwargs: Additional keyword arguments for the request.

304

305

Returns:

306

DeletedConfigurationStore: The deleted configuration store details.

307

308

Example:

309

>>> deleted_store = client.configuration_stores.get_deleted(

310

... "eastus", "my-deleted-store"

311

... )

312

>>> print(f"Can be recovered until: {deleted_store.scheduled_purge_date}")

313

"""

314

```

315

316

### Purge Deleted Store

317

318

```python { .api }

319

def begin_purge_deleted(

320

self,

321

location: str,

322

config_store_name: str,

323

**kwargs: Any

324

) -> LROPoller[None]:

325

"""

326

Permanently deletes (purges) a soft-deleted App Configuration store.

327

328

Args:

329

location: The location where the store was deleted.

330

config_store_name: The name of the deleted configuration store.

331

**kwargs: Additional keyword arguments for the request.

332

333

Returns:

334

LROPoller[None]: A poller for the long-running purge operation.

335

336

Warning:

337

This operation is irreversible. The store and all its data will be permanently lost.

338

339

Example:

340

>>> poller = client.configuration_stores.begin_purge_deleted(

341

... "eastus", "my-deleted-store"

342

... )

343

>>> poller.wait() # Wait for purge to complete

344

>>> print("Store permanently deleted")

345

"""

346

```

347

348

## Practical Usage Examples

349

350

### Complete Store Creation Workflow

351

352

```python { .api }

353

from azure.mgmt.appconfiguration import AppConfigurationManagementClient

354

from azure.mgmt.appconfiguration.models import (

355

ConfigurationStore,

356

Sku,

357

PublicNetworkAccess,

358

EncryptionProperties,

359

KeyVaultProperties

360

)

361

from azure.identity import DefaultAzureCredential

362

363

# Initialize client

364

credential = DefaultAzureCredential()

365

client = AppConfigurationManagementClient(credential, "subscription-id")

366

367

# Create store with advanced configuration

368

store_params = ConfigurationStore(

369

location="East US",

370

sku=Sku(name="Standard"),

371

tags={

372

"Environment": "Production",

373

"Team": "Platform",

374

"CostCenter": "Engineering"

375

},

376

public_network_access=PublicNetworkAccess.ENABLED,

377

# Optional: Configure customer-managed encryption

378

encryption=EncryptionProperties(

379

key_vault_properties=KeyVaultProperties(

380

key_identifier="https://myvault.vault.azure.net/keys/mykey",

381

identity_client_id="client-id-of-managed-identity"

382

)

383

)

384

)

385

386

# Create the store

387

print("Creating App Configuration store...")

388

create_poller = client.configuration_stores.begin_create(

389

resource_group_name="my-resource-group",

390

config_store_name="my-production-store",

391

config_store_creation_parameters=store_params

392

)

393

394

# Monitor progress

395

while not create_poller.done():

396

print("Store creation in progress...")

397

time.sleep(10)

398

399

# Get the created store

400

store = create_poller.result()

401

print(f"Store created successfully!")

402

print(f"Name: {store.name}")

403

print(f"Endpoint: {store.endpoint}")

404

print(f"Provisioning State: {store.provisioning_state}")

405

```

406

407

### Key Rotation Workflow

408

409

```python { .api }

410

from azure.mgmt.appconfiguration.models import RegenerateKeyParameters

411

412

# List current keys

413

print("Current access keys:")

414

keys = client.configuration_stores.list_keys("my-rg", "my-store")

415

key_list = list(keys)

416

417

for key in key_list:

418

print(f"Key ID: {key.id}")

419

print(f"Name: {key.name}")

420

print(f"Read-only: {key.read_only}")

421

print(f"Last modified: {key.last_modified}")

422

print("---")

423

424

# Regenerate the primary key (typically the first non-read-only key)

425

primary_key = next(key for key in key_list if not key.read_only)

426

print(f"Regenerating key: {primary_key.name}")

427

428

regen_params = RegenerateKeyParameters(id=primary_key.id)

429

new_key = client.configuration_stores.regenerate_key(

430

"my-rg", "my-store", regen_params

431

)

432

433

print(f"Key regenerated successfully!")

434

print(f"New connection string: {new_key.connection_string}")

435

```

436

437

### Soft Delete Recovery Workflow

438

439

```python { .api }

440

# Check for deleted stores that can be recovered

441

print("Checking for recoverable stores...")

442

deleted_stores = client.configuration_stores.list_deleted()

443

444

for store in deleted_stores:

445

print(f"Deleted store: {store.name}")

446

print(f"Original location: {store.location}")

447

print(f"Deletion date: {store.deletion_date}")

448

print(f"Scheduled purge: {store.scheduled_purge_date}")

449

450

# Check if store can still be recovered

451

import datetime

452

if store.scheduled_purge_date > datetime.datetime.now(datetime.timezone.utc):

453

print(f"✓ Store '{store.name}' can be recovered")

454

455

# To recover, create a new store with the same name and CreateMode.RECOVER

456

from azure.mgmt.appconfiguration.models import CreateMode

457

recovery_params = ConfigurationStore(

458

location=store.location,

459

sku=Sku(name="Standard"), # Must specify SKU for recovery

460

create_mode=CreateMode.RECOVER

461

)

462

463

print(f"Recovering store '{store.name}'...")

464

recover_poller = client.configuration_stores.begin_create(

465

store.resource_group,

466

store.name,

467

recovery_params

468

)

469

recovered_store = recover_poller.result()

470

print(f"Store recovered successfully: {recovered_store.endpoint}")

471

else:

472

print(f"✗ Store '{store.name}' is past recovery period")

473

```

474

475

### Store Monitoring and Management

476

477

```python { .api }

478

# Get comprehensive store information

479

def get_store_summary(resource_group: str, store_name: str):

480

# Get store details

481

store = client.configuration_stores.get(resource_group, store_name)

482

483

print(f"=== Store Summary: {store.name} ===")

484

print(f"Resource Group: {resource_group}")

485

print(f"Location: {store.location}")

486

print(f"SKU: {store.sku.name}")

487

print(f"Provisioning State: {store.provisioning_state}")

488

print(f"Creation Date: {store.creation_date}")

489

print(f"Endpoint: {store.endpoint}")

490

print(f"Public Network Access: {store.public_network_access}")

491

492

# List access keys

493

print("\nAccess Keys:")

494

keys = client.configuration_stores.list_keys(resource_group, store_name)

495

for key in keys:

496

key_type = "Read-Write" if not key.read_only else "Read-Only"

497

print(f" - {key.name} ({key_type})")

498

499

# Check for replicas

500

replicas = client.replicas.list_by_configuration_store(resource_group, store_name)

501

replica_count = len(list(replicas))

502

print(f"Replicas: {replica_count}")

503

504

# Check for private endpoints

505

private_endpoints = client.private_endpoint_connections.list_by_configuration_store(

506

resource_group, store_name

507

)

508

pe_count = len(list(private_endpoints))

509

print(f"Private Endpoints: {pe_count}")

510

511

if store.tags:

512

print("Tags:")

513

for key, value in store.tags.items():

514

print(f" {key}: {value}")

515

516

# Usage

517

get_store_summary("my-resource-group", "my-store")

518

```

519

520

## Asynchronous Operations

521

522

All operations are available in asynchronous versions:

523

524

```python { .api }

525

from azure.mgmt.appconfiguration.aio import AppConfigurationManagementClient

526

from azure.identity.aio import DefaultAzureCredential

527

528

async def async_store_operations():

529

credential = DefaultAzureCredential()

530

async with AppConfigurationManagementClient(credential, "subscription-id") as client:

531

# List stores asynchronously

532

stores = client.configuration_stores.list()

533

async for store in stores:

534

print(f"Store: {store.name}")

535

536

# Create store asynchronously

537

store_params = ConfigurationStore(location="East US", sku=Sku(name="Free"))

538

create_poller = await client.configuration_stores.begin_create(

539

"my-rg", "async-store", store_params

540

)

541

store = await create_poller.result()

542

print(f"Created: {store.name}")

543

544

# Run the async function

545

import asyncio

546

asyncio.run(async_store_operations())

547

```