Skip to content

Support for addPassword #15971

@srusun

Description

@srusun

Feature Request:
Would like a way to create a client secret for an Azure app using the python

Problem:
To create the client secret, we go STRAIGHT TO HTTP!!
We were UNABLE to find an azure-sdk-for-python solution that supported this endpoint.
This seems like a bug or a design flaw!

Current Solution:

header = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {}".format(graph_credentials.token["access_token"]),
}
url = "https://graph.microsoft.com/v1.0/servicePrincipals/{}/addPassword".format(sp.object_id)
payload = {
    "passwordCredential": {"displayName": "newlyCreatedClientSecret"},
}
response = requests.post(url, data=json.dumps(payload), headers=header)
response.raise_for_status()
secret_info = json.loads(response.text)

This request was brought up in a previous issue (#14022)

Metadata

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.GraphGraph.Microsoftcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.feature-requestThis issue requires a new behavior in the product in order be resolved.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions