or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

Files

docs

access-control.mdcache-and-credentials.mdconnected-registries.mdindex.mdprivate-networking.mdregistry-management.mdreplication-management.mdwebhook-management.md

connected-registries.mddocs/

0

# Connected Registries

1

2

Connected registry management for edge computing scenarios, enabling synchronized registry instances at edge locations with configurable sync policies, authentication methods, and operational modes. Connected registries provide local registry functionality while maintaining synchronization with the parent Azure Container Registry.

3

4

## Capabilities

5

6

### Connected Registry Management

7

8

Create, configure, and manage connected registries for edge deployment scenarios with comprehensive synchronization and operational control.

9

10

```python { .api }

11

def begin_create(resource_group_name: str, registry_name: str, connected_registry_name: str, connected_registry_create_parameters: ConnectedRegistry, **kwargs) -> LROPoller[ConnectedRegistry]:

12

"""

13

Create a connected registry for a container registry.

14

15

Parameters:

16

- resource_group_name: str - Name of the resource group

17

- registry_name: str - Name of the parent registry

18

- connected_registry_name: str - Name of the connected registry

19

- connected_registry_create_parameters: ConnectedRegistry - Connected registry configuration

20

21

Returns:

22

LROPoller[ConnectedRegistry] - Long-running operation poller for the connected registry

23

"""

24

25

def begin_delete(resource_group_name: str, registry_name: str, connected_registry_name: str, **kwargs) -> LROPoller[None]:

26

"""

27

Delete a connected registry from a container registry.

28

29

Parameters:

30

- resource_group_name: str - Name of the resource group

31

- registry_name: str - Name of the parent registry

32

- connected_registry_name: str - Name of the connected registry to delete

33

34

Returns:

35

LROPoller[None] - Long-running operation poller

36

"""

37

38

def begin_update(resource_group_name: str, registry_name: str, connected_registry_name: str, connected_registry_update_parameters: ConnectedRegistryUpdateParameters, **kwargs) -> LROPoller[ConnectedRegistry]:

39

"""

40

Update a connected registry for a container registry.

41

42

Parameters:

43

- resource_group_name: str - Name of the resource group

44

- registry_name: str - Name of the parent registry

45

- connected_registry_name: str - Name of the connected registry to update

46

- connected_registry_update_parameters: ConnectedRegistryUpdateParameters - Update parameters

47

48

Returns:

49

LROPoller[ConnectedRegistry] - Long-running operation poller for the updated connected registry

50

"""

51

52

def get(resource_group_name: str, registry_name: str, connected_registry_name: str, **kwargs) -> ConnectedRegistry:

53

"""

54

Get properties of a connected registry.

55

56

Parameters:

57

- resource_group_name: str - Name of the resource group

58

- registry_name: str - Name of the parent registry

59

- connected_registry_name: str - Name of the connected registry

60

61

Returns:

62

ConnectedRegistry - Connected registry resource with complete configuration

63

"""

64

65

def list(resource_group_name: str, registry_name: str, **kwargs) -> ItemPaged[ConnectedRegistry]:

66

"""

67

List all connected registries for a container registry.

68

69

Parameters:

70

- resource_group_name: str - Name of the resource group

71

- registry_name: str - Name of the parent registry

72

73

Returns:

74

ItemPaged[ConnectedRegistry] - Paginated list of all connected registries

75

"""

76

77

def begin_deactivate(resource_group_name: str, registry_name: str, connected_registry_name: str, **kwargs) -> LROPoller[None]:

78

"""

79

Deactivate a connected registry from a container registry.

80

81

Parameters:

82

- resource_group_name: str - Name of the resource group

83

- registry_name: str - Name of the parent registry

84

- connected_registry_name: str - Name of the connected registry to deactivate

85

86

Returns:

87

LROPoller[None] - Long-running operation poller for deactivation

88

"""

89

```

90

91

## Core Model Types

92

93

### ConnectedRegistry

94

95

```python { .api }

96

class ConnectedRegistry:

97

"""

98

An object that represents a connected registry for a container registry.

99

100

Attributes:

101

- id: str - Resource ID

102

- name: str - Resource name

103

- type: str - Resource type

104

- provisioning_state: ProvisioningState - Current provisioning state

105

- mode: ConnectedRegistryMode - Connected registry mode (ReadWrite, ReadOnly, Registry, Mirror)

106

- version: str - Connected registry version

107

- connection_state: ConnectionState - Current connection state

108

- last_activity_time: datetime - Last activity timestamp

109

- activation: ActivationProperties - Activation configuration

110

- parent: ParentProperties - Parent registry configuration

111

- client_token_ids: List[str] - Client token IDs for authentication

112

- login_server: LoginServerProperties - Login server configuration

113

- logging: LoggingProperties - Logging configuration

114

- status_details: List[StatusDetailProperties] - Detailed status information

115

- notifications_list: List[str] - Notification configurations

116

"""

117

```

