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

CreateSpPasswordCredential() public method

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

            var passwordCredsList = GetSpPasswordCredentials(spObjectId);

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

            PatchSpPasswordCredentials(spObjectId, passwordCredsList);

            return credential.ToPSADCredential();
        }