-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[AAD] az ad ds create/update/list/show/delete
: Support DomainService
#2842
Conversation
AAD |
az ad ds create/update/list/show/delete
: Support DomainService
az ad ds create --domain "TestDomainService.com" --ntlm-v1 "Enabled" --sync-ntlm-passwords "Enabled" \ | ||
--tls-v1 "Disabled" --filtered-sync "Enabled" --external-access "Enabled" --ldaps "Enabled" \ | ||
--pfx-certificate "MIIDPDCCAiSgAwIBAgIQQUI9P6tq2p9OFIJa7DLNvTANBgkqhkiG9w0BAQsFADAgMR4w..." \ | ||
--pfx-certificate-password "<pfxCertificatePassword>" \ | ||
--additional-recipients "jicha@microsoft.com" "caalmont@microsoft.com" --notify-dc-admins "Enabled" \ | ||
--notify-global-admins "Enabled" \ | ||
--replica-sets location="West US" subnet-id="/subscriptions/1639790a-76a2-4ac4-98d9-8562f5dfcb4d/resourceGroups/TestNetworkResourceGroup/providers/Microsoft.Network/virtualNetworks/TestVnetWUS/subnets/TestSubnetWUS" \ | ||
--name "TestDomainService.com" --resource-group "TestResourceGroup" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as #2817 (comment)
Backward slash \
is only supported by Linux Bash, we usually don't include \
in examples.
However, you can break lines without \
and add a comment to tell the user line breaks are added for legibility only, like
// Line breaks for legibility only
https://login.microsoftonline.com/{tenant}/oauth2/v2.0/authorize?
client_id=6731de76-14a6-49ae-97bc-6eba6914391e
&response_type=code
&redirect_uri=http%3A%2F%2Flocalhost%2Fmyapp%2F
&response_mode=query
&scope=openid%20offline_access%20https%3A%2F%2Fgraph.microsoft.com%2Fmail.read
&state=12345
&code_challenge=YTFjNjI1OWYzMzA3MTI4ZDY2Njg5M2RkNmVjNDE5YmEyZGRhOGYyM2IzNjdmZWFhMTQ1ODg3NDcxY2Nl
&code_challenge_method=S256
So this command can be written as
az ad ds create --domain "TestDomainService.com" --ntlm-v1 "Enabled" --sync-ntlm-passwords "Enabled"
--tls-v1 "Disabled" --filtered-sync "Enabled" --external-access "Enabled" --ldaps "Enabled"
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auto-generated by CodeGen
``` | ||
|
||
### Included Features ### | ||
#### ad ds #### |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can explain what ds
is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auto-generated by CodeGen
helps['ad ds'] = """ | ||
type: group | ||
short-summary: Manage domain service with ad | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are redundant indents, against CLI convention, like
helps['disk delete'] = """
type: command
short-summary: Delete a managed disk.
examples:
- name: Delete a managed disk. (autogenerated)
text: |
az disk delete --name MyManagedDisk --resource-group MyResourceGroup
crafted: true
"""
helps['ad ds'] = """ | |
type: group | |
short-summary: Manage domain service with ad | |
""" | |
helps['ad ds'] = """ | |
type: group | |
short-summary: Manage domain service with ad | |
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auto-generated by CodeGen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refined in manual/_help.py
|
||
helps['ad ds'] = """ | ||
type: group | ||
short-summary: Manage domain service with ad |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The short-summary
should usually ends with a period (.
), like
short-summary: Delete a managed disk.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auto-generated by CodeGen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the description is not easy to understand with ad
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refined in manual/_help.py
FAILED = "failed" | ||
|
||
|
||
def try_manual(func): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The meaning of this try_manual
is unclear to me as someone who is not familiar with the code. Also, shouldn't it be a general method that appears in the centralized test framework, instead of individual modules/extensions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auto-generated by CodeGen aimed to use manual code overwrite generated code
KEY_VNET_NIC = 'nic' | ||
|
||
|
||
class VirtualNetworkPreparer(NoTrafficRecordingPreparer, SingleValueReplacer): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not used? I can't seem to find any usage of VirtualNetworkPreparer
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auto-generated by CodeGen. I didn't use it but keep it because it will always be generated. No need to delete every time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@changlong-liu could we remove these preparer and import from azure cli core module?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes @Juliehzl , we are refactoring the test preparers codegen.
Hi @evelyn-ys , In latest autorest.az the preparers.py is supposed to be generated only when has some reference for it. Please help to send me the swagger branch to have further check if it generated even have no usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@changlong-liu Hope this stable swagger can help
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current az ad
command group has description Manage Azure Active Directory Graph entities needed for Role Based Access Control.
It seems that your command group is not for az ad
from the description.
@@ -0,0 +1,3 @@ | |||
{ | |||
"azext.minCliCoreVersion": "2.15.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not in preview or experimental?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
az ad
is stable. az ad ds
is marked as preview in command.py
location: Virtual network location | ||
subnet-id: The name of the virtual network that Domain Services will be deployed on. The id of the subnet \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
both of them are required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. You could consider add [required] in the description for them. But should the location be the location for subnet?
Refined in |
@Juliehzl I have modified according to your comments, could you pls review again? Thanks a lot! |
Even though the help message has been updated: azure-cli-extensions/src/ad/azext_ad/manual/_help.py Lines 14 to 17 in 2415c3b
this design of putting with self.argument_context('ad') as c:
c.ignore('_subscription') # hide global subscription param However, apparently, Line 118 in 2415c3b
This means the global argument If a specific command such as command_loaders = self.cmd_to_loader_map.get(command, None) In such case, only However, in the reference doc generation pipeline, both command loaders will be loaded. If See Azure/azure-cli#27296 (comment) for details. |
New command module:
az ad ds
support management for AAD.DomainServiceCommands:
az ad ds create
az ad ds update
az ad ds list
az ad ds show
az ad ds delete
reference: AAD RP Speclet
This checklist is used to make sure that common guidelines for a pull request are followed.
General Guidelines
azdev style <YOUR_EXT>
locally? (pip install azdev
required)python scripts/ci/test_index.py -q
locally?For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your PR is merged into master branch, a new PR will be created to update
src/index.json
automatically.The precondition is to put your code inside this repo and upgrade the version in the PR but do not modify
src/index.json
.