mirror of
https://github.com/hanzoai/azure-sdk-for-js.git
synced 2026-10-30 19:51:51 +00:00
* refresh 15 * update files * update files * update files * update files * update files * update files * update files * update files * update files
53 lines
1.8 KiB
JavaScript
53 lines
1.8 KiB
JavaScript
/*
|
|
* Copyright (c) Microsoft Corporation.
|
|
* Licensed under the MIT License.
|
|
*
|
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
*/
|
|
|
|
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT License.
|
|
const { MicrosoftSecurityDevOps } = require("@azure/arm-securitydevops");
|
|
const { DefaultAzureCredential } = require("@azure/identity");
|
|
require("dotenv").config();
|
|
|
|
/**
|
|
* This sample demonstrates how to Creates or updates an Azure DevOps Connector.
|
|
*
|
|
* @summary Creates or updates an Azure DevOps Connector.
|
|
* x-ms-original-file: specification/securitydevops/resource-manager/Microsoft.SecurityDevOps/preview/2022-09-01-preview/examples/AzureDevOpsConnectorCreateOrUpdate.json
|
|
*/
|
|
async function azureDevOpsConnectorCreateOrUpdate() {
|
|
const subscriptionId =
|
|
process.env["SECURITYDEVOPS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
|
|
const resourceGroupName = process.env["SECURITYDEVOPS_RESOURCE_GROUP"] || "westusrg";
|
|
const azureDevOpsConnectorName = "testconnector";
|
|
const azureDevOpsConnector = {
|
|
location: "West US",
|
|
properties: {
|
|
authorization: { code: "00000000000000000000" },
|
|
orgs: [
|
|
{
|
|
name: "testOrg",
|
|
projects: [{ name: "testProject", repos: ["testRepo"] }],
|
|
},
|
|
],
|
|
},
|
|
};
|
|
const credential = new DefaultAzureCredential();
|
|
const client = new MicrosoftSecurityDevOps(credential, subscriptionId);
|
|
const result = await client.azureDevOpsConnectorOperations.beginCreateOrUpdateAndWait(
|
|
resourceGroupName,
|
|
azureDevOpsConnectorName,
|
|
azureDevOpsConnector
|
|
);
|
|
console.log(result);
|
|
}
|
|
|
|
async function main() {
|
|
azureDevOpsConnectorCreateOrUpdate();
|
|
}
|
|
|
|
main().catch(console.error);
|