title | shortTitle | intro | versions | type | permissions | topics | redirect_from | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Configuring private networking for GitHub-hosted runners in your enterprise |
Configuring private networking |
Learn how to use {% data variables.product.company_short %}-hosted runners with an Azure private network. |
|
how_to |
Enterprise owners can configure private networking for GitHub-hosted runners at the enterprise level. |
|
|
{% data reusables.actions.azure-vnet-configuring-overview %}
{% data reusables.actions.azure-vnet-procedures-prereqs %}
You can use the following GraphQL query to retrieve your enterprise databaseId
. You will use the enterprise databaseId
for the value of the DATABASE_ID
environment variable in the next step. For more information on working with GraphQL, see "AUTOTITLE."
{% data reusables.enterprise_migrations.retrieve-enterprise-id-graphql %}
query(
$slug: String!
){
enterprise (slug: $slug)
{
slug
databaseId
}
}
'
Variables
{
"slug": "ENTERPRISE_SLUG"
}
You can use the following curl command to find your databaseId
.
curl -H "Authorization: Bearer BEARER_TOKEN" -X POST \
-d '{ "query": "query($slug: String!) { enterprise (slug: $slug) { slug databaseId } }" ,
"variables": {
"slug": "ENTERPRISE_SLUG"
}
}' \
https://api.github.com/graphql
You can use the following {% data variables.product.prodname_cli %} commands to retrieve the databaseId
. Replace SUBDOMAIN with your enterprise's subdomain of {% data variables.enterprise.data_residency_site %}.
gh auth login -s 'read:enterprise' -h SUBDOMAIN.ghe.com
gh api graphql --hostname SUBDOMAIN.ghe.com -f query='query($slug: String!) { enterprise (slug: $slug) { slug databaseId } }' -f slug='SUBDOMAIN'
{% data reusables.actions.azure-vnet-configure-azure-resources-script %}
{% data reusables.actions.azure-vnet-creating-network-configuration-prereqs %}
{% data reusables.enterprise-accounts.access-enterprise %} {% data reusables.enterprise-accounts.settings-tab %}
- In the left sidebar, click Hosted compute networking.
- Click the New network configuration dropdown. Then click Azure private network.
- Name your network configuration.
- Click Add Azure Virtual Network.
- In the popup window, enter the network settings resource ID you retrieved when you configured your Azure resources for private networking.
- Click Add Azure Virtual Network.
Note
For the runner group to be accessible by repositories within your organizations, those repositories must have access to that runner group at the organization level. For more information, see "AUTOTITLE."
- Create a new runner group for your enterprise. For more information about how to create a runner group, see "AUTOTITLE." {% data reusables.actions.workflows.runner-groups-enterprise-organization-access %}
- While configuring your runner group, under "Network configurations," use the dropdown menu to select the network configuration you created for the Azure VNET.
- To create the group and apply the policy, click Create group.
Note
When adding your {% data variables.product.company_short %}-hosted runner to a runner group, select the runner group you created in the previous procedures.
- Add the {% data variables.product.company_short %}-hosted runner to the runner group. For more information, see "AUTOTITLE."
{% data reusables.enterprise-accounts.access-enterprise %} {% data reusables.enterprise-accounts.settings-tab %}
- In the left sidebar, click Hosted compute networking.
- To edit a network configuration, to the right of the network configuration, click {% octicon "pencil" aria-label="Edit a network configuration" %}. Then click Edit configuration.
- To disable a network configuration, to the right of the network configuration, click {% octicon "kebab-horizontal" aria-label="Menu" %}. Then click Disable.
- To delete a network configuration, to the right of the network configuration, click {% octicon "kebab-horizontal" aria-label="Menu" %}. Then click Delete.
You can allow organization owners in an enterprise to create their own organization-level network configurations.
{% data reusables.enterprise-accounts.access-enterprise %} {% data reusables.enterprise-accounts.policies-tab %}
- Click Hosted compute networking.
- Under "Hosted compute networking," click Enable.
- Click Save.
{% data reusables.actions.azure-vnet-deleting-a-subnet %}