Microsoft.Azure.Commands.Resources.Models.ActiveDirectory.ActiveDirectoryClient.CreateAppPasswordCredential C# (CSharp) Method

CreateAppPasswordCredential() public method

public CreateAppPasswordCredential ( string appObjectId, Microsoft.Azure.Graph.RBAC.Models.PasswordCredential credential ) : PSADCredential
appObjectId string
credential Microsoft.Azure.Graph.RBAC.Models.PasswordCredential
return PSADCredential
        public PSADCredential CreateAppPasswordCredential(string appObjectId, PasswordCredential credential)
        {
            ValidatePasswordCredential(credential);

            var passwordCredsList = GetAppPasswordCredentials(appObjectId);

            // Add new PasswordCredential to existing KeyCredential list
            passwordCredsList.Add(credential);

            PatchAppPasswordCredentials(appObjectId, passwordCredsList);

            return credential.ToPSADCredential();
        }