Skip to content

[ResourceManager] Major issues with Lock commands #2694

@tjprescott

Description

@tjprescott

There are a number of serious usability issues with the az lock commands. As far as I can tell, only the list command works...

  • There are no tests for any of the lock commands.
  • I could not create a lock on my VNET using the az lock create command. It says: The resource type could not be found in the namespace 'Microsoft.Network' for api version '2015-01-01'. It could be using the API version of the lock API but needing the API version of the virtualNetworks resource. The az resource commands handle this behind the scenes.
  • As reported in [ResourceManager] Unable to delete locks #2688, I cannot delete a lock with az lock delete. If I specify only the name (which is the only required parameter but logically shouldn't work because the resource is associated with a resource group) I get no output. If I specify name and some of the optional parameters, I get no output. If I specify ALL of the parameters, I get the same output about not finding the resource type for the API version as when I try the lock create command.
  • az lock show takes resource group and name as parameters, but I cannot show a lock that I know exists by specifying these. It simply returns nothing.
  • az lock create handles two scenarios: placing a lock on a resource group or placing a lock on a resource in a resource group. If you specify some (but not all) of the parameters to specify a lock on a resource, the command silently places a lock on the resource-group. Instead, it should throw an error that you didn't specify enough parameters to identify the resource. (PR Add some more error checking/handling. #2768)
  • --parent-resource-path is listed as optional, but if you omit it, it says "Parameter 'parent_resource_path' can not be None." You have to specify ''... (PR Fix lock create and delete if parent-resource-path is None #2742)
  • The parameter names for specifying the resource are inconsistent with the az resource commands. Specifically: az lock: --parent-resource-path, --resource-provider-namespace are inconsistent with az resource: --namespace, --parent. (PR Make argument parameters match up. #2717)
  • The ids parameter is not supported for either the lock itself or the target resource. It should be supported for both.
  • in az resource, --resource-type accepts the type or namespace/type. az lock does not do this. (PR Make argument parameters match up. #2717)
  • No short summaries for any of the commands
  • az lock update has parameters with no help text (PR Add docs for az lock update. #2702)

Metadata

Metadata

Assignees

No one assigned

    Labels

    ARMaz resource/group/lock/tag/deployment/policy/managementapp/account management-groupResource ManagerbugThis issue requires a change to an existing behavior in the product in order to be resolved.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions