MCPcopy Index your code
hub / github.com/microsoft/PyRIT / post_deploy

Function post_deploy

infra/deploy_instance.py:874–899  ·  view source on GitHub ↗

Run post-deployment steps: SPA redirect URI. Args: app_object_id (str): The Entra app registration object ID (for Graph API). fqdn (str): The deployed app FQDN.

(
    *,
    app_object_id: str,
    fqdn: str,
)

Source from the content-addressed store, hash-verified

872
873
874def post_deploy(
875 *,
876 app_object_id: str,
877 fqdn: str,
878) -> None:
879 """
880 Run post-deployment steps: SPA redirect URI.
881
882 Args:
883 app_object_id (str): The Entra app registration object ID (for Graph API).
884 fqdn (str): The deployed app FQDN.
885 """
886 # Set SPA redirect URI via Graph REST API (more portable than --spa-redirect-uris flag)
887 logger.info("Setting SPA redirect URI: https://%s", fqdn)
888 spa_body = {"spa": {"redirectUris": [f"https://{fqdn}"]}}
889 run_az(
890 args=[
891 "rest",
892 "--method",
893 "PATCH",
894 "--url",
895 f"https://graph.microsoft.com/v1.0/applications/{app_object_id}",
896 "--body",
897 json.dumps(spa_body),
898 ]
899 )
900
901
902def create_managed_identity_and_grant_roles(

Callers 1

mainFunction · 0.85

Calls 1

run_azFunction · 0.70

Tested by

no test coverage detected