Title: Renewing secrets (and certificates) using Python MSGraph SDK · microsoftgraph/msgraph-sdk-python · Discussion #1185 · GitHub
Open Graph Title: Renewing secrets (and certificates) using Python MSGraph SDK · microsoftgraph/msgraph-sdk-python · Discussion #1185
X Title: Renewing secrets (and certificates) using Python MSGraph SDK · microsoftgraph/msgraph-sdk-python · Discussion #1185
Description: Renewing secrets (and certificates) using Python MSGraph SDK
Open Graph Description: Hey, I don't know if this is a bug, or a misunderstanding from me, but I have been struggling with this. Bug When creating a secret for an Azure AD app using add_password.post() and a PasswordCrede...
X Description: Hey, I don't know if this is a bug, or a misunderstanding from me, but I have been struggling with this. Bug When creating a secret for an Azure AD app using add_password.post() and a PasswordC...
Opengraph URL: https://github.com/microsoftgraph/msgraph-sdk-python/discussions/1185
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"Renewing secrets (and certificates) using Python MSGraph SDK","text":"Hey,
\nI don't know if this is a bug, or a misunderstanding from me, but I have been struggling with this.
\nBug
\nWhen creating a secret for an Azure AD app using add_password.post() and a PasswordCredential object, fields such as displayName, startDateTime, and endDateTime are silently ignored. The resulting secret is created with an empty name and a default expiration of 2 years.
\nSteps to reproduce
\nfrom msgraph.generated.models import PasswordCredential\n\nnow = datetime.datetime.now(datetime.timezone.utc)\nend = now + datetime.timedelta(days=365)\n\ncred = PasswordCredential(\n display_name=\"Secret Test 2025\",\n start_date_time=now,\n end_date_time=end\n)\n\nawait client.applications.by_application_id(app_id).add_password.post(cred)
\nExpected behavior
\n\n- Secret is created with displayName \"Secret Test 2025\"
\n- Secret expires on the specified endDateTime
\n
\nActual behavior
\n\n- Secret is created with no name
\n- Secret expires 2 years from creation (default)
\n
\nSDK version: msgraph-sdk-python v1.26.0
\nPython version: 3.12.9
","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Anyway too much time to answer, found a workaround using requests and not the trash SDK !
","upvoteCount":2,"url":"https://github.com/microsoftgraph/msgraph-sdk-python/discussions/1185#discussioncomment-12907659"}}}
| route-pattern | /_view_fragments/Voltron::DiscussionsFragmentsController/show/:user_id/:repository/:discussion_number/discussion_layout(.:format) |
| route-controller | voltron_discussions_fragments |
| route-action | discussion_layout |
| fetch-nonce | v2:40c716b5-bfea-6bc3-bd8c-44971948faba |
| current-catalog-service-hash | 9f0abe34da433c9b6db74bffa2466494a717b579a96b30a5d252e5090baea7be |
| request-id | E0B2:1940BA:BD3E7A:FCF63A:69698460 |
| html-safe-nonce | 5edad31096d97a26a23d4787a10b4009d6965e0821e6c9dca0a60862ee93572f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMEIyOjE5NDBCQTpCRDNFN0E6RkNGNjNBOjY5Njk4NDYwIiwidmlzaXRvcl9pZCI6IjI2NDUzOTc5NDU2NzM0MTc4MjQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 2fb6d88aca54cbb862cf0c13027b73685dfb2180784a2d1fd21ffc69a1d25c05 |
| hovercard-subject-tag | discussion:8199799 |
| github-keyboard-shortcuts | repository,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/Voltron::DiscussionsFragmentsController/show/microsoftgraph/msgraph-sdk-python/1185/discussion_layout |
| twitter:image | https://opengraph.githubassets.com/ccb8f7e3d5f6d2db8b89a75b404db5b4c02ad2291addbc333f4bab7cf4bf1676/microsoftgraph/msgraph-sdk-python/discussions/1185 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ccb8f7e3d5f6d2db8b89a75b404db5b4c02ad2291addbc333f4bab7cf4bf1676/microsoftgraph/msgraph-sdk-python/discussions/1185 |
| og:image:alt | Hey, I don't know if this is a bug, or a misunderstanding from me, but I have been struggling with this. Bug When creating a secret for an Azure AD app using add_password.post() and a PasswordCrede... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 533e7cac596c452090972c1150d587fd0b36531b8dc4e8bbfe4ab694aca02408 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoftgraph/msgraph-sdk-python git https://github.com/microsoftgraph/msgraph-sdk-python.git |
| octolytics-dimension-user_id | 17304259 |
| octolytics-dimension-user_login | microsoftgraph |
| octolytics-dimension-repository_id | 534665999 |
| octolytics-dimension-repository_nwo | microsoftgraph/msgraph-sdk-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 534665999 |
| octolytics-dimension-repository_network_root_nwo | microsoftgraph/msgraph-sdk-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 63d27af10eea2ccab520b162530cf6c7b739e767 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width