Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Add support for Azure US Government

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

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
azure, go
领域
backend, cloud

调研方向

Start by locating where azidentity.ClientSecretCredential and armresourcegraph.Client are initialized in the function. Review how credential fields such as activeDirectoryEndpointUrl and resourceManagerEndpointUrl could configure the Azure Government authority and resource-manager endpoint. Done means queries work with Azure US Government credentials as well as the public Azure environment.

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

描述

enhancement
What problem are you facing?

When using function-azresourcegraph with credentials for Azure US Government, the function attempts to query the public Azure Resource Graph endpoint (management.azure.com). This results in an error because the Azure Government subscription ID is not recognized by the public Azure endpoint.

The error observed is:

{
  "error": {
    "code": "BadRequest",
    "message": "Please provide below info when asking for support: timestamp = [...], correlationId = [...].",
    "details": [
      {
        "code": "NoValidSubscriptionsInQueryRequest",
        "message": "There must be at least one subscription that is eligible to contain resources. Given: '[AzureGovernmentSubscriptionID]'."
      }
    ]
  }
}

This happens because the Azure SDK clients (azidentity.ClientSecretCredential and armresourcegraph.Client) within the function are initialized without specific options to target the public Azure Public Cloud, even if the associated Crossplane ProviderConfig specifies a different environment (e.g., usgovernment).

How could this Function help solve your problem?

If function-azresourcegraph could correctly use the endpoints for different Azure environments like Azure US Government, it would work for us without needing custom changes.

A good way to achieve this would be for the function to use the specific endpoint URLs that are often included in the credential files for environments like Azure US Government. These credential files (e.g., from az ad sp create-for-rbac --sdk-auth) can contain:

  • activeDirectoryEndpointUrl (e.g., https://login.microsoftonline.us)
  • resourceManagerEndpointUrl (e.g., https://management.usgovcloudapi.net/)

If the function read these URLs from the credentials it's given and used them to configure the AuthorityHost for azidentity.ClientSecretCredentialOptions and the cloud/service endpoint for arm.ClientOptions (used by armresourcegraph.Client), it should then connect to the correct Azure environment.

This would allow the function to be used in Azure US Government and similar Azure environments directly.

主要语言
Go
星标
7
派生
3
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

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

upbound/function-azresourcegraph 的其他 Issue

查看 upbound/function-azresourcegraph 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

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