如果在 2024 年 8 月 1 日或之后创建了 GitHub Enterprise Cloud 试用版,则使用基于使用情况的计费来支付许可证费用。 使用基于使用情况的计费,可以为每月使用的许可证数量付费。 不需要提前购买预定义数量的许可证。
重要
如果当前使用批量、订阅或预付费协议支付 GitHub Enterprise 许可证费用,则将继续按这种方式计费,直到协议到期。 续订时,可以选择切换到按流量计费的计费模式。
About connection of an Azure subscription
You can pay for usage of GitHub features through Azure by connecting an Azure Subscription ID to your organization account on GitHub.com. For more information about organization accounts, see 关于组织.
About usage-based billing on GitHub
GitHub provides usage-based billing for the following products.
- GitHub Actions, see GitHub Actions billing
- GitHub Codespaces, see GitHub Codespaces billing
- GitHub Packages, see GitHub Packages billing
- Git Large File Storage, see Git Large File Storage billing
In addition, usage-based billing is available for the following licenses
- GitHub Enterprise, see Billing for GitHub Enterprise
- GitHub Copilot, see GitHub Copilot billing
- GitHub Advanced Security, see GitHub Advanced Security billing
For information about controlling spending, see Setting up budgets to control spending on metered products.
About billing through Azure
If you link your GitHub account to Azure, any usage-based costs starting from that point will be billed through Azure and charged on the 1st of each month. However, remaining GitHub charges, for example charges for your GitHub plan, will still be billed on your usual billing date.
For example, you link your Azure subscription to your organization account on June 16th and you also have a GitHub Copilot Business subscription. From that date onwards, any usage costs for Copilot Business will be included in your Azure bill and charged on July 1st. However, any charges incurred before June 16th for Copilot Business will be billed separately through GitHub on your account's usual billing date.
Prerequisites
-
You must have an organization account on GitHub.com. For more information about the differences between these two types of accounts, see GitHub 帐户类型.
If the organization you want to connect an Azure subscription to belongs to an enterprise account, you must connect your Azure subscription to the enterprise account, not the organization. See the GitHub Enterprise Cloud version of this article.
-
You must be an owner of the organization account. See 组织中的角色.
-
You must be logged into Azure as a user who is able to provide tenant-wide admin consent, which is required to install GitHub's Subscription Permission Validation app on the Azure AD tenant. The app requires read access to display a list of available subscriptions, and is only used during this one-time process of connecting the Azure subscription. See Grant tenant-wide admin consent to an application in Microsoft Docs.
-
Alternatively, before following the instructions in this article, users who are not able to provide tenant-wide admin consent can work with an Azure AD global administrator to configure an admin consent workflow. See User and admin consent in Azure Active Directory in Microsoft Docs.
注意
If your tenant provides user consent settings, users included in those settings might not require admin consent to install GitHub's Subscription Permission Validation app. See User consent in Microsoft Docs.
-
-
To select an Azure subscription from the list of available subscriptions, the user must be an owner of the Azure subscription. See Assign a user as an administrator of an Azure subscription in Microsoft docs.
-
You must know your Azure subscription ID. See Get subscription and tenant IDs in the Azure portal in the Microsoft Docs or contact Azure support.
Video demonstration of connecting a subscription
To connect an Azure subscription, you'll need appropriate access permissions on both GitHub and the Azure billing portal. This may require coordination between two different people.
To see a demo of the process from beginning to end, see Billing GitHub consumption through an Azure subscription on GitHub's YouTube channel. This video demonstrates the process for an enterprise account. If you're connecting a subscription to an organization account, see Connecting your Azure subscription to your organization account.
Connecting your Azure subscription to your organization account
To connect your Azure subscription, you must have owner permissions to the Azure subscription and be an organization owner on GitHub.
注意
If your organization account on GitHub.com belongs an enterprise account, you must connect your Azure subscription to the enterprise account instead of the organization account. See Connecting your Azure subscription to your enterprise account in the GitHub Enterprise Cloud version of this article.
-
在 GitHub 的右上角,选择个人资料照片,然后单击“ 你的组织”****。
-
在组织旁边,单击“设置”。
-
In the "Access" section of the sidebar, click Billing and plans.
-
Under "Billing Management", to the right of "Metered billing via Azure", click Add Azure Subscription.
-
To sign in to your Microsoft account, follow the prompts.
-
Review the "Permissions requested" prompt. If you agree with the terms, click Accept.
如果未看到“请求的权限”提示,而是看到指示需要管理员批准的消息,请参阅消息:“需要管理员批准”。
-
Under "Select a subscription", select the Azure Subscription ID that you want to connect to your organization. 要选择 Azure 订阅,必须对订阅拥有所有者权限。 如果默认租户没有正确的权限,则可能需要指定其他租户 ID。 有关详细信息,请参阅“前提条件”和 Microsoft Docs 中的“Microsoft 标识平台和 OAuth 2.0 授权代码流”。
- 选择“通过单击‘连接’,代表你确认希望通过所选 Azure 订阅对按流量计费的服务计费”****。
- 单击“连接”。
Disconnecting your Azure subscription from your organization account
After you disconnect your Azure subscription from your organization account, your usage can no longer exceed the amounts included with your plan.
-
在 GitHub 的右上角,选择个人资料照片,然后单击“ 你的组织”****。
-
在组织旁边,单击“设置”。
-
In the "Access" section of the sidebar, click Billing and plans.
-
Under "Billing Management", then under "Metered billing via Azure", to the right of the subscription ID you want to disconnect, click .
-
Review the prompt, then click Remove.
Troubleshooting connection of an Azure subscription
You can troubleshoot some common issues with connection of an Azure subscription to your account on GitHub.
Message: "Need admin approval"
If the user account you used to sign into Azure does not have adequate permissions to install the app that GitHub uses to connect a subscription, you'll see a message with the following text.
Need admin approval
GitHub Inc needs permission to access resources in your organization that only an admin can grant. Please ask an admin to grant permission to this app before you can use it.
To avoid this message when you try again, you must either ensure that the Azure user can provide tenant-wide admin consent, or you must work with an Azure administrator to configure the admin consent workflow. For more information, review Prerequisites.