{"id":14064354,"url":"https://github.com/Azure-Samples/Hybrid-PowerShell-Samples","last_synced_at":"2025-07-29T17:33:42.606Z","repository":{"id":47198456,"uuid":"199940907","full_name":"Azure-Samples/Hybrid-PowerShell-Samples","owner":"Azure-Samples","description":"Getting started with compute- manage virtual machines using nodejs","archived":true,"fork":false,"pushed_at":"2021-09-08T21:23:16.000Z","size":59,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":22,"default_branch":"master","last_synced_at":"2024-08-13T07:06:37.174Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PowerShell","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/Azure-Samples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-31T23:09:09.000Z","updated_at":"2024-02-15T10:22:50.000Z","dependencies_parsed_at":"2022-08-27T13:10:22.069Z","dependency_job_id":null,"html_url":"https://github.com/Azure-Samples/Hybrid-PowerShell-Samples","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure-Samples%2FHybrid-PowerShell-Samples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure-Samples%2FHybrid-PowerShell-Samples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure-Samples%2FHybrid-PowerShell-Samples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure-Samples%2FHybrid-PowerShell-Samples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Azure-Samples","download_url":"https://codeload.github.com/Azure-Samples/Hybrid-PowerShell-Samples/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228032928,"owners_count":17858918,"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":[],"created_at":"2024-08-13T07:03:49.636Z","updated_at":"2024-12-04T02:31:43.441Z","avatar_url":"https://github.com/Azure-Samples.png","language":"PowerShell","funding_links":[],"categories":["PowerShell"],"sub_categories":[],"readme":"---\r\npage_type: sample\r\nlanguages: \r\n- powershell\r\nproducts: \r\n- azure-sdks\r\ndescription: \"These samples demonstrate various interaction with Azure Stack Hub.\"\r\nurlFragment: Hybrid-PowerShell-Samples\r\n---\r\n\r\n# Hybrid PowerShell Samples\r\n\r\n\u003c!-- \r\nGuidelines on README format: https://review.docs.microsoft.com/help/onboard/admin/samples/concepts/readme-template?branch=master\r\n\r\nGuidance on onboarding samples to docs.microsoft.com/samples: https://review.docs.microsoft.com/help/onboard/admin/samples/process/onboarding?branch=master\r\n\r\nTaxonomies for products and languages: https://review.docs.microsoft.com/new-hope/information-architecture/metadata/taxonomies?branch=master\r\n--\u003e\r\n\r\nThis repository is for Azure Stack Hub JavaScript samples. Each of the sub-directories contain README.md files detailing how to that sample.\r\n\r\nIf you don't already have it, [install PowerShell Core](https://github.com/PowerShell/powershell/releases).\r\n\r\n## Create Service Principal\r\nCreate a [service principal](https://docs.microsoft.com/en-us/azure/azure-stack/azure-stack-create-service-principals) to work against AzureStack. Make sure your service principal has [contributor/owner role](https://docs.microsoft.com/en-us/azure/azure-stack/azure-stack-create-service-principals#assign-role-to-service-principal) on your subscription. The samples use either a secret or certificate service principal.\r\n\r\n## Configure Service Principal Details\r\nSome of the configuration parameters from service principal objects may not be used in the samples. The configuration file includes them anyway for thoroughness and future-proofing.\r\n\r\n### Setup Secret Service Principal\r\n\r\nSet the following JSON properties in `./azureAppSpConfig.json`.\r\n\r\n| Variable              | Description                                                 |\r\n|-----------------------|-------------------------------------------------------------|\r\n| `clientId`            | Service principal application id.                            |\r\n| `clientSecret`        | Service principal application secret.                        |\r\n| `clientObjectId`      | Service principal object id.                                 |\r\n| `tenantId`            | Azure Stack Hub tenant id.                                   |\r\n| `subscriptionId`      | Subscription id used to access offers in Azure Stack Hub.    |\r\n| `resourceManagerUrl`  | Azure Stack Hub Resource Manager Endpoint.                   |\r\n| `location`            | Azure Resource location.                                     |\r\n\r\n### Setup Certificate Service Principal \r\n\r\nThe certificate service principal will be similar in output to secret service principal, except it uses `azureCertSpConfig.json` config file.\r\n\r\n| Variable              | Description                                                 |\r\n|-----------------------|-------------------------------------------------------------|\r\n| `clientId`            | Service principal application id.                            |\r\n| `certPass`            | Certificate password                                        |\r\n| `certPath`            | \"/\" separated path to the certificate.                      |\r\n| `clientObjectId`      | Service principal object id.                                 |\r\n| `tenantId`            | Azure Stack Hub tenant id.                                   |\r\n| `subscriptionId`      | Subscription id used to access offers in Azure Stack Hub.    |\r\n| `resourceManagerUrl`  | Azure Stack Hub Resource Manager Endpoint.                   |\r\n| `location`            | Azure Resource location.                                     |\r\n\r\nService principal PowerShell object output example for secret service principal:\r\n\r\nAAD\r\n```\r\nSecret                : System.Security.SecureString                                 # clientSecret  (decrypt for external use)\r\nServicePrincipalNames : {bd6bb75f-5fd6-4db9-91b7-4a6941e7feb9, http://azs-sptest01}\r\nApplicationId         : bd6bb75f-5fd6-4db9-91b7-4a6941e7feb9                         # clientId\r\nDisplayName           : azs-sptest01\r\nId                    : 36a22ee4-e2b0-411d-8f21-0ea8b4b5c46f                         # clientObjectId\r\nAdfsId                : \r\nType                  : ServicePrincipal\r\n```\r\n\r\nADFS\r\n```\r\nApplicationIdentifier : S-1-5-21-2937821301-3551617933-4294865508-76632              # clientObjectId\r\nClientId              : 7591924e-0341-4812-8d23-52ef0aa27eff                         # clientId\r\nThumbprint            : \r\nApplicationName       : Azurestack-azs-sptest01\r\nClientSecret          : \u003cRedacted\u003e                                                   # clientSecret\r\nPSComputerName        : \u003cRedacted\u003e\r\nRunspaceId            : e841cbbc-3d8e-45fd-b63f-42adbfbf664b\r\n```\r\n\r\n## Contributing\r\n\r\nThis project welcomes contributions and suggestions.  Most contributions require you to agree to a\r\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\r\nthe rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.\r\n\r\nWhen you submit a pull request, a CLA bot will automatically determine whether you need to provide\r\na CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions\r\nprovided by the bot. You will only need to do this once across all repos using our CLA.\r\n\r\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\r\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\r\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAzure-Samples%2FHybrid-PowerShell-Samples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAzure-Samples%2FHybrid-PowerShell-Samples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAzure-Samples%2FHybrid-PowerShell-Samples/lists"}