小编Yut*_*ang的帖子

在Visual Studio Team Services中的构建作业中执行git命令(是VSO)

[环境:团队服务,GIT,托管构建代理]

我想创建一个能够执行以下操作的Team Services构建定义:

  1. 执行脚本以根据仓库中的现有文件生成一些新文件

  2. 将生成的文件提交/推送回repo

我可以毫无问题地做#1.但我不知道我怎么做#2.

我发现我实际上能够从构建作业中运行git.exe.但我不确定如何将凭证传递给git.基于构建日志,它失败了,因为它试图从stdin获取用户名.

我尝试在构建定义中添加一个步骤,例如"git config --global user.name xxxx",但它仍然没有帮助.

这是一个受支持的场景吗?有什么建议?

谢谢!


编辑

我在构建脚本中尝试了以下方法:

git -c http.extraheader="AUTHORIZATION: bearer %SYSTEM_ACCESSTOKEN%" pull ...
Run Code Online (Sandbox Code Playgroud)

它似乎适用于拉等等命令.但是当我试图推动更改时,我得到以下错误:

fatal: unable to access 'https://example.visualstudio.com/SampleTeam/_git/SampleRepo/': SSL read: error:00000000:lib(0):func(0):reason(0), errno 10054
Run Code Online (Sandbox Code Playgroud)

思考?

git azure-devops azure-pipelines

23
推荐指数
2
解决办法
1万
查看次数

从 Azure Functions 内部调用 Microsoft Graph API

我正在尝试编写一个调用 Microsoft Graph API 的简单 Azure 函数。但我无法使 access_token 工作。这是我所做的:

  1. 从 Azure 门户创建了一个新的 Azure Function App
  2. 开启“应用服务认证”设置并指示其使用AAD登录(管理模式为Express)。
  3. 将应用配置为具有委派权限,例如 Microsoft Graph 的“登录并读取用户配置文件”。
  4. 创建了一个新的 JavaScript 函数 HttpTriggerJS1
  5. 将此函数的授权级别更改为“匿名”(否则默认情况下“函数”级别甚至不允许我运行该函数,总是返回 401 Unauthorized)
  6. 安装了必要的 Node 模块 ( npm install request)
  7. 和实际功能:

    var request = require('request');
    module.exports = function (context, req) {
        var token = req.headers['x-ms-token-aad-access-token'];
        var reqUrl = 'https://graph.microsoft.com/v1.0/me/';
        request.get(reqUrl, {'auth': {'bearer': token}}, function (err, response, msg) {
            context.res = {
                body: msg
            };
            context.done();
        });
    };
    
    Run Code Online (Sandbox Code Playgroud)
  8. 在单独的浏览器窗口中测试了此功能。让我正确登录 AAD。

  9. 但是从 Graph 返回的消息是:

    "{
      "error": { …
    Run Code Online (Sandbox Code Playgroud)

javascript azure node.js azure-functions microsoft-graph-api

5
推荐指数
2
解决办法
6144
查看次数

更改Office UI Fabric React组件的颜色/主题?

我正在尝试在我的Web应用程序中使用Office UI Fabric React组件.有没有办法改变组件的颜色或主题?例如,我尝试过这样的事情:

ReactDOM.render(
  <DefaultButton
    className='my-button'
    text='Test Button'
  />,
  document.getElementById('root')
);
Run Code Online (Sandbox Code Playgroud)

my-button是一个定义为红色背景颜色的CSS类.但实际上并没有改变任何东西.按钮背景颜色仍然是默认颜色#f4f4f4.

是否有可能改变组件的颜色?

[ 更新 ]理想情况下,我认为我想全局更改组件的主题,以便我的应用程序可以具有一致的外观和感觉.

谢谢!

reactjs office-ui-fabric

4
推荐指数
1
解决办法
4118
查看次数

How can I speed up my Office Scripts code so that it doesn't fail in Power Automate?

I have been asked to pull data from an Excel online spreadsheet on Sharepoint into Power BI to create a dashboard - no problem, right? Well, one of the 'data points' is actually fill colour of the cell indicating status. I did some googling and managed to write an Office Script that translates the fill colour to the status and got everything to work but I was still running the Office Script manually (and it was taking 3 hours to …

power-automate office-scripts

3
推荐指数
1
解决办法
1544
查看次数