Skip to content

Commit a121c6b

Browse files
Merge pull request #209269 from AndrewCS149/andrsmith/updateAutomageDocs
Andrsmith/update automage docs
2 parents a75d942 + b008e5d commit a121c6b

File tree

9 files changed

+495
-0
lines changed

9 files changed

+495
-0
lines changed

articles/automanage/TOC.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@
55
items:
66
- name: Enable on VMs in the Azure portal
77
href: quick-create-virtual-machines-portal.md
8+
- name: GO
9+
href: quick-go-sdk.md
10+
- name: Python
11+
href: quick-python-sdk.md
12+
- name: Java
13+
href: quick-java-sdk.md
14+
- name: JavaScript
15+
href: quick-javascript-sdk.md
16+
- name: Tutorials
17+
expanded: true
18+
items:
19+
- name: Create assignment with Python
20+
href: tutorial-create-assignment-python.md
821
- name: Concepts
922
expanded: true
1023
items:
@@ -44,6 +57,11 @@
4457
href: move-automanaged-configuration-profile.md
4558
- name: Windows Server VNext Datacenter Azure Edition (preview)
4659
href: windows-server-azure-edition-vnext.md
60+
- name: References
61+
expanded: true
62+
items:
63+
- name: SDKs
64+
href: reference-sdk.md
4765
- name: Resources
4866
expanded: true
4967
items:
22.5 KB
Loading
68.7 KB
Loading

articles/automanage/quick-go-sdk.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
title: Azure Quickstart SDK for Go
3+
description: Create configuration profile assignments using the GO SDK for Automanage.
4+
author: andrsmith
5+
ms.service: automanage
6+
ms.workload: infrastructure
7+
ms.topic: quickstart
8+
ms.date: 08/24/2022
9+
ms.author: andrsmith
10+
---
11+
12+
# Quickstart: Enable Azure Automanage for virtual machines using GO
13+
14+
Azure Automanage allows users to seamlessly apply Azure best practices to their virtual machines. This quickstart guide will help you apply a Best Practices Configuration profile to an existing virtual machine using the [azure-sdk-for-go repo](https://github.com/Azure/azure-sdk-for-go).
15+
16+
## Prerequisites
17+
18+
- An active [Azure Subscription](https://azure.microsoft.com/pricing/purchase-options/pay-as-you-go/)
19+
- An existing [Virtual Machine](../virtual-machines/windows/quick-create-portal.md)
20+
21+
> [!NOTE]
22+
> Free trial accounts do not have access to the virtual machines used in this tutorial. Please upgrade to a Pay-As-You-Go subscription.
23+
24+
> [!IMPORTANT]
25+
> You need to have the **Contributor** role on the resource group containing your VMs to enable Automanage. If you are enabling Automanage for the first time on a subscription, you need the following permissions: **Owner** role or **Contributor** along with **User Access Administrator** roles on your subscription.
26+
27+
## Install required packages
28+
29+
For this demo, both the **Azure Identity** and **Azure Automanage** packages are required.
30+
31+
```
32+
go get "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
33+
go get "github.com/Azure/azure-sdk-for-go/sdk/azidentity"
34+
```
35+
36+
## Import packages
37+
38+
Import the **Azure Identity** and **Azure Automanage** packages into the script:
39+
40+
```go
41+
import (
42+
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
43+
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automanage/armautomanage"
44+
)
45+
```
46+
47+
## Authenticate to Azure and create an Automanage client
48+
49+
Use the **Azure Identity** package to authenticate to Azure and then create an Automanage Client:
50+
51+
```go
52+
credential, err := azidentity.NewDefaultAzureCredential(nil)
53+
configProfilesClient, err := armautomanage.NewConfigurationProfilesClient("<subscription ID>", credential, nil)
54+
```
55+
56+
## Enable best practices configuration profile to an existing virtual machine
57+
58+
```go
59+
configProfileId := "/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesProduction"
60+
61+
properties := armautomanage.ConfigurationProfileAssignmentProperties{
62+
ConfigurationProfile: &configProfileId,
63+
}
64+
65+
assignment := armautomanage.ConfigurationProfileAssignment{
66+
Properties: &properties,
67+
}
68+
69+
// assignment name must be 'default'
70+
newAssignment, err = assignmentClient.CreateOrUpdate(context.Background(), "default", "resourceGroupName", "vmName", assignment, nil)
71+
```
72+
73+
## Next steps
74+
75+
Learn how to conduct more operations with the GO Automanage Client by visiting the [azure-sdk-for-go repo](https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/resourcemanager/automanage/armautomanage/).
76+

articles/automanage/quick-java-sdk.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
---
2+
title: Azure Quickstart SDK for Java
3+
description: Create configuration profile assignments using the Java SDK for Automanage.
4+
author: andrsmith
5+
ms.service: automanage
6+
ms.workload: infrastructure
7+
ms.topic: quickstart
8+
ms.date: 08/24/2022
9+
ms.author: andrsmith
10+
---
11+
12+
# Quickstart: Enable Azure Automanage for virtual machines using Java
13+
14+
Azure Automanage allows users to seamlessly apply Azure best practices to their virtual machines. This quickstart guide will help you apply a Best Practices Configuration profile to an existing virtual machine using the [azure-sdk-for-java repo](https://github.com/Azure/azure-sdk-for-java).
15+
16+
## Prerequisites
17+
18+
- [Java Development Kit (JDK)](https://www.oracle.com/java/technologies/downloads/#java8) version 8+
19+
- An active [Azure Subscription](https://azure.microsoft.com/pricing/purchase-options/pay-as-you-go/)
20+
- An existing [Virtual Machine](../virtual-machines/windows/quick-create-portal.md)
21+
22+
> [!NOTE]
23+
> Free trial accounts do not have access to the virtual machines used in this tutorial. Please upgrade to a Pay-As-You-go subscription.
24+
25+
> [!IMPORTANT]
26+
> You need to have the **Contributor** role on the resource group containing your VMs to enable Automanage. If you are enabling Automanage for the first time on a subscription, you need the following permissions: **Owner** role or **Contributor** along with **User Access Administrator** roles on your subscription.
27+
28+
## Add required dependencies
29+
30+
Add the **Azure Identity** and **Azure Automanage** dependencies to the `pom.xml`.
31+
32+
```xml
33+
<!-- https://mvnrepository.com/artifact/com.azure/azure-identity -->
34+
<dependency>
35+
<groupId>com.azure</groupId>
36+
<artifactId>azure-identity</artifactId>
37+
<version>1.6.0-beta.1</version>
38+
<scope>test</scope>
39+
</dependency>
40+
41+
<!-- https://mvnrepository.com/artifact/com.azure.resourcemanager/azure-resourcemanager-automanage -->
42+
<dependency>
43+
<groupId>com.azure.resourcemanager</groupId>
44+
<artifactId>azure-resourcemanager-automanage</artifactId>
45+
<version>1.0.0-beta.1</version>
46+
</dependency>
47+
```
48+
49+
## Authenticate to Azure and create an Automanage client
50+
51+
Use the **Azure Identity** package to authenticate to Azure and then create an Automanage Client:
52+
53+
```java
54+
AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
55+
TokenCredential credential = new DefaultAzureCredentialBuilder()
56+
.authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint())
57+
.build();
58+
59+
AutomanageManager client = AutomanageManager
60+
.authenticate(credential, profile);
61+
```
62+
63+
## Enable best practices configuration profile to an existing virtual machine
64+
65+
```java
66+
String configProfile = "/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesProduction";
67+
68+
client
69+
.configurationProfileAssignments()
70+
.define("default") // name must be default
71+
.withExistingVirtualMachine("resourceGroupName", "vmName")
72+
.withProperties(
73+
new ConfigurationProfileAssignmentProperties()
74+
.withConfigurationProfile(configProfile))
75+
.create();
76+
```
77+
78+
## Next steps
79+
80+
Learn how to conduct more operations with the Java Automanage Client by visiting the [azure-sdk-for-java repo](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/automanage/azure-resourcemanager-automanage).
81+
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
title: Azure Quickstart SDK for JavaScript
3+
description: Create configuration profile assignments using the JavaScript SDK for Automanage.
4+
author: andrsmith
5+
ms.service: automanage
6+
ms.workload: infrastructure
7+
ms.topic: quickstart
8+
ms.date: 08/24/2022
9+
ms.author: andrsmith
10+
---
11+
12+
# Quickstart: Enable Azure Automanage for virtual machines using JavaScript
13+
14+
Azure Automanage allows users to seamlessly apply Azure best practices to their virtual machines. This quickstart guide will help you apply a Best Practices Configuration profile to an existing virtual machine using the [azure-sdk-for-js repo](https://github.com/Azure/azure-sdk-for-js).
15+
16+
## Prerequisites
17+
18+
- An active [Azure Subscription](https://azure.microsoft.com/pricing/purchase-options/pay-as-you-go/)
19+
- An existing [Virtual Machine](../virtual-machines/windows/quick-create-portal.md)
20+
21+
> [!NOTE]
22+
> Free trial accounts do not have access to the virtual machines used in this tutorial. Please upgrade to a Pay-As-You-Go subscription.
23+
24+
> [!IMPORTANT]
25+
> You need to have the **Contributor** role on the resource group containing your VMs to enable Automanage. If you are enabling Automanage for the first time on a subscription, you need the following permissions: **Owner** role or **Contributor** along with **User Access Administrator** roles on your subscription.
26+
27+
## Install required packages
28+
29+
For this demo, both the **Azure Identity** and **Azure Automanage** packages are required.
30+
31+
```
32+
npm install @azure/arm-automanage
33+
npm install @azure/identity
34+
```
35+
36+
## Import packages
37+
38+
Import the **Azure Identity** and **Azure Automanage** packages into the script:
39+
40+
```javascript
41+
const { AutomanageClient } = require("@azure/arm-automanage");
42+
const { DefaultAzureCredential } = require("@azure/identity");
43+
```
44+
45+
## Authenticate to Azure and create an Automanage client
46+
47+
Use the **Azure Identity** package to authenticate to Azure and then create an Automanage Client:
48+
49+
```javascript
50+
const credential = new DefaultAzureCredential();
51+
const client = new AutomanageClient(credential, "<subscription ID>");
52+
```
53+
54+
## Enable best practices configuration profile to an existing virtual machine
55+
56+
```javascript
57+
let assignment = {
58+
"properties": {
59+
"configurationProfile": "/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesProduction"
60+
}
61+
}
62+
63+
// assignment name must be named "default"
64+
await client.configurationProfileAssignments.createOrUpdate("default", "resourceGroupName", "vmName", assignment);
65+
```
66+
67+
## Next steps
68+
69+
Learn how to conduct more operations with the JavaScript Automanage Client by visiting the [azure-sdk-for-js repo](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/automanage/arm-automanage).
70+
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
title: Azure Quickstart SDK for Python
3+
description: Create configuration profile assignments using the Python SDK for Automanage.
4+
author: andrsmith
5+
ms.service: automanage
6+
ms.workload: infrastructure
7+
ms.topic: quickstart
8+
ms.date: 08/24/2022
9+
ms.author: andrsmith
10+
---
11+
12+
# Quickstart: Enable Azure Automanage for virtual machines using Python
13+
14+
Azure Automanage allows users to seamlessly apply Azure best practices to their virtual machines. This quickstart guide will help you apply a Best Practices Configuration profile to an existing virtual machine using the [azure-sdk-for-python repo](https://github.com/Azure/azure-sdk-for-python).
15+
16+
## Prerequisites
17+
18+
- An active [Azure Subscription](https://azure.microsoft.com/pricing/purchase-options/pay-as-you-go/)
19+
- An existing [Virtual Machine](../virtual-machines/windows/quick-create-portal.md)
20+
21+
> [!NOTE]
22+
> Free trial accounts do not have access to the virtual machines used in this tutorial. Please upgrade to a Pay-As-You-Go subscription.
23+
24+
> [!IMPORTANT]
25+
> You need to have the **Contributor** role on the resource group containing your VMs to enable Automanage. If you are enabling Automanage for the first time on a subscription, you need the following permissions: **Owner** role or **Contributor** along with **User Access Administrator** roles on your subscription.
26+
27+
## Install required packages
28+
29+
For this demo, both the **Azure Identity** and **Azure Automanage** packages are required.
30+
31+
Use `pip` to install these packages:
32+
33+
```
34+
pip install azure-identity
35+
pip install azure-mgmt-automanage
36+
```
37+
38+
## Import packages
39+
40+
Import the **Azure Identity** and **Azure Automanage** packages into the script:
41+
42+
```python
43+
from azure.identity import DefaultAzureCredential
44+
from azure.mgmt.automanage import AutomanageClient
45+
```
46+
47+
## Authenticate to Azure and create an Automanage client
48+
49+
Use the **Azure Identity** package to authenticate to Azure and then create an Automanage Client:
50+
51+
```python
52+
credential = DefaultAzureCredential()
53+
client = AutomanageClient(credential, "<subscription ID>")
54+
```
55+
56+
## Enable best practices configuration profile to an existing virtual machine
57+
58+
```python
59+
assignment = {
60+
"properties": {
61+
"configurationProfile": "/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesProduction",
62+
}
63+
}
64+
65+
client.configuration_profile_assignments.create_or_update("default", "resourceGroupName", "vmName", assignment)
66+
```
67+
68+
## Next steps
69+
70+
Learn how to conduct more operations with the Automanage Client by visiting the [azure-samples-python-management repo](https://github.com/Azure-Samples/azure-samples-python-management/tree/main/samples/automanage).
71+

articles/automanage/reference-sdk.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
title: SDK Overview
3+
description: Get started with the Automanage SDKs.
4+
author: andrsmith
5+
ms.service: automanage
6+
ms.workload: infrastructure
7+
ms.topic: reference
8+
ms.date: 08/25/2022
9+
ms.author: andrsmith
10+
---
11+
12+
# Automanage SDK overview
13+
14+
Azure Automanage currently supports the following SDKs:
15+
16+
- [Python](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/automanage/azure-mgmt-automanage)
17+
- [Go](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/resourcemanager/automanage/armautomanage)
18+
- [Java](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/automanage/azure-resourcemanager-automanage)
19+
- [JavaScript](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/automanage/arm-automanage)
20+
- CSharp (pending)
21+
- PowerShell (pending)
22+
- Azure CLI (pending)
23+
- Terraform (pending)
24+
25+
Here's a list of a few of the primary operations the SDKs provide:
26+
27+
- Create custom configuration profiles
28+
- Delete custom configuration profiles
29+
- Create Best Practices profile assignments
30+
- Create custom profile assignments
31+
- Remove assignments

0 commit comments

Comments
 (0)