azure-docs icon indicating copy to clipboard operation
azure-docs copied to clipboard

Suggestion on SP_ID naming and `az ad sp` explainer

Open m8yng opened this issue 2 years ago • 2 comments

The SP_ID is actually the appId. Should we change the naming? Also would be nice to add a notice for older az ad sp search, so the user will know why is a change to az ad app. Since az ad sp credential list --id "$SP_ID" --query "[].endDateTime" -o tsv will no longer return the value. (#103949)


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

m8yng avatar Jun 01 '23 11:06 m8yng

@m8yng Thanks for your feedback! We will investigate and update as appropriate.

SaibabaBalapur-MSFT avatar Jun 01 '23 11:06 SaibabaBalapur-MSFT

@m8yng I'm going to assign this to the document author so they can take a look at it accordingly.

@MGoedtel please review it.

SaibabaBalapur-MSFT avatar Jun 03 '23 06:06 SaibabaBalapur-MSFT

#reassign:schaffererin

schaffererin avatar Jun 13 '23 23:06 schaffererin

Hi, @m8yng, thank you for your feedback. I just tested and ran into no issues. I first ran az ad sp credential list --id myID --query "[].endDateTime" -o tsv, then tried az ad app credential list --id myID --query "[].endDateTime" -o tsv, and I received the same output. I'm running the latest version of Azure CLI. I'm not sure why this command doesn't return anything for you. Could you please share additional context? I'm not sure a doc update needs to be made here. Thanks!

schaffererin avatar Jun 13 '23 23:06 schaffererin

As we have not heard back, we will now close this GitHub issue. Thank you! #please-close

schaffererin avatar Jun 26 '23 18:06 schaffererin

Hi @schaffererin, sorry for the delayed response.

I later find out it is because I am testing against the fresh SP object. And there are yet to have any key values.


Environment and versions:

Cloud Shell / bash $ az version

Azure-cli    Azure-cli-core    Azure-cli-telemetry
-----------  ----------------  ---------------------
2.49.0       2.49.0            1.0.8

Steps to reproduce:

  1. Create a new SP: $ az ad sp create-for-rbac --role Contributor --scopes /subscriptions/$currentSubscriptionID

  2. Query the expiration date from the SP $ az ad sp credential list --id $SPappID --query "[].endDateTime" -o json

And the output return an empty array:

[]

Attaching entire object output for reference, from az ad sp show --id $SPappID -o json

{
  "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#servicePrincipals/$entity",
  "accountEnabled": true,
  "addIns": [],
  "alternativeNames": [],
  "appDescription": null,
  "appDisplayName": "azure-cli-2023-06-30-03-14-07",
  "appId": "<redacted>",
  "appOwnerOrganizationId": "<redacted>",
  "appRoleAssignmentRequired": false,
  "appRoles": [],
  "applicationTemplateId": null,
  "createdDateTime": "2023-06-30T03:14:12Z",
  "deletedDateTime": null,
  "description": null,
  "disabledByMicrosoftStatus": null,
  "displayName": "azure-cli-2023-06-30-03-14-07",
  "homepage": null,
  "id": "<redacted>",
  "info": {
    "logoUrl": null,
    "marketingUrl": null,
    "privacyStatementUrl": null,
    "supportUrl": null,
    "termsOfServiceUrl": null
  },
  "keyCredentials": [],
  "loginUrl": null,
  "logoutUrl": null,
  "notes": null,
  "notificationEmailAddresses": [],
  "oauth2PermissionScopes": [],
  "passwordCredentials": [],
  "preferredSingleSignOnMode": null,
  "preferredTokenSigningKeyThumbprint": null,
  "replyUrls": [],
  "resourceSpecificApplicationPermissions": [],
  "samlSingleSignOnSettings": null,
  "servicePrincipalNames": [
    "<redacted>"
  ],
  "servicePrincipalType": "Application",
  "signInAudience": "AzureADandPersonalMicrosoftAccount",
  "tags": [],
  "tokenEncryptionKeyId": null,
  "verifiedPublisher": {
    "addedDateTime": null,
    "displayName": null,
    "verifiedPublisherId": null
  }
}

m8yng avatar Jun 30 '23 03:06 m8yng