118

119

### ConnectedRegistryUpdateParameters

120

121

```python { .api }

122

class ConnectedRegistryUpdateParameters:

123

"""

124

Parameters for updating a connected registry.

125

126

Attributes:

127

- sync_properties: SyncProperties - Synchronization properties

128

- logging: LoggingProperties - Logging configuration

129

- client_token_ids: List[str] - Client token IDs

130

- notifications_list: List[str] - Notification configurations

131

"""

132

```

133

134

### ActivationProperties

135

136

```python { .api }

137

class ActivationProperties:

138

"""

139

Properties for connected registry activation.

140

141

Attributes:

142

- status: ActivationStatus - Activation status (Active, Inactive)

143

"""

144

```

145

146

### LoginServerProperties

147

148

```python { .api }

149

class LoginServerProperties:

150

"""

151

Login server properties for connected registry.

152

153

Attributes:

154

- host: str - Login server host

155

- tls: TlsProperties - TLS configuration

156

"""

157

```

158

159

### TlsProperties

160

161

```python { .api }

162

class TlsProperties:

163

"""

164

TLS configuration properties.

165

166

Attributes:

167

- status: TlsStatus - TLS status (Enabled, Disabled)

168

- certificate_type: CertificateType - Certificate type

169

"""

170

```

171

172

### LoggingProperties

173

174

```python { .api }

175

class LoggingProperties:

176

"""

177

Logging properties for connected registry.

178

179

Attributes:

180

- log_level: LogLevel - Log level (Debug, Information, Warning, Error, None)

181

- audit_log_status: AuditLogStatus - Audit log status (Enabled, Disabled)

182

"""

183

```

184

185

### SyncProperties

186

187

```python { .api }

188

class SyncProperties:

189

"""

190

Synchronization properties for connected registry.

191

192

Attributes:

193

- token_id: str - Token ID for synchronization

194

- schedule: str - Synchronization schedule

195

- sync_window: str - Synchronization window

196

- message_ttl: str - Message time-to-live

197

- gateway_endpoint: str - Gateway endpoint for synchronization

198

"""

199

```

200

201

### ParentProperties

202

203

```python { .api }

204

class ParentProperties:

205

"""

206

Parent registry properties for connected registry.

207

208

Attributes:

209

- id: str - Parent registry resource ID

210

- sync_properties: SyncProperties - Synchronization configuration with parent

211

"""

212

```

213

214

## Enums

215

216

### ConnectedRegistryMode

217

218

```python { .api }

219

class ConnectedRegistryMode(str, Enum):

220

"""Connected registry operational modes."""

221

READ_WRITE = "ReadWrite"

222

READ_ONLY = "ReadOnly"

223

REGISTRY = "Registry"

224

MIRROR = "Mirror"

225

```

226

227

### ConnectionState

228

229

```python { .api }

230

class ConnectionState(str, Enum):

231

"""Connected registry connection states."""

232

ONLINE = "Online"

233

OFFLINE = "Offline"

234

SYNCING = "Syncing"

235

UNHEALTHY = "Unhealthy"

236

```

237

238

### ActivationStatus

239

240

```python { .api }

241

class ActivationStatus(str, Enum):

242

"""Connected registry activation status."""

243

ACTIVE = "Active"

244

INACTIVE = "Inactive"

245

```

246

247

### LogLevel

248

249

```python { .api }

250

class LogLevel(str, Enum):

251

"""Logging levels for connected registry."""

252

DEBUG = "Debug"

253

INFORMATION = "Information"

254

WARNING = "Warning"

255

ERROR = "Error"

256

NONE = "None"

257

```

258

259

### AuditLogStatus

260

261

```python { .api }

262

class AuditLogStatus(str, Enum):

263

"""Audit log status options."""

264

ENABLED = "Enabled"

265

DISABLED = "Disabled"

266

```

267

268

### TlsStatus

269

270

```python { .api }

271

class TlsStatus(str, Enum):

272

"""TLS status options."""

273

ENABLED = "Enabled"

274

DISABLED = "Disabled"

275

```

276

277

### CertificateType

278

279

```python { .api }

280

class CertificateType(str, Enum):

281

"""Certificate type options."""

282

LOCAL_DIRECTORY = "LocalDirectory"

283

```

284

285

## Usage Examples

286

287

### Create Connected Registry for Edge Computing

288

289

```python

290

from azure.mgmt.containerregistry import ContainerRegistryManagementClient

291

from azure.mgmt.containerregistry.models import (

292

ConnectedRegistry, ConnectedRegistryMode, ActivationProperties, ActivationStatus,

293

LoginServerProperties, TlsProperties, TlsStatus, CertificateType,

294

LoggingProperties, LogLevel, AuditLogStatus, SyncProperties

295

)

296

from azure.identity import DefaultAzureCredential

297

298

client = ContainerRegistryManagementClient(

299

DefaultAzureCredential(),

300

"subscription-id"

301

)

302

303

# Create a connected registry for edge deployment

304

connected_registry_params = ConnectedRegistry(

305

mode=ConnectedRegistryMode.READ_WRITE,

306

activation=ActivationProperties(

307

status=ActivationStatus.ACTIVE

308

),

309

client_token_ids=[

310

"/subscriptions/sub-id/resourceGroups/rg/providers/Microsoft.ContainerRegistry/registries/parent-registry/tokens/edge-token"

311

],

312

login_server=LoginServerProperties(

313

host="edge-registry.local",

314

tls=TlsProperties(

315

status=TlsStatus.ENABLED,

316

certificate_type=CertificateType.LOCAL_DIRECTORY

317

)

318

),

319

logging=LoggingProperties(

320

log_level=LogLevel.INFORMATION,

321

audit_log_status=AuditLogStatus.ENABLED

322

),

323

parent=ParentProperties(

324

sync_properties=SyncProperties(

325

token_id="/subscriptions/sub-id/resourceGroups/rg/providers/Microsoft.ContainerRegistry/registries/parent-registry/tokens/sync-token",

326

schedule="0 9 * * *", # Daily at 9 AM

327

sync_window="PT1H", # 1 hour sync window

328

message_ttl="P1D" # 1 day message TTL

329

)

330

),

331

notifications_list=["webhook1", "webhook2"]

332

)

333

334

# Create the connected registry

335

creation_poller = client.connected_registries.begin_create(

336

"my-resource-group",

337

"my-parent-registry",

338

"edge-registry",

339

connected_registry_params

340

)

341

342

connected_registry = creation_poller.result()

343

print(f"Created connected registry: {connected_registry.name}")

344

print(f"Mode: {connected_registry.mode}")

345

print(f"Connection State: {connected_registry.connection_state}")

346

```

347

348

### Create Read-Only Mirror for Performance

349

350

```python

351

# Create a read-only connected registry for performance optimization

352

readonly_registry_params = ConnectedRegistry(

353

mode=ConnectedRegistryMode.READ_ONLY,

354

activation=ActivationProperties(

355

status=ActivationStatus.ACTIVE

356

),

357

client_token_ids=[

358

"/subscriptions/sub-id/resourceGroups/rg/providers/Microsoft.ContainerRegistry/registries/parent-registry/tokens/readonly-token"

359

],

360

login_server=LoginServerProperties(

361

host="cache-registry.local",

362

tls=TlsProperties(

363

status=TlsStatus.ENABLED,

364

certificate_type=CertificateType.LOCAL_DIRECTORY

365

)

366

),

367

logging=LoggingProperties(

368

log_level=LogLevel.WARNING, # Less verbose logging

369

audit_log_status=AuditLogStatus.DISABLED

370

),

371

parent=ParentProperties(

372

sync_properties=SyncProperties(

373

token_id="/subscriptions/sub-id/resourceGroups/rg/providers/Microsoft.ContainerRegistry/registries/parent-registry/tokens/sync-token",

374

schedule="0 */6 * * *", # Every 6 hours

375

sync_window="PT30M", # 30 minute sync window

376

message_ttl="PT12H" # 12 hour message TTL

377

)

378

)

379

)

380

381

readonly_registry = client.connected_registries.begin_create(

382

"my-resource-group",

383

"my-parent-registry",

384

"cache-registry",

385

readonly_registry_params

386

).result()

387

388

print(f"Created read-only connected registry: {readonly_registry.name}")

389

```

390

391

### Monitor Connected Registry Status

392

393

