(InvalidApiVersionParameter) The api-version '2020-07-01-preview' is invalid.
See original GitHub issueRelated command
az policy exemption create -n "Exempt_<SNOWINC>_Tags_<RSGName>" --policy-assignment "/providers/Microsoft.Management/managementGroups/<MGName>/providers/Microsoft.Authorization/policyAssignments/<AssignmentName>" --exemption-category "Waiver" --resource-group "/subscriptions/<SubGUID>/resourceGroups/<RSGName>" --expires-on "2022-06-02T00:00:00Z"
Describe the bug Using most-recent AZ CLI (and immediately previous version):
PS C:\Users\brian.pickering> az version
{
"azure-cli": "2.37.0",
"azure-cli-core": "2.37.0",
"azure-cli-telemetry": "1.0.6",
"extensions": {
"account": "0.2.3",
"aks-preview": "0.5.76",
"automation": "0.1.1"
}
}
Receiving the following error response to the command given above:
Command group 'policy exemption' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
(InvalidApiVersionParameter) The api-version '2020-07-01-preview' is invalid. The supported versions are '2022-05-01,2022-03-01-preview,2022-01-01,2021-04-01,2021-01-01,2020-10-01,2020-09-01,2020-08-01,2020-07-01,2020-06-01,2020-05-01,2020-01-01,2019-11-01,2019-10-01,2019-09-01,2019-08-01,2019-07-01,2019-06-01,2019-05-10,2019-05-01,2019-03-01,2018-11-01,2018-09-01,2018-08-01,2018-07-01,2018-06-01,2018-05-01,2018-02-01,2018-01-01,2017-12-01,2017-08-01,2017-06-01,2017-05-10,2017-05-01,2017-03-01,2016-09-01,2016-07-01,2016-06-01,2016-02-01,2015-11-01,2015-01-01,2014-04-01-preview,2014-04-01,2014-01-01,2013-03-01,2014-02-26,2014-04'.
Code: InvalidApiVersionParameter
Message: The api-version '2020-07-01-preview' is invalid. The supported versions are '2022-05-01,2022-03-01-preview,2022-01-01,2021-04-01,2021-01-01,2020-10-01,2020-09-01,2020-08-01,2020-07-01,2020-06-01,2020-05-01,2020-01-01,2019-11-01,2019-10-01,2019-09-01,2019-08-01,2019-07-01,2019-06-01,2019-05-10,2019-05-01,2019-03-01,2018-11-01,2018-09-01,2018-08-01,2018-07-01,2018-06-01,2018-05-01,2018-02-01,2018-01-01,2017-12-01,2017-08-01,2017-06-01,2017-05-10,2017-05-01,2017-03-01,2016-09-01,2016-07-01,2016-06-01,2016-02-01,2015-11-01,2015-01-01,2014-04-01-preview,2014-04-01,2014-01-01,2013-03-01,2014-02-26,2014-04'.
To Reproduce Run the command as specified above (of course, one needs to replace the descriptive “macros” given in <>.)
Expected behavior Create exemption on the policy initiative.
Environment summary Found error on previous version of az cli, updated to current version, error remained the same.
Additional context N/A
Issue Analytics
- State:
- Created a year ago
- Comments:11 (6 by maintainers)
Top GitHub Comments
OK, found the problem. Was giving parameter --resource-group in the full URI format (/subscriptions/<subID>/resourceGroups/<rsgName>) instead of simply giving just the Resource Group name. When I entered ONLY the Resource Group name, the exemption got created.
Sorry to have wasted your time.
@zhoxing-ms There is correlationId in the debug log you shared. The Uri format is incorrect. It should be the client issue. Will send you the query via email.