From 192a18aadc124ec3f643b1ed8b8b33b4f2a3feca Mon Sep 17 00:00:00 2001 From: Xing Zhou Date: Sun, 19 Jan 2020 11:42:25 +0800 Subject: [PATCH] [ARM] Fix az group export command does not support --query and --output parameters (#11885) --- src/azure-cli/HISTORY.rst | 4 + .../cli/command_modules/resource/custom.py | 3 +- .../recordings/test_resource_group.yaml | 210 +++++++++++++----- .../resource/tests/latest/test_resource.py | 4 + 4 files changed, 160 insertions(+), 61 deletions(-) diff --git a/src/azure-cli/HISTORY.rst b/src/azure-cli/HISTORY.rst index 15024b5a364..41a2dbf7e6a 100644 --- a/src/azure-cli/HISTORY.rst +++ b/src/azure-cli/HISTORY.rst @@ -11,6 +11,10 @@ Release History * Azure Stack: surface commands under the profile of 2019-03-01-hybrid +**ARM** + +* Fix issue #11658: `az group export` command does not support `--query` and `--output` parameters + **IoT Central** * Support app creation/update with the new sku name ST0, ST1, ST2. diff --git a/src/azure-cli/azure/cli/command_modules/resource/custom.py b/src/azure-cli/azure/cli/command_modules/resource/custom.py index 4787148f6d3..fb4e3a46fb6 100644 --- a/src/azure-cli/azure/cli/command_modules/resource/custom.py +++ b/src/azure-cli/azure/cli/command_modules/resource/custom.py @@ -756,7 +756,6 @@ def export_group_as_template( result = rcf.resource_groups.export_template(resource_group_name, ['*'], options=options) - print(json.dumps(result.template, indent=2)) # pylint: disable=no-member # On error, server still returns 200, with details in the error attribute if result.error: @@ -768,6 +767,8 @@ def export_group_as_template( for detail in getattr(error, 'details', None) or []: logger.error(detail.message) + return result.template + def create_application(cmd, resource_group_name, application_name, managedby_resource_group_id, diff --git a/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_resource_group.yaml b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_resource_group.yaml index d48ca324a34..aae0196cb43 100644 --- a/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_resource_group.yaml +++ b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_resource_group.yaml @@ -15,8 +15,8 @@ interactions: ParameterSetName: - -n --yes User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 accept-language: - en-US method: DELETE @@ -30,11 +30,11 @@ interactions: content-length: - '0' date: - - Mon, 21 Oct 2019 05:11:53 GMT + - Fri, 17 Jan 2020 05:42:20 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGUkc6NUZTQ0VOQVJJT0hGS1hGQVNKVTI2T0pVWFdQRFdTWnxCMDU1RDJDNzA2Mjc1RTA0LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2019-07-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGUkc6NUZTQ0VOQVJJT0pKRk5KNkZFM0dRU1RFVkNOSkgzVHw1RkU4RkQ1NDBBRDZEM0Q4LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2019-07-01 pragma: - no-cache strict-transport-security: @@ -60,10 +60,10 @@ interactions: ParameterSetName: - -n --yes User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGUkc6NUZTQ0VOQVJJT0hGS1hGQVNKVTI2T0pVWFdQRFdTWnxCMDU1RDJDNzA2Mjc1RTA0LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2019-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGUkc6NUZTQ0VOQVJJT0pKRk5KNkZFM0dRU1RFVkNOSkgzVHw1RkU4RkQ1NDBBRDZEM0Q4LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2019-07-01 response: body: string: '' @@ -73,11 +73,11 @@ interactions: content-length: - '0' date: - - Mon, 21 Oct 2019 05:12:10 GMT + - Fri, 17 Jan 2020 05:42:36 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGUkc6NUZTQ0VOQVJJT0hGS1hGQVNKVTI2T0pVWFdQRFdTWnxCMDU1RDJDNzA2Mjc1RTA0LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2019-07-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGUkc6NUZTQ0VOQVJJT0pKRk5KNkZFM0dRU1RFVkNOSkgzVHw1RkU4RkQ1NDBBRDZEM0Q4LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2019-07-01 pragma: - no-cache strict-transport-security: @@ -101,10 +101,10 @@ interactions: ParameterSetName: - -n --yes User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGUkc6NUZTQ0VOQVJJT0hGS1hGQVNKVTI2T0pVWFdQRFdTWnxCMDU1RDJDNzA2Mjc1RTA0LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2019-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGUkc6NUZTQ0VOQVJJT0pKRk5KNkZFM0dRU1RFVkNOSkgzVHw1RkU4RkQ1NDBBRDZEM0Q4LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2019-07-01 response: body: string: '' @@ -114,11 +114,11 @@ interactions: content-length: - '0' date: - - Mon, 21 Oct 2019 05:12:25 GMT + - Fri, 17 Jan 2020 05:42:51 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGUkc6NUZTQ0VOQVJJT0hGS1hGQVNKVTI2T0pVWFdQRFdTWnxCMDU1RDJDNzA2Mjc1RTA0LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2019-07-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGUkc6NUZTQ0VOQVJJT0pKRk5KNkZFM0dRU1RFVkNOSkgzVHw1RkU4RkQ1NDBBRDZEM0Q4LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2019-07-01 pragma: - no-cache strict-transport-security: @@ -142,10 +142,10 @@ interactions: ParameterSetName: - -n --yes User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGUkc6NUZTQ0VOQVJJT0hGS1hGQVNKVTI2T0pVWFdQRFdTWnxCMDU1RDJDNzA2Mjc1RTA0LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2019-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGUkc6NUZTQ0VOQVJJT0pKRk5KNkZFM0dRU1RFVkNOSkgzVHw1RkU4RkQ1NDBBRDZEM0Q4LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2019-07-01 response: body: string: '' @@ -155,11 +155,11 @@ interactions: content-length: - '0' date: - - Mon, 21 Oct 2019 05:12:40 GMT + - Fri, 17 Jan 2020 05:43:06 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGUkc6NUZTQ0VOQVJJT0hGS1hGQVNKVTI2T0pVWFdQRFdTWnxCMDU1RDJDNzA2Mjc1RTA0LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2019-07-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGUkc6NUZTQ0VOQVJJT0pKRk5KNkZFM0dRU1RFVkNOSkgzVHw1RkU4RkQ1NDBBRDZEM0Q4LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2019-07-01 pragma: - no-cache strict-transport-security: @@ -183,10 +183,10 @@ interactions: ParameterSetName: - -n --yes User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGUkc6NUZTQ0VOQVJJT0hGS1hGQVNKVTI2T0pVWFdQRFdTWnxCMDU1RDJDNzA2Mjc1RTA0LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2019-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGUkc6NUZTQ0VOQVJJT0pKRk5KNkZFM0dRU1RFVkNOSkgzVHw1RkU4RkQ1NDBBRDZEM0Q4LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2019-07-01 response: body: string: '' @@ -196,7 +196,48 @@ interactions: content-length: - '0' date: - - Mon, 21 Oct 2019 05:12:56 GMT + - Fri, 17 Jan 2020 05:43:22 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGUkc6NUZTQ0VOQVJJT0pKRk5KNkZFM0dRU1RFVkNOSkgzVHw1RkU4RkQ1NDBBRDZEM0Q4LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2019-07-01 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - group delete + Connection: + - keep-alive + ParameterSetName: + - -n --yes + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGUkc6NUZTQ0VOQVJJT0pKRk5KNkZFM0dRU1RFVkNOSkgzVHw1RkU4RkQ1NDBBRDZEM0Q4LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2019-07-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Fri, 17 Jan 2020 05:43:38 GMT expires: - '-1' pragma: @@ -222,8 +263,8 @@ interactions: ParameterSetName: - -n User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 accept-language: - en-US method: HEAD @@ -239,7 +280,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 21 Oct 2019 05:12:57 GMT + - Fri, 17 Jan 2020 05:43:38 GMT expires: - '-1' pragma: @@ -271,8 +312,8 @@ interactions: ParameterSetName: - -n -l --tag User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 accept-language: - en-US method: PUT @@ -288,7 +329,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 21 Oct 2019 05:12:59 GMT + - Fri, 17 Jan 2020 05:43:44 GMT expires: - '-1' pragma: @@ -298,7 +339,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1192' + - '1198' status: code: 201 message: Created @@ -316,8 +357,8 @@ interactions: ParameterSetName: - -n User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 accept-language: - en-US method: HEAD @@ -331,7 +372,7 @@ interactions: content-length: - '0' date: - - Mon, 21 Oct 2019 05:12:59 GMT + - Fri, 17 Jan 2020 05:43:45 GMT expires: - '-1' pragma: @@ -357,8 +398,8 @@ interactions: ParameterSetName: - -n User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 accept-language: - en-US method: GET @@ -374,7 +415,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 21 Oct 2019 05:13:01 GMT + - Fri, 17 Jan 2020 05:43:45 GMT expires: - '-1' pragma: @@ -402,8 +443,8 @@ interactions: ParameterSetName: - --tag User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 accept-language: - en-US method: GET @@ -419,7 +460,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 21 Oct 2019 05:13:01 GMT + - Fri, 17 Jan 2020 05:43:46 GMT expires: - '-1' pragma: @@ -447,8 +488,8 @@ interactions: ParameterSetName: - -g --tags User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 accept-language: - en-US method: GET @@ -464,7 +505,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 21 Oct 2019 05:13:02 GMT + - Fri, 17 Jan 2020 05:43:46 GMT expires: - '-1' pragma: @@ -496,8 +537,8 @@ interactions: ParameterSetName: - -g --tags User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 accept-language: - en-US method: PUT @@ -513,7 +554,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 21 Oct 2019 05:13:03 GMT + - Fri, 17 Jan 2020 05:43:52 GMT expires: - '-1' pragma: @@ -527,7 +568,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 200 message: OK @@ -545,8 +586,8 @@ interactions: ParameterSetName: - -g --set User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 accept-language: - en-US method: GET @@ -562,7 +603,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 21 Oct 2019 05:13:05 GMT + - Fri, 17 Jan 2020 05:43:52 GMT expires: - '-1' pragma: @@ -594,8 +635,8 @@ interactions: ParameterSetName: - -g --set User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 accept-language: - en-US method: PUT @@ -612,7 +653,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 21 Oct 2019 05:13:06 GMT + - Fri, 17 Jan 2020 05:43:58 GMT expires: - '-1' pragma: @@ -626,7 +667,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1195' + - '1198' status: code: 200 message: OK @@ -644,8 +685,8 @@ interactions: ParameterSetName: - -g --set --force-string User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 accept-language: - en-US method: GET @@ -662,7 +703,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 21 Oct 2019 05:13:07 GMT + - Fri, 17 Jan 2020 05:43:58 GMT expires: - '-1' pragma: @@ -695,8 +736,8 @@ interactions: ParameterSetName: - -g --set --force-string User-Agent: - - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.75 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 accept-language: - en-US method: PUT @@ -713,7 +754,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 21 Oct 2019 05:13:10 GMT + - Fri, 17 Jan 2020 05:44:04 GMT expires: - '-1' pragma: @@ -727,7 +768,56 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1192' + - '1198' + status: + code: 200 + message: OK +- request: + body: '{"resources": ["*"]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - group export + Connection: + - keep-alive + Content-Length: + - '20' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --name --query + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_rg_scenario000001/exportTemplate?api-version=2019-07-01 + response: + body: + string: '{"template":{"$schema":"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#","contentVersion":"1.0.0.0","parameters":{},"variables":{},"resources":[]}}' + headers: + cache-control: + - no-cache + content-length: + - '179' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 17 Jan 2020 05:44:05 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff status: code: 200 message: OK diff --git a/src/azure-cli/azure/cli/command_modules/resource/tests/latest/test_resource.py b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/test_resource.py index 25a57feea51..23d848dc71b 100644 --- a/src/azure-cli/azure/cli/command_modules/resource/tests/latest/test_resource.py +++ b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/test_resource.py @@ -47,6 +47,10 @@ def test_resource_group(self, resource_group): self.cmd('group update -g {rg} --set tags.b={tag} --force-string', checks=self.check('tags.b', '{{\"k\":\"v\"}}')) + result = self.cmd('group export --name {rg} --query "contentVersion"') + + self.assertEqual('"1.0.0.0"\n', result.output) + class ResourceGroupNoWaitScenarioTest(ScenarioTest):