|
| 1 | +# apiops apic |
| 2 | + |
| 3 | +Back up and restore Azure API Center (`Microsoft.ApiCenter`) service configuration. The `apic` command group operates on Azure API Center; use [`apiops extract`](extract.md) and [`apiops publish`](publish.md) for Azure API Management services. |
| 4 | + |
| 5 | +## Extract |
| 6 | + |
| 7 | +Extract API Center resources and API definition specifications to local artifacts. |
| 8 | + |
| 9 | +```bash |
| 10 | +apiops apic extract --resource-group <rg> --service-name <name> [options] |
| 11 | +``` |
| 12 | + |
| 13 | +### Examples |
| 14 | + |
| 15 | +```bash |
| 16 | +# Extract the complete service |
| 17 | +apiops apic extract \ |
| 18 | + --subscription-id 00000000-0000-0000-0000-000000000000 \ |
| 19 | + --resource-group my-rg \ |
| 20 | + --service-name my-api-center |
| 21 | + |
| 22 | +# Extract one workspace without downloading specifications |
| 23 | +apiops apic extract \ |
| 24 | + --resource-group my-rg \ |
| 25 | + --service-name my-api-center \ |
| 26 | + --workspace engineering \ |
| 27 | + --output ./backups/api-center \ |
| 28 | + --no-specifications |
| 29 | +``` |
| 30 | + |
| 31 | +### Flags |
| 32 | + |
| 33 | +| Flag | Type | Default | Required | Description | |
| 34 | +|------|------|---------|----------|-------------| |
| 35 | +| `--resource-group <rg>` | string | — | Yes | Azure resource group name | |
| 36 | +| `--service-name <name>` | string | — | Yes | API Center service instance name | |
| 37 | +| `--workspace <name>` | string | — | No | Restrict extraction to one workspace | |
| 38 | +| `--output <dir>` | string | `./apic-artifacts` | No | Output directory path | |
| 39 | +| `--no-specifications` | boolean | false | No | Skip exporting API definition specifications | |
| 40 | + |
| 41 | +## Publish |
| 42 | + |
| 43 | +Publish local API Center artifacts and API definition specifications to a service. |
| 44 | + |
| 45 | +```bash |
| 46 | +apiops apic publish --resource-group <rg> --service-name <name> [options] |
| 47 | +``` |
| 48 | + |
| 49 | +### Examples |
| 50 | + |
| 51 | +```bash |
| 52 | +# Preview the restore |
| 53 | +apiops apic publish \ |
| 54 | + --resource-group my-rg \ |
| 55 | + --service-name my-api-center \ |
| 56 | + --source ./backups/api-center \ |
| 57 | + --dry-run |
| 58 | + |
| 59 | +# Publish resources without importing specifications |
| 60 | +apiops apic publish \ |
| 61 | + --resource-group my-rg \ |
| 62 | + --service-name my-api-center \ |
| 63 | + --no-specifications |
| 64 | +``` |
| 65 | + |
| 66 | +### Flags |
| 67 | + |
| 68 | +| Flag | Type | Default | Required | Description | |
| 69 | +|------|------|---------|----------|-------------| |
| 70 | +| `--resource-group <rg>` | string | — | Yes | Azure resource group name | |
| 71 | +| `--service-name <name>` | string | — | Yes | API Center service instance name | |
| 72 | +| `--source <dir>` | string | `./apic-artifacts` | No | Source directory containing artifacts | |
| 73 | +| `--dry-run` | boolean | false | No | Preview changes without applying them | |
| 74 | +| `--no-specifications` | boolean | false | No | Skip importing API definition specifications | |
| 75 | + |
| 76 | +## Global Flags |
| 77 | + |
| 78 | +Both subcommands inherit the CLI's global flags, including `--subscription-id`, `--cloud`, `--log-level`, `--format`, and service-principal authentication options. The subscription can also be supplied through `AZURE_SUBSCRIPTION_ID`. |
| 79 | + |
| 80 | +Authentication uses the same `DefaultAzureCredential` chain as the APIM commands. See the [authentication guide](../guides/authentication.md) for supported local and CI/CD authentication methods. |
| 81 | + |
| 82 | +Use `--format json` for machine-readable results. Exit codes follow the shared [CLI exit-code contract](../reference/exit-codes.md). |
0 commit comments