```python

394

# List all connected registries and monitor their status

395

connected_registries = client.connected_registries.list(

396

"my-resource-group",

397

"my-parent-registry"

398

)

399

400

print("Connected Registries Status:")

401

print("-" * 50)

402

for registry in connected_registries:

403

print(f"Registry: {registry.name}")

404

print(f" Mode: {registry.mode}")

405

print(f" Connection State: {registry.connection_state}")

406

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

407

print(f" Last Activity: {registry.last_activity_time}")

408

print(f" Activation Status: {registry.activation.status}")

409

print(f" Login Server: {registry.login_server.host}")

410

print(f" Log Level: {registry.logging.log_level}")

411

412

if registry.status_details:

413

print(" Status Details:")

414

for detail in registry.status_details:

415

print(f" - {detail}")

416

print()

417

```

418

419

### Update Connected Registry Configuration

420

421

```python

422

from azure.mgmt.containerregistry.models import ConnectedRegistryUpdateParameters

423

424

# Update sync properties and logging configuration

425

update_params = ConnectedRegistryUpdateParameters(

426

sync_properties=SyncProperties(

427

schedule="0 */4 * * *", # Every 4 hours instead of 6

428

sync_window="PT45M", # Longer sync window

429

message_ttl="P2D" # Longer message TTL

430

),

431

logging=LoggingProperties(

432

log_level=LogLevel.DEBUG, # More verbose logging

433

audit_log_status=AuditLogStatus.ENABLED

434

),

435

notifications_list=["webhook1", "webhook2", "webhook3"] # Add notification

436

)

437

438

updated_registry = client.connected_registries.begin_update(

439

"my-resource-group",

440

"my-parent-registry",

441

"cache-registry",

442

update_params

443

).result()

444

445

print(f"Updated connected registry: {updated_registry.name}")

446

print(f"New sync schedule: {updated_registry.parent.sync_properties.schedule}")

447

```

448

449

### Manage Connected Registry Lifecycle

450

451

```python

452

def manage_connected_registry_lifecycle(client, resource_group, parent_registry, connected_registry_name, action):

453

"""

454

Manage connected registry lifecycle operations.

455

"""

456

457

if action == "deactivate":

458

# Deactivate connected registry

459

print(f"Deactivating connected registry: {connected_registry_name}")

460

deactivation_poller = client.connected_registries.begin_deactivate(

461

resource_group,

462

parent_registry,

463

connected_registry_name

464

)

465

deactivation_poller.result()

466

print("Connected registry deactivated")

467

468

elif action == "reactivate":

469

# Reactivate by updating activation status

470

update_params = ConnectedRegistryUpdateParameters(

471

activation=ActivationProperties(

472

status=ActivationStatus.ACTIVE

473

)

474

)

475

476

reactivation_poller = client.connected_registries.begin_update(

477

resource_group,

478

parent_registry,

479

connected_registry_name,

480

update_params

481

)

482

reactivated_registry = reactivation_poller.result()

483

print(f"Connected registry reactivated: {reactivated_registry.activation.status}")

484

485

elif action == "delete":

486

# Delete connected registry

487

print(f"Deleting connected registry: {connected_registry_name}")

488

deletion_poller = client.connected_registries.begin_delete(

489

resource_group,

490

parent_registry,

491

connected_registry_name

492

)

493

deletion_poller.result()

494

print("Connected registry deleted")

495

496

# Example usage

497

manage_connected_registry_lifecycle(

498

client,

499

"my-resource-group",

500

"my-parent-registry",

501

"cache-registry",

502

"deactivate"

503

)

504

```

505

506

### Set Up Multi-Site Connected Registry Architecture

507

508

