Skip to content

Instantly share code, notes, and snippets.

@aws-scripting-guy
Last active October 30, 2023 07:47
Show Gist options
  • Save aws-scripting-guy/19856ce019a6263083f671902520a5f5 to your computer and use it in GitHub Desktop.
Save aws-scripting-guy/19856ce019a6263083f671902520a5f5 to your computer and use it in GitHub Desktop.
GitHub Actions Azure Service Connection (az ad sp create-for-rbac --name "myApp" --json-auth)

Following will create service principal in Azure outputting auth creds in JSON format compatible with GitHub Actions. https://learn.microsoft.com/en-us/azure/developer/github/connect-from-azure?tabs=azure-portal%2Cwindows

az ad sp create-for-rbac --name "myApp" --json-auth
{
  "clientId": "",
  "clientSecret": "",
  "subscriptionId": "",
  "tenantId": "",
  "activeDirectoryEndpointUrl": "https://login.microsoftonline.com",
  "resourceManagerEndpointUrl": "https://management.azure.com/",
  "activeDirectoryGraphResourceId": "https://graph.windows.net/",
  "sqlManagementEndpointUrl": "https://management.core.windows.net:8443/",
  "galleryEndpointUrl": "https://gallery.azure.com/",
  "managementEndpointUrl": "https://management.core.windows.net/"
}

if one wants to use existing service principal for GitHub Actions this format should work just fill in client secrets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment