问题标签 [serviceconnection]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
194 浏览

cocoapods - 如何将 Azure 管道用于私有 pod?

我有一组托管在 Github(私有存储库)上的私有 Cocoapods 库,由 Azure Devops 平台管理。

每个吊舱都有一个广告项目。

关键是,当我尝试执行pod repo addpod install(我在 bash 脚本上执行此操作)时,我需要访问我的私有规范和 pod 存储库。

我可以选择使用私有访问令牌作为秘密变量,或者使用 SSH 密钥作为安全文件,但是我需要在我的每个项目上部署它。

git config --global url."https://$(username):$(token)@github.com/".insteadOf "https://github.com"

由于它可以在同一组织内的跨项目中共享,我想知道是否有办法使用服务连接来做到这一点?有没有办法在脚本中获取它?我绝对需要为它创建自己的广告扩展吗?

0 投票
1 回答
164 浏览

android - 在 api 30 中返回 false BindService

当我使用 compileSdkVersion 30 运行我的代码时不起作用,但在 29 代码中运行

}

在 api 30 bindService 返回 false 并且 serviceConnection 不响应侦听器

如何解决这个问题呢 ?

0 投票
0 回答
450 浏览

azure - Create custom Azure DevOps Service Connection for rest api

I have a REST API on the internet that is secured with Azure AD and a required header (custom apikey). You can call this API in example with postman using the client credentials flow. This all works fine.

I'm now developing a custom Azure DevOps extension that is showing the information returned from that API in the workitem form of ADO. I can call the API (if I remove the security from the API) from the extension through a generic Service Connection. Now I want to get the security working.

So I want to create a custom service connection that will get an accesstoken from the azure AD using ClientID and ClientSecret (client credentials flow). When I have that working, I can call my API on a secure way. Also how do I add the mandatory header to the call to the api? I need to add the header as field to the service connection as well right? So I think I end up with a custom service connection instance that asks for TenantId, ClientId, Client Secret, Audience/Scope, List of headers (name/value).

For a more reference blog post I used this one: https://thingswithcode.blogspot.com/2019/07/using-azure-devops-service-connections.html

Thanks

0 投票
1 回答
657 浏览

azure-devops - Azure DevOps API 在未验证的情况下创建服务连接,因此在使用时出现错误无法查询服务连接 api

能够使用创建新的服务端点

创建服务端点

并且还可以使用下面的管道权限授予它

curl --request PATCH -H "Content-Type: application/json" -u $user:$token -d "@newpatch.json" https://dev.azure.com/$org/$project/_apis/pipelines /pipelinePermissions/endpoint/$connection_id\?api-version\=5.1-preview.1

但是当我尝试在管道中使用服务连接时,它给了我以下错误

无法查询服务连接 API:“https://management.azure.com/subscriptions/resourcegroups?api-version=2019-05-01”。状态代码:'BadRequest',来自服务器的响应:'{"error":{"code":"InvalidSubscriptionId","message":"提供的订阅标识符 'resourcegroups' 格式错误或无效。"}}'

我已经尝试过 - update restproxy但我仍然看到错误,不确定脚本的正文

请帮忙

0 投票
1 回答
110 浏览

azure-devops - Azure DevOps 服务连接 - Azure 资源管理器使用服务主体(手动)和 Key Vault 机密值

我已经创建了 Azure Key Vault,然后在其中创建了带有 Service Principal Client Secret ID 值的密钥。接下来,我尝试在 Azure DevOps 中创建 Azure 资源管理器服务连接(手动类型)。我想从 Azure Key Vault 中读取客户端密钥值。

是否可以通过从 Azure DevOps 中的 Azure Key Vault 读取客户端密钥值来创建 ARM 服务连接?

0 投票
1 回答
180 浏览

azure-devops - 如何创建 Azure devops kubernetes 服务连接以访问私有 AKS 集群?

创建服务连接以访问非私有 AKS 群集很简单,但是如果我想为私有 AKS 群集创建服务连接,是否可以从 Azure Devops 中创建服务连接?

0 投票
1 回答
209 浏览

azure - 在没有服务连接的情况下从 Azure Pipeline 连接到 Azure 订阅

从 Visual Studio Code 或 Windows Powershell,我可以执行所需的 Az-Cli/Powershell 命令并毫无问题地登录到我的 Azure 订阅。我迫切希望在我的 Azure Pipeline 中复制它,而不使用目前无法选择的服务连接。

不幸的是,创建我们的管道服务连接所需的服务主体只能由当前不可用的项目团队成员生成,因此这不是桌面上的选项。

有什么建议么?

0 投票
0 回答
41 浏览

azure - 无法在 Azure DevOps 中创建新的 Azure 服务连接,当在租户上启用 MFA 时,我是来宾

当我们在租户上启用 MFA 时,我们是天蓝色的客人。当我们设置新的服务连接时 --> Azure Resource Manager(Automatic) 登录后出现错误弹出框:找不到这个 app.vssps.visualstudio.com 页面没有找到网页网址:https ://app.vssps.visualstudio.com/oauth2/receive 有任何相同的设置并让它工作吗?

0 投票
1 回答
179 浏览

bash - Azure DevOps Pipelines 中的 bash 脚本任务如何访问服务连接?

我在我的 azure yaml 管道中使用“运行 bash 脚本”任务。我需要在脚本中访问服务连接(docker 连接),这样我就可以登录到 docker & jfrog 并多次注销(无需使用变量或变量组)。

我怎样才能做到这一点?提前感谢您的建议和帮助

0 投票
1 回答
57 浏览

azure - Azure devops 服务连接和中央管道

我需要让多个团队访问 azure 中的共享资源。因此,我想限制人们如何发布对共享资源的更改。

这个想法是将服务连接的使用限制到特定管道,根据本文档。但是,如果管道存储在他们自己的仓库中,开发人员可以更改它。这不会给我足够的控制权。因此,我发现可以使用来自中央仓库的模板。使用共享存储库,然后允许我为模板建立一个服务连接吗?

所以我想如何做上面的事情是我需要为我的 BuildTemplates Repo 授予项目 X 一个服务连接。但这基本上只是访问 repo 并能够使用共享模板。然后在 BuildTemplates 存储库中,我可以为我的模板 A 建立一个服务连接。

现在,项目 X 中的开发人员 - 使用她自己的服务连接为她的管道创建她的部署和配置,其范围是她的资源。然后她从 BuildTemplates Repo 继承一个模板,并为模板 A 传递相关参数。

由于范围服务连接,她无法更改模板管道 A,并且只有模板管道 A 可以发布到共享资源。因此,我可以在模板管道 A 中为共享的 azure 资源创建相关保护——因此我限制了开发人员 X 如何发布到我的共享 azure 资源。

  • 这有意义吗?可行吗?
  • A 中的管道部分不能由 X 中的开发人员编辑?
  • A 中的服务连接不会传播出去,所以 X 中的开发人员可以以不适当的方式使用它?

更新

上述解决方案似乎不可行,因为管道模板是在源分支范围内执行的。

建议的解决方案

由于这些问题,我从上述建议中看到的好处似乎是不可能的。但是,可以利用管道触发器作为一种可行的解决方案。然而,这导致了一个新问题。当开发人员 Y 在 Y 的存储库中触发管道并成功时。然后在 MAIN 存储库中进行触发器,并且 MAIN 中的管道失败,例如,因为来自 Y 的工件引入了一个问题。开发人员 Y 如何获得有关 MAIN 管道中问题的通知?