-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ResourceManager] Major issues with Lock commands #2694
Comments
@tjprescott what was the specific lock command? Creating locks does work, I just tried it:
And it worked correctly. |
Also, listing the lock works for me:
|
|
@brendandburns I was trying to create/delete a lock on a VNet when I got the API error. Listing is the only command that I could get to work. I agree that |
@tjprescott can you try the command that I cut and pasted above? for create/delete, that locks a VNet resource and it worked correctly for me. Can you clarify, Thanks |
The command you use does work, but it does not create a lock on the VNet... it creates a lock on the resource group because you didn't specify Attempting to create a lock on a VNet:
Now once I set
|
Ah, thanks I will try to reproduce this. |
Please see: for the fix for create/delete. Apologies for the bugs. |
Is not recursive, that is if you try to show a lock that is at resource scope, but you don't give us the resource, it's not going to work... I could probably work around this using --brendan |
Assigning to Willie to review and clean up. |
There are a number of serious usability issues with the
az lock
commands. As far as I can tell, only the list command works...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. Theaz resource
commands handle this behind the scenes.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 thelock 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)az resource
commands. Specifically:az lock: --parent-resource-path, --resource-provider-namespace
are inconsistent withaz resource: --namespace, --parent
. (PR Make argument parameters match up. #2717)ids
parameter is not supported for either the lock itself or the target resource. It should be supported for both.az resource
,--resource-type
accepts the type or namespace/type.az lock
does not do this. (PR Make argument parameters match up. #2717)az lock update
has parameters with no help text (PR Add docs for az lock update. #2702)The text was updated successfully, but these errors were encountered: