Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
update code
  • Loading branch information
dingmeng-xue committed May 11, 2021
commit 5fe43bdb45d4a57f8e03610acaf219d1660dcf83
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ public class NewAzureADApplicationCommand : ActiveDirectoryBaseCmdlet
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, ParameterSetName = ParameterSet.ApplicationWithKeyCredential,
HelpMessage = "The URIs that identify the application.")]
[ValidateNotNullOrEmpty]
public string[] IdentifierUris { get; set; }
[Alias("IdentifierUris")]
public string[] IdentifierUri { get; set; }

[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, ParameterSetName = ParameterSet.ApplicationWithoutCredential,
HelpMessage = "The URL to the application’s homepage.")]
Expand Down Expand Up @@ -138,7 +139,7 @@ public override void ExecuteCmdlet()
{
DisplayName = DisplayName,
HomePage = HomePage,
IdentifierUris = (IdentifierUris == null) ? new string[] { } : IdentifierUris,
IdentifierUris = (IdentifierUri == null) ? new string[] { } : IdentifierUri,
ReplyUrls = ReplyUrls,
AvailableToOtherTenants = AvailableToOtherTenants
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,7 @@ public override void ExecuteCmdlet()
if(this.IsParameterBound(c => c.DisplayName) && !string.IsNullOrEmpty(DisplayName))
{
string uri = "http://" + HttpUtility.UrlEncode(DisplayName.Trim());
appParameters.IdentifierUris = new[] { uri };
appParameters.HomePage = uri;
appParameters.IdentifierUris = new string[] { };
appParameters.DisplayName = DisplayName;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
// ----------------------------------------------------------------------------------

using Microsoft.Azure.Graph.RBAC.Models;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using System;
using System.Management.Automation;
Expand Down Expand Up @@ -57,7 +56,6 @@ public class UpdateAzureADApplicationCommand : ActiveDirectoryBaseCmdlet
[ValidateNotNullOrEmpty]
public string HomePage { get; set; }

[CmdletParameterBreakingChange("IdentifierUri", ChangeDescription = "The value will be considered valid only if it exists as a verified domain in a tenant.")]
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, ParameterSetName = ParameterSet.ApplicationObjectIdWithUpdateParams,
HelpMessage = "The URIs that identify the application.")]
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, ParameterSetName = ParameterSet.ApplicationIdWithUpdateParams,
Expand Down Expand Up @@ -102,7 +100,7 @@ public override void ExecuteCmdlet()
{
DisplayName = DisplayName,
Homepage = HomePage,
IdentifierUris = IdentifierUri,
IdentifierUris = (IdentifierUri == null) ? new string[] { } : IdentifierUri,
ReplyUrls = ReplyUrl,
AvailableToOtherTenants = this.IsParameterBound(c => c.AvailableToOtherTenants) ? AvailableToOtherTenants : (bool?)null
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
using Microsoft.Azure.Graph.RBAC.Models;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using System;
using System.Linq;
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;

namespace Microsoft.Azure.Commands.ActiveDirectory
{
Expand Down Expand Up @@ -48,7 +47,6 @@ public class UpdateAzureADServicePrincipalCommand : ActiveDirectoryBaseCmdlet
[ValidateNotNullOrEmpty]
public PSADServicePrincipal InputObject { get; set; }

[CmdletParameterBreakingChange("DisplayName", ChangeDescription = "DisplayName is used as the IdentifierUris of created application. The value will be considered valid only if it exists as a verified domain in a tenant.")]
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, ParameterSetName = ParameterSet.SpObjectIdWithDisplayName, HelpMessage = "The display name for the service principal.")]
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, ParameterSetName = ParameterSet.SPNWithDisplayName, HelpMessage = "The display name for the service principal.")]
[Parameter(Mandatory = false, ParameterSetName = ParameterSet.InputObjectWithDisplayName, HelpMessage = "The display name for the service principal.")]
Expand All @@ -58,7 +56,6 @@ public class UpdateAzureADServicePrincipalCommand : ActiveDirectoryBaseCmdlet
[Parameter(Mandatory = false, HelpMessage = "The homepage for the service principal.")]
public string Homepage { get; set; }

[CmdletParameterBreakingChange("IdentifierUri", ChangeDescription = "The value will be considered valid only if it exists as a verified domain in a tenant.")]
[Parameter(Mandatory = false, HelpMessage = "The identifier URI(s) for the service principal.")]
public string[] IdentifierUri { get; set; }

Expand Down Expand Up @@ -107,7 +104,7 @@ public override void ExecuteCmdlet()
{
DisplayName = DisplayName,
Homepage = Homepage,
IdentifierUris = IdentifierUri,
IdentifierUris = (IdentifierUri == null) ? new string[] { } : IdentifierUri,
KeyCredentials = KeyCredential,
PasswordCredentials = PasswordCredential
};
Expand Down
14 changes: 7 additions & 7 deletions src/Resources/Resources/help/New-AzADApplication.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,35 @@ Creates a new azure active directory application.

### ApplicationWithoutCredentialParameterSet (Default)
```
New-AzADApplication -DisplayName <String> [-IdentifierUris <String[]>] [-HomePage <String>]
New-AzADApplication -DisplayName <String> [-IdentifierUri <String[]>] [-HomePage <String>]
[-ReplyUrls <String[]>] [-AvailableToOtherTenants <Boolean>] [-DefaultProfile <IAzureContextContainer>]
[-WhatIf] [-Confirm] [<CommonParameters>]
```

### ApplicationWithPasswordPlainParameterSet
```
New-AzADApplication -DisplayName <String> [-IdentifierUris <String[]>] [-HomePage <String>]
New-AzADApplication -DisplayName <String> [-IdentifierUri <String[]>] [-HomePage <String>]
[-ReplyUrls <String[]>] [-AvailableToOtherTenants <Boolean>] -Password <SecureString> [-StartDate <DateTime>]
[-EndDate <DateTime>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### ApplicationWithPasswordCredentialParameterSet
```
New-AzADApplication -DisplayName <String> [-IdentifierUris <String[]>] [-HomePage <String>]
New-AzADApplication -DisplayName <String> [-IdentifierUri <String[]>] [-HomePage <String>]
[-ReplyUrls <String[]>] [-AvailableToOtherTenants <Boolean>] -PasswordCredentials <PSADPasswordCredential[]>
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### ApplicationWithKeyPlainParameterSet
```
New-AzADApplication -DisplayName <String> [-IdentifierUris <String[]>] [-HomePage <String>]
New-AzADApplication -DisplayName <String> [-IdentifierUri <String[]>] [-HomePage <String>]
[-ReplyUrls <String[]>] [-AvailableToOtherTenants <Boolean>] -CertValue <String> [-StartDate <DateTime>]
[-EndDate <DateTime>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### ApplicationWithKeyCredentialParameterSet
```
New-AzADApplication -DisplayName <String> [-IdentifierUris <String[]>] [-HomePage <String>]
New-AzADApplication -DisplayName <String> [-IdentifierUri <String[]>] [-HomePage <String>]
[-ReplyUrls <String[]>] [-AvailableToOtherTenants <Boolean>] -KeyCredentials <PSADKeyCredential[]>
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
```
Expand Down Expand Up @@ -172,13 +172,13 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -IdentifierUris
### -IdentifierUri
The URIs that identify the application.

```yaml
Type: System.String[]
Parameter Sets: (All)
Aliases:
Aliases: IdentifierUris

Required: False
Position: Named
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/Resources/help/New-AzADServicePrincipal.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ $sp = New-AzAdServicePrincipal -DisplayName ServicePrincipalName -PasswordCreden
```

```Output
ServicePrincipalNames : {00000000-0000-0000-0000-000000000000, http://ServicePrincipalName}
ServicePrincipalNames : {00000000-0000-0000-0000-000000000000}
ApplicationId : 00000000-0000-0000-0000-000000000000c
ObjectType : ServicePrincipal
DisplayName : ServicePrincipalName
Expand All @@ -272,7 +272,7 @@ $sp = New-AzADServicePrincipal -DisplayName ServicePrincipalName -CertValue $cer
```

```Output
ServicePrincipalNames : {00000000-0000-0000-0000-000000000000, http://ServicePrincipalName}
ServicePrincipalNames : {00000000-0000-0000-0000-000000000000}
ApplicationId : 00000000-0000-0000-0000-000000000000
ObjectType : ServicePrincipal
DisplayName : ServicePrincipalName
Expand Down