```python

509

# Set up connected registries for multiple edge sites

510

edge_sites = [

511

{

512

"name": "factory-east",

513

"host": "registry.factory-east.local",

514

"mode": ConnectedRegistryMode.READ_WRITE,

515

"sync_schedule": "0 8 * * *", # 8 AM daily

516

"log_level": LogLevel.INFORMATION

517

},

518

{

519

"name": "factory-west",

520

"host": "registry.factory-west.local",

521

"mode": ConnectedRegistryMode.READ_WRITE,

522

"sync_schedule": "0 20 * * *", # 8 PM daily

523

"log_level": LogLevel.INFORMATION

524

},

525

{

526

"name": "warehouse-cache",

527

"host": "registry.warehouse.local",

528

"mode": ConnectedRegistryMode.READ_ONLY,

529

"sync_schedule": "0 */12 * * *", # Every 12 hours

530

"log_level": LogLevel.WARNING

531

}

532

]

533

534

created_registries = []

535

536

for site in edge_sites:

537

registry_params = ConnectedRegistry(

538

mode=site["mode"],

539

activation=ActivationProperties(status=ActivationStatus.ACTIVE),

540

client_token_ids=[

541

f"/subscriptions/sub-id/resourceGroups/rg/providers/Microsoft.ContainerRegistry/registries/parent-registry/tokens/{site['name']}-token"

542

],

543

login_server=LoginServerProperties(

544

host=site["host"],

545

tls=TlsProperties(

546

status=TlsStatus.ENABLED,

547

certificate_type=CertificateType.LOCAL_DIRECTORY

548

)

549

),

550

logging=LoggingProperties(

551

log_level=site["log_level"],

552

audit_log_status=AuditLogStatus.ENABLED if site["mode"] == ConnectedRegistryMode.READ_WRITE else AuditLogStatus.DISABLED

553

),

554

parent=ParentProperties(

555

sync_properties=SyncProperties(

556

token_id=f"/subscriptions/sub-id/resourceGroups/rg/providers/Microsoft.ContainerRegistry/registries/parent-registry/tokens/{site['name']}-sync-token",

557

schedule=site["sync_schedule"],

558

sync_window="PT1H",

559

message_ttl="P1D"

560

)

561

)

562

)

563

564

registry = client.connected_registries.begin_create(

565

"my-resource-group",

566

"my-parent-registry",

567

site["name"],

568

registry_params

569

).result()

570

571

created_registries.append(registry)

572

print(f"Created connected registry for {site['name']}: {registry.login_server.host}")

573

574

print(f"\nTotal connected registries created: {len(created_registries)}")

575

576

# Monitor all connected registries

577

print("\nConnected Registry Health Check:")

578

print("=" * 50)

579

for registry in created_registries:

580

health_status = "Healthy" if registry.connection_state == ConnectionState.ONLINE else "Unhealthy"

581

print(f"{registry.name}: {health_status} ({registry.connection_state})")

582

```

583

584

### Troubleshoot Connected Registry Issues

585

586

```python

587

def diagnose_connected_registry(client, resource_group, parent_registry, connected_registry_name):

588

"""

589

Diagnose issues with a connected registry.

590

"""

591

592

# Get connected registry details

593

registry = client.connected_registries.get(

594

resource_group,

595

parent_registry,

596

connected_registry_name

597

)

598

599

diagnosis = {

600

"registry_name": registry.name,

601

"issues": [],

602

"recommendations": []

603

}

604

605

# Check connection state

606

if registry.connection_state != ConnectionState.ONLINE:

607

diagnosis["issues"].append(f"Connection state is {registry.connection_state}")

608

if registry.connection_state == ConnectionState.OFFLINE:

609

diagnosis["recommendations"].append("Check network connectivity and firewall rules")

610

elif registry.connection_state == ConnectionState.UNHEALTHY:

611

diagnosis["recommendations"].append("Check connected registry logs and system health")

612

613

# Check activation status

614

if registry.activation.status != ActivationStatus.ACTIVE:

615

diagnosis["issues"].append(f"Registry is not active: {registry.activation.status}")

616

diagnosis["recommendations"].append("Activate the connected registry")

617

618

# Check provisioning state

619

if registry.provisioning_state != ProvisioningState.SUCCEEDED:

620

diagnosis["issues"].append(f"Provisioning state: {registry.provisioning_state}")

621

diagnosis["recommendations"].append("Check provisioning logs and retry if failed")

622

623

# Check last activity time

624

if registry.last_activity_time:

625

import datetime

626

time_since_activity = datetime.datetime.utcnow() - registry.last_activity_time

627

if time_since_activity.total_seconds() > 86400: # 24 hours

628

diagnosis["issues"].append(f"No activity for {time_since_activity}")

629

diagnosis["recommendations"].append("Check synchronization configuration and network connectivity")

630

631

# Check status details for specific errors

632

if registry.status_details:

633

for detail in registry.status_details:

634

if "error" in detail.lower() or "fail" in detail.lower():

635

diagnosis["issues"].append(f"Status detail: {detail}")

636

diagnosis["recommendations"].append("Review detailed error messages and correct configuration")

637

638

return diagnosis

639

640

# Diagnose a problematic connected registry

641

diagnosis = diagnose_connected_registry(

642

client,

643

"my-resource-group",

644

"my-parent-registry",

645

"problematic-registry"

646

)

647

648

print("Connected Registry Diagnosis:")

649

print("=" * 40)

650

print(f"Registry: {diagnosis['registry_name']}")

651

652

if diagnosis["issues"]:

653

print("\nIssues Found:")

654

for issue in diagnosis["issues"]:

655

print(f" - {issue}")

656

657

print("\nRecommendations:")

658

for rec in diagnosis["recommendations"]:

659

print(f" - {rec}")

660

else:

661

print("\nNo issues detected - registry appears healthy")

662

```