[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.
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.
Auto-generated by CodeGen
| ``` | ||
|
|
||
| ### Included Features ### | ||
| #### ad ds #### |
There was a problem hiding this comment.
We can explain what ds is.
There was a problem hiding this comment.
Auto-generated by CodeGen
| helps['ad ds'] = """ | ||
| type: group | ||
| short-summary: Manage domain service with ad | ||
| """ |
There was a problem hiding this comment.
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.
Auto-generated by CodeGen
There was a problem hiding this comment.
Refined in manual/_help.py
|
|
||
| helps['ad ds'] = """ | ||
| type: group | ||
| short-summary: Manage domain service with ad |
There was a problem hiding this comment.
The short-summary should usually ends with a period (.), like
short-summary: Delete a managed disk.There was a problem hiding this comment.
Auto-generated by CodeGen
There was a problem hiding this comment.
the description is not easy to understand with ad.
There was a problem hiding this comment.
Refined in manual/_help.py
| FAILED = "failed" | ||
|
|
||
|
|
||
| def try_manual(func): |
There was a problem hiding this comment.
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.
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.
Not used? I can't seem to find any usage of VirtualNetworkPreparer.
There was a problem hiding this comment.
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.
changlong-liu could we remove these preparer and import from azure cli core module?
There was a problem hiding this comment.
yes Zunli Hu (@Juliehzl) , we are refactoring the test preparers codegen.
Hi Yishi Wang (@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.
changlong-liu Hope this stable swagger can help
Zunli Hu (Juliehzl)
left a comment
There was a problem hiding this comment.
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.
not in preview or experimental?
There was a problem hiding this comment.
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.
both of them are required?
There was a problem hiding this comment.
I see. You could consider add [required] in the description for them. But should the location be the location for subnet?
Refined in |
|
Zunli Hu (@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 paramHowever, apparently, 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. |
Bump api_version to 0.12.0 and framework_version to 0.5.0 to match the hcsshim CWCOW policy framework, and add the enforcement points introduced by PR Azure#2842. The Windows policy template now wires registry_changes, unmount_cims, host_network and load_transparency_trust_list, and emits the allow_host_network, allow_unencrypted_scratch, allow_capability_dropping and allow_registry_changes_dropping switches. The Linux policy template wires host_network and load_transparency_trust_list (newly active at api_version 0.12.0) and emits allow_host_network, which has no framework default. The fragment and sidecar templates are bumped to framework_version 0.5.0. These enforcement points have no ARM property, so they are exposed only through confcom-owned --input (-i) JSON fields, mirroring the log-provider fields: the top-level allowHostNetwork and allowRegistryChangesDropping bools, the per-container registryChanges object (passed through in the hcsshim add_values/delete_keys shape), and the top-level mappedDirectories list. mapped_directory_mount/unmount are wired only when mappedDirectories is supplied, since wiring them without backing data can only deny; an undeclared hot-add is denied by the framework either way. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Elastic SAN volumes on Confidential ACI are bind-mounted into the workload container by the atlas mounthost from /tmp/atlas/esanVolume/<deployment>/<volume>, analogous to Azure File's /tmp/atlas/azureFileVolume/... . Register a matching "elasticSan" mount type so CCE policies accept the Elastic SAN volume mount. The type name matches the ARM/CCE volume property (Volume.ElasticSan -> "elasticSan") and the source mirrors the azureFile entry, both per Compute-ACI release/rel-20260429. Compute-ACI also places a Linux pod that mounts an Elastic SAN volume on the host network (iscsid needs the UVM init netns), so the generated policy for such a pod must allow the host_network enforcement point (added in Azure#2842). Detect the elasticSan mount type and force allow_host_network on for Linux policies, leaving the flag at its default False otherwise. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Bump api_version to 0.12.0 and framework_version to 0.5.0 to match the hcsshim CWCOW policy framework, and add the enforcement points introduced by PR Azure#2842. The Windows policy template now wires registry_changes, unmount_cims, host_network and load_transparency_trust_list, and emits the allow_host_network, allow_unencrypted_scratch, allow_capability_dropping and allow_registry_changes_dropping switches. The Linux policy template wires host_network and load_transparency_trust_list (newly active at api_version 0.12.0) and emits allow_host_network, which has no framework default. The fragment and sidecar templates are bumped to framework_version 0.5.0. These enforcement points have no ARM property, so they are exposed only through confcom-owned --input (-i) JSON fields, mirroring the log-provider fields: the top-level allowHostNetwork and allowRegistryChangesDropping bools, the per-container registryChanges object (passed through in the hcsshim add_values/delete_keys shape), and the top-level mappedDirectories list. mapped_directory_mount/unmount are wired only when mappedDirectories is supplied, since wiring them without backing data can only deny; an undeclared hot-add is denied by the framework either way. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Elastic SAN volumes on Confidential ACI are bind-mounted into the workload container by the atlas mounthost from /tmp/atlas/esanVolume/<deployment>/<volume>, analogous to Azure File's /tmp/atlas/azureFileVolume/... . Register a matching "elasticSan" mount type so CCE policies accept the Elastic SAN volume mount. The type name matches the ARM/CCE volume property (Volume.ElasticSan -> "elasticSan") and the source mirrors the azureFile entry, both per Compute-ACI release/rel-20260429. Compute-ACI also places a Linux pod that mounts an Elastic SAN volume on the host network (iscsid needs the UVM init netns), so the generated policy for such a pod must allow the host_network enforcement point (added in Azure#2842). Detect the elasticSan mount type and force allow_host_network on for Linux policies, leaving the flag at its default False otherwise. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Takuro Sato <takurosato@microsoft.com>
New command module:
az ad dssupport management for AAD.DomainServiceCommands:
az ad ds createaz ad ds updateaz ad ds listaz ad ds showaz ad ds deletereference: 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 azdevrequired)python scripts/ci/test_index.py -qlocally?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.jsonautomatically.The precondition is to put your code inside this repo and upgrade the version in the PR but do not modify
src/index.json.