Application `setOnPremisesPublishing` not working

未关闭
#356 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
38/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
openapi, php

调研方向

首先,将生成的 Application 和 OnPremisesPublishing 模型与 beta openapi.yaml 条目以及报告中显示的序列化请求正文进行比较。使用 SDK v2.25.0 重现 PATCH,然后验证发出的 payload 与可正常工作的 Bruno 请求一致,并验证 Graph API 返回 204 No Content。

由索引模型根据 Issue 内容生成。

描述

dependency:metadata ToTriage type:bug
Describe the bug

Hi,

I am trying to update an applications onPremisesPublishing configuration, which isn't working.

I have used the following guide Configure Microsoft Entra application proxy using Microsoft Graph APIs which works until the Step 2.2 where the onPremisesPublishing settings should be set/updated.

I only get the follow translated OData-Error:

InvalidJson_BadRequest : Valid JSON content expected.

Expected behavior

That the settings would be set at the MS Graph Beta API would return an 204 - No Content.

How to reproduce

I used the following code Step 2.2: Configure the onPremisesPublishing property

<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Application;
use Microsoft\Graph\Beta\Generated\Models\OnPremisesPublishing;
use Microsoft\Graph\Beta\Generated\Models\ExternalAuthenticationType;


$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);

$requestBody = new Application();
$onPremisesPublishing = new OnPremisesPublishing();
$onPremisesPublishing->setExternalAuthenticationType(new ExternalAuthenticationType('aadPreAuthentication'));
$onPremisesPublishing->setInternalUrl('https://contosoiwaapp.com');
$onPremisesPublishing->setExternalUrl('https://contosoiwaapp-contoso.msappproxy.net');
$onPremisesPublishing->setIsHttpOnlyCookieEnabled(true);
$onPremisesPublishing->setIsOnPremPublishingEnabled(true);
$onPremisesPublishing->setIsPersistentCookieEnabled(true);
$onPremisesPublishing->setIsSecureCookieEnabled(true);
$onPremisesPublishing->setIsStateSessionEnabled(true);
$onPremisesPublishing->setIsTranslateHostHeaderEnabled(true);
$onPremisesPublishing->setIsTranslateLinksInBodyEnabled(true);
$requestBody->setOnPremisesPublishing($onPremisesPublishing);

$result = $graphServiceClient->applications()->byApplicationId('application-id')->patch($requestBody)->wait();
SDK Version

v2.25.0

Latest version known to work for scenario above?

No response

Known Workarounds

I have tested around with the follow client bruno.

If I use the following body, I am able to update the settings:

{
  "@odata.type": "#microsoft.graph.application",
  "microsoft.graph.onPremisesPublishing": {    
    "@odata.type": "#microsoft.graph.onPremisesPublishing",
    "isOnPremPublishingEnabled": true
  }
}

This is the json body which is generated from the SDK:

{
  "@odata.type": "#microsoft.graph.application",
  "onPremisesPublishing": {    
    "isOnPremPublishingEnabled": true
  }
}

which was not working as I have tried it with bruno.

Even using:

{
  "@odata.type": "#microsoft.graph.application",
  "onPremisesPublishing": {    
    "@odata.type": "#microsoft.graph.onPremisesPublishing",
    "isOnPremPublishingEnabled": true
  }
}

did not worked.

There must be something "in the back" what is causing the above mentioned error.

Debug output
Configuration
  • OS: macOS Sequoia 15.1.1
  • architecture: M3 Pro
  • used PHP version:
PHP 8.3.16 (cli) (built: Jan 17 2025 01:31:19) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.16, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.16, Copyright (c), by Zend Technologies
    with Xdebug v3.4.1, Copyright (c) 2002-2025, by Derick Rethans
Other information

I have check the OpenAPI-file at github.com/microsoftgraph/msgraph-metadata/blob/master/openapi/beta/openapi.yaml and couldn't see any issue/error why this is not working 😟

Disclaimer: I know that is the beta API version 😄

主要语言
PHP
星标
13
派生
8
平均合并
14 小时 58 分钟
30 天内合并 PR
3

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoftgraph/msgraph-beta-sdk-php 的其他 Issue

查看 microsoftgraph/msgraph-beta-sdk-php 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。