azure-cli: 'role definition create' fails with "api-version '2015-07-01' is invalid."


Environment summary

apt-get / azure-cli (2.0.26) / Xubuntu 16.04.4 / bash

Command

python3 -m azure.cli role definition create --role-definition '{
"Name": "Security Group Rules Manager",
"Description": "Manage Security Group Rules inside prod/app-nsg",
"Actions": [
    "Microsoft.Network/networkSecurityGroups/securityRules/delete",
    "Microsoft.Network/networkSecurityGroups/securityRules/read",
    "Microsoft.Network/networkSecurityGroups/securityRules/write"
],
"AssignableScopes": ["/subscriptions/***/resourceGroups/prod/app-nsg"]
}'

Response

The api-version '2015-07-01' is invalid. The supported versions are '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'.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 16 (9 by maintainers)

Most upvoted comments

If the input to the command is wrong, I would expect the command to tell me so, instead of giving some very obscure message about mismatching api-versions. I was witnessing the same kind of error message for the following command:

az role assignment create --role Contributor --assignee "someuser@example.com" --resource-group "/subscriptions/<some subscription id>/resourceGroups/<some resource group name>"

Can you please reconsider this issue, in this light?