{"id":15676950,"url":"https://github.com/devigned/pub","last_synced_at":"2025-07-02T10:34:14.087Z","repository":{"id":35903549,"uuid":"212691220","full_name":"devigned/pub","owner":"devigned","description":"Command line for automating Azure Marketplace publishing","archived":false,"fork":false,"pushed_at":"2023-02-25T04:05:44.000Z","size":4670,"stargazers_count":13,"open_issues_count":5,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-06T22:14:09.610Z","etag":null,"topics":["azure","iaas","marketplace","publishing","vhd","vm"],"latest_commit_sha":null,"homepage":"https://docs.microsoft.com/en-us/azure/marketplace/cloud-partner-portal-orig/cloud-partner-portal-getting-started-with-the-cloud-partner-portal","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devigned.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-03T22:18:40.000Z","updated_at":"2023-12-13T21:24:25.000Z","dependencies_parsed_at":"2024-06-19T05:32:19.771Z","dependency_job_id":"6eaa88f3-5039-44a9-82f5-4cb6a1c22e71","html_url":"https://github.com/devigned/pub","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devigned%2Fpub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devigned%2Fpub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devigned%2Fpub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devigned%2Fpub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devigned","download_url":"https://codeload.github.com/devigned/pub/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252776600,"owners_count":21802469,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azure","iaas","marketplace","publishing","vhd","vm"],"created_at":"2024-10-03T16:07:36.188Z","updated_at":"2025-05-06T22:14:20.823Z","avatar_url":"https://github.com/devigned.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pub: cmd line for the Azure Cloud Partner Portal\n\n[![Actions Status](https://github.com/devigned/pub/workflows/ci/badge.svg)](https://github.com/devigned/pub/actions)\n\nPub enables command line automation for working with offers on\n[Azure Marketplace](https://azuremarketplace.microsoft.com/) and on\n[AppSource](https://appsource.microsoft.com/). For more information on the Cloud Partner\nPortal, check out [Azure Docs](https://docs.microsoft.com/en-us/azure/marketplace/cloud-partner-portal-orig/cloud-partner-portal-getting-started-with-the-cloud-partner-portal).\n\nThe command line interface for `pub` is simply a facade over the [REST API exposed by the\nCloud Partner Portal](https://docs.microsoft.com/en-us/azure/marketplace/cloud-partner-portal-orig/cloud-partner-portal-api-overview).\n\n## Install\n\nEasiest way is to use golang, but there are also precompiled binaries on the [releases page](https://github.com/devigned/pub/releases/).\n\n```bash\n$ go get github.com/devigned/pub\n...\n$ pub -h\n...\n```\n\n## Usage\n\nFrom the top level, `pub` offers access to view and manipulate resources.\n\n```bash\npub provides a command line interface for the Azure Cloud Partner Portal\n\nUsage:\n  pub [command]\n\nAvailable Commands:\n  help        Help about any command\n  offers      a group of actions for working with offers\n  operations  a group of actions for working with offer operations\n  publishers  a group of actions for working with publishers\n  skus        a group of actions for working with SKUs\n  version     Print the git ref\n  versions    a group of actions for working with versions\n\nFlags:\n  -v, --api-version string   the API version override (default \"2017-10-31\")\n      --config string        config file (default is $HOME/.pub.yaml)\n  -h, --help                 help for pub\n\nUse \"pub [command] --help\" for more information about a command.\n```\n\n### Object Model\n\n- Publishers have many offers\n- Offers can have many SKUS\n- Offers can have many operations with only one active operation\n- SKUs can have many versions\n\n### Authentication\n\nThere are two ways to authenticate to `pub`. Both paths use Azure Active Directory (AAD) to\nauthenticate against the `https://cloudpartner.azure.com` resource URI. Using a token\ngenerated by [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest)\nis probably the easiest way to get started. When you are ready to fully automate the\npublication process, using a AAD Service Principal / Application will make it easier to\ninject environment variables into a build process.\n\n#### Using an Azure Active Directory Token via Azure CLI\n\nWith the commands below, you can fetch an AAD token via Azure CLI and use it to auth calls\nin pub.\n\n```bash\ntoken=$(az account get-access-token --resource https://cloudpartner.azure.com --query \"accessToken\" -o tsv)\nAZURE_TOKEN=$token pub publishers list\n```\n\n#### Using an AAD Application and Service Principal\n\n**Prerequisite:** [setup an AAD Application and Service Principal](https://docs.microsoft.com/en-us/azure/marketplace/cloud-partner-portal-orig/cloud-partner-portal-api-prerequisites#create-a-service-principal-in-your-azure-active-directory-tenant).\n\nAfter setting up the AAD App / Service Principal, set the following environment variables:\n\n```bash\nexport AZURE_TENANT_ID=\u003ctenant uuid\u003e\nexport AZURE_CLIENT_ID=\u003capplication / client uuid\u003e\nexport AZURE_CLIENT_SECRET=\u003cservice principal secret / password\u003e\npub publishers list\n```\n\n### Command Output\n\nAll command output and any complex input is formatted as JSON. Definitely recommend using\n[jq](https://stedolan.github.io/jq/) or something similar.\n\n### Publishers\n\nProvides the ability to query the publishers.\n\n```bash\n$ ./bin/pub publishers -h\na group of actions for working with publishers\n\nUsage:\n  pub publishers [command]\n\nAvailable Commands:\n  list        list all publishers\n\nFlags:\n  -h, --help   help for publishers\n\nGlobal Flags:\n  -v, --api-version string   the API version override (default \"2017-10-31\")\n      --config string        config file (default is $HOME/.pub.yaml)\n\nUse \"pub publishers [command] --help\" for more information about a command.\n\n$ ./bin/pub publishers list | jq\n[\n  {\n    \"id\": \"your-publisher-id\",\n    \"definition\": {\n      \"displayText\": \"Your Publisher Name\",\n      \"offerTypeCategories\": [\n        \"someCategories\"\n      ],\n      \"sellerId\": 1234567\n    }\n  }\n]\n```\n\n### Offers\n\nOffers is the heart of most of the Cloud Partner Portal workflow. For more details, see [the\nmarketplace offers documentation](https://docs.microsoft.com/en-us/azure/marketplace/cloud-partner-portal/cpp-marketplace-offers).\nOffers represent a marketing / description header over a set of `SKUs`.\n\nTo take a publication to market, run the following workflow:\n\n`put offer -\u003e put version -\u003e publish offer -\u003e test offer -\u003e live`\n\nThe publish and live commands both start a long running operation which can be observed via\nthe `operations` commands. There can only be 1 operation running on an offer at a time.\n\n```bash\n$ pub offers\na group of actions for working with offers\n\nUsage:\n  pub offers [command]\n\nAvailable Commands:\n  list        list all offers\n  live        go live with an offer (make available to the world)\n  publish     publish an offer\n  put         create or update an offer\n  show        show an offer\n  status      show status for an offer\n...\n```\n\n### SKUs\n\nA `SKU`, or a `Plan` in the REST API, contains details for a specific type of offering. For example,\nthe `SKU` represents a VM Image or other specialized, versioned type under an offering.\n\n```bash\n$ pub skus\na group of actions for working with SKUs\n\nUsage:\n  pub skus [command]\n\nAvailable Commands:\n  list        list all SKUs for a given offer and publisher\n  put         create a SKU\n  show        show a SKU for a given offer\n...\n```\n\n### Versions\n\nVersions are the lowest level resource in the marketplace. For example, in a VM Image, this would\nconsist of the URI to the VHD media and details related to that specific version of the image.\n\n```bash\n$ pub versions\na group of actions for working with versions\n\nUsage:\n  pub versions [command]\n\nAvailable Commands:\n  list        list all versions for a given plan\n  put         put a version for a given plan\n  show        show a version for a given plan\n...\n```\n\n### Operations\n\nOperations provide insight into the workflow and status of the publication process.\n\n```bash\n$ pub operations\na group of actions for working with offer operations\n\nUsage:\n  pub operations [command]\n\nAvailable Commands:\n  cancel      cancel the active operation for a given offer and print the operations\n  list        list operations and optionally filter by status\n  show        show an operation by Id\n...\n```\n\n### Debug Output\n\nIf you want to see more details about the HTTP requests being made, run any command with\n`DEBUG=true`.\n\n```bash\n$ DEBUG=true pub publishers list\nGET /api/publishers?api-version=2017-10-31 HTTP/1.1\nHost: cloudpartner.azure.com\n\nHTTP/1.1 200 OK\nTransfer-Encoding: chunked\nCache-Control: no-cache\nContent-Type: application/json; charset=utf-8\nDate: Sun, 03 Nov 2019 16:55:07 GMT\nExpires: -1\nPragma: no-cache\nServer: Microsoft-IIS/10.0\nVary: Accept-Encoding\nX-Aspnet-Version: 4.0.30319\nX-Content-Type-Options: nosniff\nX-Ms-Correlation-Request-Id: dc12d384-6c53-4880-9b84-de1e89cbf9c7\nX-Powered-By: ASP.NET\n\n8a\n[{\"version\":0,\"id\":\"your-publisher-id\",\"definition\":{\"displayText\":\"Your publisher name,\"offerTypeCategories\":[\"someCategory\"],\"sellerId\":1234456}}]\n0\n\n[{\"id\":\"your-publisher-id\",\"definition\":{\"displayText\":\"Your publisher name,\"offerTypeCategories\":[\"someCategory\"],\"sellerId\":1234456}}]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevigned%2Fpub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevigned%2Fpub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevigned%2Fpub/lists"}