{"id":14970299,"url":"https://github.com/hashicorp/go-azure-sdk","last_synced_at":"2025-05-16T15:02:11.258Z","repository":{"id":37517115,"uuid":"501986349","full_name":"hashicorp/go-azure-sdk","owner":"hashicorp","description":"An opinionated Go SDK for Azure Resource Manager","archived":false,"fork":false,"pushed_at":"2025-05-08T14:04:15.000Z","size":94416,"stargazers_count":41,"open_issues_count":44,"forks_count":53,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-05-08T14:43:11.468Z","etag":null,"topics":["azure","azure-resource-manager","golang","sdk"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hashicorp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-06-10T09:43:12.000Z","updated_at":"2025-05-08T14:04:21.000Z","dependencies_parsed_at":"2024-04-22T10:07:37.860Z","dependency_job_id":"134031f4-ffe6-42f1-b4ed-50f939860b9f","html_url":"https://github.com/hashicorp/go-azure-sdk","commit_stats":{"total_commits":1406,"total_committers":27,"mean_commits":"52.074074074074076","dds":0.3072546230440967,"last_synced_commit":"95e46d5889cb230bae1d6bf53727e8e3ed6f9c28"},"previous_names":[],"tags_count":1215,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fgo-azure-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fgo-azure-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fgo-azure-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fgo-azure-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hashicorp","download_url":"https://codeload.github.com/hashicorp/go-azure-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254553936,"owners_count":22090415,"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","azure-resource-manager","golang","sdk"],"created_at":"2024-09-24T13:43:25.044Z","updated_at":"2025-05-16T15:02:06.248Z","avatar_url":"https://github.com/hashicorp.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# `hashicorp/go-azure-sdk`\n\nThis SDK is an opinionated Go SDK for Azure Resource Manager, primarily intended to be used in the [Terraform AzureRM Provider](https://github.com/hashicorp/terraform-provider-azurerm) and the [Packer Azure Plugin](https://github.com/hashicorp/packer-plugin-azure).\n\nThe SDKs within this repository are generated using the data in [the Azure Rest API Specifications repository](https://github.com/Azure/azure-rest-api-specs).\n\nAt this time this SDK uses both [the base-layer within this repository](./sdk) and [the `Azure/go-autorest` base layer](https://github.com/Azure/go-autorest) (although this is gradually being removed).\n\n## Repository Structure\n\nThis repository contains:\n\n* `./docs` - usage documentation.\n* `./microsoft-graph` - the Microsoft Graph Services supported by this SDK.\n* `./resource-manager` - the Resource Manager Services supported by this SDK.\n* `./sdk` - the base layer that's used in this repository.\n\nIn addition, a `README.md` file can be found within each Service / API Version in the `./resource-manager` directory highlighting how that SDK can be used ([example](resource-manager/aadb2c/2021-04-01-preview/tenants)).\n\n## Getting Started\n\nSDKs within this repository can be found within the `./resource-manager` directory, in the structure `./resource-manager/{serviceName}/{apiVersion}/{resource}` for example [this the Resource Groups SDK for API Version `2022-09-01` can be found in `./resource-manager/resources/2022-09-01/resourcegroups`](./resource-manager/resources/2022-09-01/resourcegroups), where the README for which also demonstrates how to use each function.\n\nSDK Clients require authentication which is available from the `auth` package, see [the README in the `./sdk/auth` directory](./sdk/auth) for information on how to authenticate and obtain an Authorizer.\n\nOnce you've got an Authorizer, you can use an SDK Client like so:\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"time\"\n\n\t\"github.com/hashicorp/go-azure-helpers/resourcemanager/commonids\"\n\t\"github.com/hashicorp/go-azure-sdk/resource-manager/resources/2022-09-01/resourcegroups\"\n\t\"github.com/hashicorp/go-azure-sdk/sdk/auth\"\n\t\"github.com/hashicorp/go-azure-sdk/sdk/environments\"\n)\n\nfunc main() {\n\tctx, cancel := context.WithTimeout(context.TODO(), 5 * time.Minute)\n\tdefer cancel()\n\n\tid := commonids.NewResourceGroupID(\"12345678-1234-9876-4563-123456789012\", \"example-resource-group\")\n\tenvironment := environments.AzurePublic()\n\tcredentials := auth.Credentials{\n\t\tEnvironment:                       *environment,\n\t\tEnableAuthenticatingUsingAzureCLI: true,\n\t\t// you can also authenticate using a Service Principal, via MSI, OIDC etc by turning on the flag\n\t}\n\tlog.Printf(\"[DEBUG] Obtaining Credentials..\")\n\tauthorizer, err := auth.NewAuthorizerFromCredentials(ctx, credentials, environment.ResourceManager)\n\tif err != nil {\n\t\tlog.Fatalf(\"building authorizer from credentials: %+v\", err)\n\t}\n\n\tlog.Printf(\"[DEBUG] Building Resource Groups Client..\")\n\tclient, err := resourcegroups.NewResourceGroupsClientWithBaseURI(environment.ResourceManager)\n\tif err != nil {\n\t\tlog.Fatalf(\"building ResourceGroups client: %+v\", err)\n\t}\n\tclient.Client.Authorizer = authorizer\n\n\t// NOTE: the Resource ID type can be used for logging too, it contains a human-friendly description\n\tlog.Printf(\"[DEBUG] Creating %s..\", id)\n\tpayload := resourcegroups.ResourceGroup{\n\t\t// ...\n\t}\n\tif _, err := client.CreateOrUpdate(ctx, id, payload); err != nil {\n\t\tlog.Fatalf(\"creating %s: %+v\", id, err)\n\t}\n\tlog.Printf(\"[DEBUG] %s created..\", id)\n}\n```\n\n## Further Documentation\n\nFurther information [can be found in the `./docs` directory](./docs), and also the `README.md` file within each Service / API Version in the `./resource-manager` directory ([example](resource-manager/aadb2c/2021-04-01-preview/tenants)).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashicorp%2Fgo-azure-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhashicorp%2Fgo-azure-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashicorp%2Fgo-azure-sdk/lists"}