Azure / azure-cli

Azure Command-Line Interface
MIT License
3.99k stars 2.97k forks source link

old link to az ad sp create-for-rbac #22626

Open spottedmahn opened 2 years ago

spottedmahn commented 2 years ago

Describe the bug

When I ran az ad sp create-for-rbac --name it provided this link: https://docs.microsoft.com/en-US/cli/azure/ad/sp?view=azure-cli-latest#az_ad_sp_create_for_rbac

but the anchor link part isn't right; hyphens not underscores 😊: https://docs.microsoft.com/en-US/cli/azure/ad/sp?view=azure-cli-latest#az-ad-sp-create-for-rbac

Command Name az ad sp create-for-rbac

PS C:\Users\mdepouw> $PASSWORD=az ad sp create-for-rbac --name
WARNING: This command or command group has been migrated to Microsoft Graph API. Please carefully review all breaking changes introduced during this migration: https://docs.microsoft.com/cli/azure/microsoft-graph-migration
ERROR: argument --display-name/--name/-n: expected one argument

Examples from AI knowledge base:
az ad sp create-for-rbac --name "MyApp" --role contributor --scopes /subscriptions/{SubID}/resourceGroups/{ResourceGroup1} /subscriptions/{SubID}/resourceGroups/{ResourceGroup2}
Create with customized contributor assignments.

az ad sp create-for-rbac --skip-assignment
Create without a default assignment.

az acr show --name MyRegistry --query loginServer
Get the login server for an Azure Container Registry.

https://docs.microsoft.com/en-US/cli/azure/ad/sp#az_ad_sp_create_for_rbac
Read more about the command in reference docs

To Reproduce:

Expected Behavior

link should be to: https://docs.microsoft.com/en-US/cli/azure/ad/sp?view=azure-cli-latest#az-ad-sp-create-for-rbac

Environment Summary

Windows-10-10.0.19044-SP0
Python 3.10.4
Installer: MSI

azure-cli 2.37.0

Extensions:
containerapp 0.3.5
deploy-to-azure 0.2.0
log-analytics 0.2.2

Dependencies:
msal 1.18.0b1
azure-mgmt-resource 21.1.0b1

Additional Context

yonzhan commented 2 years ago

@jiasli for awareness

jiasli commented 2 years ago

The link is from Aladdin's recommendation:

https://github.com/Azure/azure-cli/blob/02cb00efbf661a1c18bab4a1fe03f2b1c59e30ef/src/azure-cli-core/azure/cli/core/command_recommender.py#L306-L309

navba-MSFT commented 2 years ago

Removing the CXP attention label since this needs Service team