You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I execute up codes ,then get a throw exception.
Microsoft.Graph.Models.ODataErrors.ODataError: New password credentials must be generated using service actions.
at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.ThrowIfFailedResponseAsync(HttpResponseMessage response, Dictionary`2 errorMapping, Activity activityForAttributes, CancellationToken cancellationToken)
at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.SendAsync[ModelType](RequestInformation requestInfo, ParsableFactory`1 factory, Dictionary`2 errorMapping, CancellationToken cancellationToken)
at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.SendAsync[ModelType](RequestInformation requestInfo, ParsableFactory`1 factory, Dictionary`2 errorMapping, CancellationToken cancellationToken)
at Microsoft.Graph.Applications.Item.ApplicationItemRequestBuilder.PatchAsync(Application body, Action`1 requestConfiguration, CancellationToken cancellationToken)
at Aicro.AzureDeploy.Services.AzureApplicationService.UpdateAsync(Application app) in W:\Aicrosoft\ProjectTemplates\AzDeploy\AzDeploy.Core\Aicro\AzureDeploy\Services\AzureApplicationService.cs:line 102
How to update the Application's Properties?
The text was updated successfully, but these errors were encountered:
Seems like you are trying to update the passwordCredential property through the PATCH /applications/{id}, but it is not supported. Use the addPassword and removePassword methods to update the password or secret for an application.
var requestBody = new RemovePasswordPostRequestBody
{
KeyId = Guid.Parse("f0b0b335-1d71-4883-8f98-567911bfdca6"),
};
await graphClient.Applications["{application-id}"].RemovePassword.PostAsync(requestBody);
var requestBody = new AddPasswordPostRequestBody
{
PasswordCredential = new PasswordCredential
{
DisplayName = "Password friendly name",
},
};
var result = await graphClient.Applications["{application-id}"].AddPassword.PostAsync(requestBody);
Discussed in #2787
Originally posted by FisherMS January 3, 2025
When I execute up codes ,then get a throw exception.
How to update the Application's Properties?
The text was updated successfully, but these errors were encountered: