mirror of
https://github.com/hanzoai/azure-sdk-for-js.git
synced 2026-10-30 19:51:51 +00:00
Configurations: 'specification/managedoperations/ManagedOps.Management/tspconfig.yaml', API Version: 2025-07-28-preview, SDK Release Type: beta, and CommitSHA: 'ed16e10caee8ef2ab09f321272877d0efbec0d1e' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5863945 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. **Release plan link:** [https://web.powerapps.com/apps/821ab569-ae60-420d-8264-d7b5d5ef734c?release-plan-id=6712851c-60ef-f011-8407-000d3a5b0bfe](https://web.powerapps.com/apps/821ab569-ae60-420d-8264-d7b5d5ef734c?release-plan-id=6712851c-60ef-f011-8407-000d3a5b0bfe) **Submitted by**: [email protected] ## Release Plan Details - Release Plan: https://aka.ms/sdk-release-planner?release-plan-id=6712851c-60ef-f011-8407-000d3a5b0bfe Spec pull request: https://github.com/Azure/azure-rest-api-specs/pull/40187 Spec API version: 2025-07-28-preview --------- Co-authored-by: kazrael2119 <[email protected]>
41 lines
1.6 KiB
TypeScript
41 lines
1.6 KiB
TypeScript
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT License.
|
|
|
|
import { ManagedOpsClient } from "@azure/arm-managedops";
|
|
import { DefaultAzureCredential } from "@azure/identity";
|
|
|
|
/**
|
|
* This sample demonstrates how to creates or updates the ManagedOps instance.
|
|
*
|
|
* @summary creates or updates the ManagedOps instance.
|
|
* x-ms-original-file: 2025-07-28-preview/ManagedOps_CreateOrUpdate.json
|
|
*/
|
|
async function managedOpsCreateOrUpdate(): Promise<void> {
|
|
const credential = new DefaultAzureCredential();
|
|
const subscriptionId = "11809CA1-E126-4017-945E-AA795CD5C5A9";
|
|
const client = new ManagedOpsClient(credential, subscriptionId);
|
|
const result = await client.managedOps.createOrUpdate("default", {
|
|
properties: {
|
|
desiredConfiguration: {
|
|
changeTrackingAndInventory: {
|
|
logAnalyticsWorkspaceId:
|
|
"/subscriptions/11809CA1-E126-4017-945E-AA795CD5C5A9/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/00000000-0000-0000-0000-000000000000-Default",
|
|
},
|
|
azureMonitorInsights: {
|
|
azureMonitorWorkspaceId:
|
|
"/subscriptions/11809CA1-E126-4017-945E-AA795CD5C5A9/resourceGroups/myResourceGroup/providers/Microsoft.Monitor/accounts/example",
|
|
},
|
|
userAssignedManagedIdentityId:
|
|
"/subscriptions/11809CA1-E126-4017-945E-AA795CD5C5A9/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myManagedIdentity",
|
|
},
|
|
},
|
|
});
|
|
console.log(result);
|
|
}
|
|
|
|
async function main(): Promise<void> {
|
|
await managedOpsCreateOrUpdate();
|
|
}
|
|
|
|
main().catch(console.error);
|