你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
az sql mi-arc config
Note
This reference is part of the arcdata extension for the Azure CLI (version 2.3.1 or higher). The extension will automatically install the first time you run an az sql mi-arc config command. Learn more about extensions.
Configuration commands.
Commands
Name | Description | Type | Status |
---|---|---|---|
az sql mi-arc config add |
Add a value for a json path in a config file. |
Extension | GA |
az sql mi-arc config init |
Initialize the CRD and specification files for a SQL managed instance. |
Extension | GA |
az sql mi-arc config patch |
Patch a config file based on a json patch file. |
Extension | GA |
az sql mi-arc config remove |
Remove a value for a json path in a config file. |
Extension | GA |
az sql mi-arc config replace |
Replace a value for a json path in a config file. |
Extension | GA |
az sql mi-arc config add
Add a value for a json path in a config file.
Add the value at the json path in the config file. All examples below are given in Bash. If using another command line, you may need to escape quotations appropriately. Alternatively, you may use the patch file functionality.
az sql mi-arc config add --json-values
--path
Examples
Ex 1 - Add storage.
az sql mi-arc config add --path custom/spec.json --json-values 'spec.storage={"accessMode":"ReadWriteOnce","className":"managed-premium","size":"10Gi"}'
Required Parameters
A key value pair list of json paths to values: key1.subkey1=value1,key2.subkey2=value2
. You may provide inline json values such as: key='{"kind":"cluster","name":"test-cluster"}'
or provide a file path, such as key=./values.json
. The add command does NOT support conditionals. If the inline value you are providing is a key value pair itself with =
and ,
please escape those characters. For example: key1=\"key2\=val2\,key3\=val3\"
. Please see http://jsonpatch.com/ for examples of how your path should look. If you would like to access an array, you must do so by indicating the index, such as key.0=value
.
Path to the custom resource specification, i.e. custom/spec.json.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az sql mi-arc config init
Initialize the CRD and specification files for a SQL managed instance.
az sql mi-arc config init --path
Examples
Initialize the CRD and specification files for a SQL managed instance.
az sql mi-arc config init --path ./template
Required Parameters
A path where the CRD and specification for the SQL managed instance should be written.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az sql mi-arc config patch
Patch a config file based on a json patch file.
Patch the config file according to the given patch file. Consult http://jsonpatch.com/ for a better understanding of how the paths should be composed. The replace operation can use conditionals in its path due to the jsonpath library https://jsonpath.com/. All patch json files must start with a key of patch
that has an array of patches with their corresponding op (add, replace, remove), path, and value. The remove
op does not require a value, just a path. See the examples below.
az sql mi-arc config patch --patch-file
--path
Examples
Ex 1 - Replace the port of a single endpoint with patch file.
az sql mi-arc config patch --path custom/spec.json --patch ./patch.json
Patch File Example (patch.json):
{"patch":[{"op":"replace","path":"$.spec.endpoints[?(@.name=='Controller')].port","value":30080}]}
Ex 2 - Replace storage with patch file.
az sql mi-arc config patch --path custom/spec.json --patch ./patch.json
Patch File Example (patch.json):
{"patch":[{"op":"replace","path":".spec.storage","value":{"accessMode":"ReadWriteMany","className":"managed-premium","size":"10Gi"}}]}
Required Parameters
Path to a patch json file that is based off the jsonpatch library: http://jsonpatch.com/. You must start your patch json file with a key called patch
, whose value is an array of patch operations you intend to make. For the path of a patch operation, you may use dot notation, such as key1.key2
for most operations. If you would like to do a replace operation, and you are replacing a value in an array that requires a conditional, please use the jsonpath notation by beginning your path with a $. This will allow you to do a conditional such as $.key1.key2[?(@.key3=="someValue"].key4
.See the examples below. For additional help with conditionals, see: https://jsonpath.com/.
Path to the custom resource specification, i.e. custom/spec.json
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az sql mi-arc config remove
Remove a value for a json path in a config file.
Remove the value at the json path in the config file. All examples below are given in Bash. If using another command line, you may need to escape quotations appropriately. Alternatively, you may use the patch file functionality.
az sql mi-arc config remove --json-path
--path
Examples
Ex 1 - Remove storage.
az sql mi-arc config remove --path custom/spec.json --json-path '.spec.storage'
Required Parameters
A list of json paths based on the jsonpatch library that indicates which values you would like removed, such as: key1.subkey1,key2.subkey2
. The remove command does NOT support conditionals. Please see http://jsonpatch.com/ for examples of how your path should look. If you would like to access an array, you must do so by indicating the index, such as key.0=value
.
Path to the custom resource specification, i.e. custom/spec.json
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az sql mi-arc config replace
Replace a value for a json path in a config file.
Replace the value at the json path in the config file. All examples below are given in Bash. If using another command line, you may need to escape quotations appropriately. Alternatively, you may use the patch file functionality.
az sql mi-arc config replace --json-values
--path
Examples
Ex 1 - Replace the port of a single endpoint.
az sql mi-arc config replace --path custom/spec.json --json-values '$.spec.endpoints[?(@.name=="Controller")].port=30080'
Ex 2 - Replace storage.
az sql mi-arc config replace --path custom/spec.json --json-values 'spec.storage={"accessMode":"ReadWriteOnce","className":"managed-premium","size":"10Gi"}'
Required Parameters
A key value pair list of json paths to values: key1.subkey1=value1,key2.subkey2=value2
. You may provide inline json values such as: key={"kind":"cluster","name":"test-cluster"}
or provide a file path, such as key=./values.json
. The replace command supports conditionals through the jsonpath library. To use this, start your path with a $. This will allow you to do a conditional such as -j $.key1.key2[?(@.key3=="someValue"].key4=value
. If the inline value you are providing is a key value pair itself with =
and ,
please escape those characters. For example, key1=\"key2\=val2\,key3\=val3\"
. You may see examples below. For additional help, see: https://jsonpath.com/.
Path to the custom resource specification, i.e. custom/spec.json
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.