Skip to content

Commit 1dccd9d

Browse files
authored
Merge pull request #49930 from MGoedtel/LACreateWorkspace824
Updated create workspace content
2 parents 92bf55c + 567eb5d commit 1dccd9d

File tree

4 files changed

+282
-18
lines changed

4 files changed

+282
-18
lines changed
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
---
2+
title: Create a Log Analytics workspace using Azure CLI | Microsoft Docs
3+
description: Learn how to create a Log Analytics workspace to enable management solutions and data collection from your cloud and on-premises environments with Azure CLI.
4+
services: log-analytics
5+
documentationcenter: log-analytics
6+
author: mgoedtel
7+
manager: carmonm
8+
editor: ''
9+
ms.assetid:
10+
ms.service: log-analytics
11+
ms.workload: na
12+
ms.tgt_pltfrm: na
13+
ms.devlang: na
14+
ms.topic: conceptal
15+
ms.date: 08/27/2018
16+
ms.author: magoedte
17+
ms.component: na
18+
---
19+
20+
# Create a Log Analytics workspace with Azure CLI 2.0
21+
22+
The Azure CLI 2.0 is used to create and manage Azure resources from the command line or in scripts. This quickstart shows you how to use Azure CLI 2.0 to deploy a Log Analytics workspace in Azure, which is a unique environment with its own data repository, data sources, and solutions. The steps described in this article are required if you intend on collecting data from the following sources:
23+
24+
* Azure resources in your subscription
25+
* On-premises computers monitored by System Center Operations Manager
26+
* Device collections from System Center Configuration Manager
27+
* Diagnostic or log data from Azure storage
28+
29+
For other sources, such as Azure VMs and Windows or Linux VMs in your environment, see the following topics:
30+
31+
* [Collect data from Azure virtual machines](log-analytics-quick-collect-azurevm.md)
32+
* [Collect data from hybrid Linux computer](log-analytics-quick-collect-linux-computer.md)
33+
* [Collect data from hybrid Windows computer](log-analytics-quick-collect-windows-computer.md)
34+
35+
If you don't have an Azure subscription, create [a free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
36+
37+
[!INCLUDE [cloud-shell-try-it.md](../../includes/cloud-shell-try-it.md)]
38+
39+
If you choose to install and use the CLI locally, this quickstart requires that you are running the Azure CLI version 2.0.30 or later. Run `az --version` to find the version. If you need to install or upgrade, see [Install Azure CLI 2.0](https://docs.microsoft.com/cli/azure/install-azure-cli?view=azure-cli-latest).
40+
41+
## Create a workspace
42+
Create a worksapce with [az group deployment create](https://docs.microsoft.com/cli/azure/group/deployment?view=azure-cli-latest#az-group-deployment-create). The following example creates a workspace named *TestWorkspace* in the resource group *Lab* in the *eastus* location using a Resource Manager template from your local machine. The JSON template is configured to only prompt you for the name of the workspace, and specifies a default value for the other parameters that would likely be used as a standard configuration in your environment. Or you can store the template in an Azure storage account for shared access in your organization. For further information about working with templates, see [Deploy resources with Resource Manager templates and Azure CLI](../azure-resource-manager/resource-group-template-deploy-cli.md)
43+
44+
The following parameters set a default value:
45+
46+
* location - defaults to East US
47+
* sku - defaults to the new Per-GB pricing tier released in the April 2018 pricing model
48+
49+
>[!WARNING]
50+
>If creating or configuring a Log Analytics workspace in a subscription that has opted into the new April 2018 pricing model, the only valid Log Analytics pricing tier is **PerGB2018**.
51+
>
52+
53+
### Create and deploy template
54+
55+
1. Copy and paste the following JSON syntax into your file:
56+
57+
```json
58+
{
59+
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
60+
"contentVersion": "1.0.0.0",
61+
"parameters": {
62+
"workspaceName": {
63+
"type": "String",
64+
"metadata": {
65+
"description": "Specifies the name of the workspace."
66+
}
67+
},
68+
"location": {
69+
"type": "String",
70+
"allowedValues": [
71+
"eastus",
72+
"westus"
73+
],
74+
"defaultValue": "eastus",
75+
"metadata": {
76+
"description": "Specifies the location in which to create the workspace."
77+
}
78+
},
79+
"sku": {
80+
"type": "String",
81+
"allowedValues": [
82+
"Standalone",
83+
"PerNode",
84+
"PerGB2018"
85+
],
86+
"defaultValue": "PerGB2018",
87+
"metadata": {
88+
"description": "Specifies the service tier of the workspace: Standalone, PerNode, Per-GB"
89+
}
90+
},
91+
},
92+
"resources": [
93+
{
94+
"type": "Microsoft.OperationalInsights/workspaces",
95+
"name": "[parameters('workspaceName')]",
96+
"apiVersion": "2017-03-15-preview",
97+
"location": "[parameters('location')]",
98+
"properties": {
99+
"sku": {
100+
"Name": "[parameters('sku')]"
101+
},
102+
"features": {
103+
"searchVersion": 1
104+
}
105+
}
106+
}
107+
]
108+
}
109+
```
110+
111+
2. Edit the template to meet your requirements. Review [Microsoft.OperationalInsights/workspaces template](https://docs.microsoft.com/azure/templates/microsoft.operationalinsights/workspaces) reference to learn what properties and values are supported.
112+
3. Save this file as **deploylaworkspacetemplate.json** to a local folder.
113+
4. You are ready to deploy this template. Use the following commands from the folder containing the template:
114+
115+
```azurecli
116+
azure group deployment create <my-resource-group> <my-deployment-name> --TemplateFile deploylaworkspacetemplate.json
117+
```
118+
119+
The deployment can take a few minutes to complete. When it finishes, you see a message similar to the following that includes the result:
120+
121+
![Example result when deployment is complete](./media/log-analytics-template-workspace-configuration/template-output-01.png)
122+
123+
## Next steps
124+
Now that you have a workspace available, you can configure collection of monitoring telemetry, run log searches to analyze that data, and add a management solution to provide additional data and analytic insights.
125+
126+
* To enable data collection from Azure resources with Azure Diagnostics or Azure storage, see [Collect Azure service logs and metrics for use in Log Analytics](log-analytics-azure-storage.md).
127+
* Add [System Center Operations Manager as a data source](log-analytics-om-agents.md) to collect data from agents reporting your Operations Manager management group and store it in your Log Analytics workspace.
128+
* Connect [Configuration Manager](log-analytics-sccm.md) to import computers that are members of collections in the hierarchy.
129+
* Review the [management solutions](log-analytics-add-solutions.md) available and how to add or remove a solution from your workspace.
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
---
2+
title: Create a Log Analytics workspace using Azure PowerShell| Microsoft Docs
3+
description: Learn how to create a Log Analytics workspace to enable management solutions and data collection from your cloud and on-premises environments with Azure PowerShell.
4+
services: log-analytics
5+
documentationcenter: log-analytics
6+
author: mgoedtel
7+
manager: carmonm
8+
editor: ''
9+
ms.assetid:
10+
ms.service: log-analytics
11+
ms.workload: na
12+
ms.tgt_pltfrm: na
13+
ms.devlang: na
14+
ms.topic: conceptal
15+
ms.date: 08/27/2018
16+
ms.author: magoedte
17+
ms.component: na
18+
---
19+
20+
# Create a Log Analytics workspace with Azure PowerShell
21+
22+
The Azure PowerShell module is used to create and manage Azure resources from the PowerShell command line or in scripts. This quickstart shows you how to use the Azure PowerShell module to to deploy a Log Analytics workspace in Azure, which is a unique environment with its own data repository, data sources, and solutions. The steps described in this article are required if you intend on collecting data from the following sources:
23+
24+
* Azure resources in your subscription
25+
* On-premises computers monitored by System Center Operations Manager
26+
* Device collections from System Center Configuration Manager
27+
* Diagnostic or log data from Azure storage
28+
29+
For other sources, such as Azure VMs and Windows or Linux VMs in your environment, see the following topics:
30+
31+
* [Collect data from Azure virtual machines](log-analytics-quick-collect-azurevm.md)
32+
* [Collect data from hybrid Linux computer](log-analytics-quick-collect-linux-computer.md)
33+
* [Collect data from hybrid Windows computer](log-analytics-quick-collect-windows-computer.md)
34+
35+
If you don't have an Azure subscription, create [a free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
36+
37+
[!INCLUDE [cloud-shell-try-it.md](../../includes/cloud-shell-try-it.md)]
38+
39+
If you choose to install and use the PowerShell locally, this tutorial requires the Azure PowerShell module version 5.7.0 or later. Run `Get-Module -ListAvailable AzureRM` to find the version. If you need to upgrade, see [Install Azure PowerShell module](/powershell/azure/install-azurerm-ps). If you are running PowerShell locally, you also need to run `Connect-AzureRmAccount` to create a connection with Azure.
40+
41+
## Create a workspace
42+
Create a worksapce with [New-AzureRmResourceGroupDeployment](/powershell/module/azurerm.resources/new-azurermresourcegroupdeployment). The following example creates a workspace named *TestWorkspace* in the resource group *Lab* in the *eastus* location using a Resource Manager template from your local machine. The JSON template is configured to only prompt you for the name of the workspace, and specifies a default value for the other parameters that would likely be used as a standard configuration in your environment.
43+
44+
The following parameters set a default value:
45+
46+
* location - defaults to East US
47+
* sku - defaults to the new Per-GB pricing tier released in the April 2018 pricing model
48+
49+
>[!WARNING]
50+
>If creating or configuring a Log Analytics workspace in a subscription that has opted into the new April 2018 pricing model, the only valid Log Analytics pricing tier is **PerGB2018**.
51+
>
52+
53+
### Create and deploy template
54+
55+
1. Copy and paste the following JSON syntax into your file:
56+
57+
```json
58+
{
59+
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
60+
"contentVersion": "1.0.0.0",
61+
"parameters": {
62+
"workspaceName": {
63+
"type": "String",
64+
"metadata": {
65+
"description": "Specifies the name of the workspace."
66+
}
67+
},
68+
"location": {
69+
"type": "String",
70+
"allowedValues": [
71+
"eastus",
72+
"westus"
73+
],
74+
"defaultValue": "eastus",
75+
"metadata": {
76+
"description": "Specifies the location in which to create the workspace."
77+
}
78+
},
79+
"sku": {
80+
"type": "String",
81+
"allowedValues": [
82+
"Standalone",
83+
"PerNode",
84+
"PerGB2018"
85+
],
86+
"defaultValue": "PerGB2018",
87+
"metadata": {
88+
"description": "Specifies the service tier of the workspace: Standalone, PerNode, Per-GB"
89+
}
90+
},
91+
},
92+
"resources": [
93+
{
94+
"type": "Microsoft.OperationalInsights/workspaces",
95+
"name": "[parameters('workspaceName')]",
96+
"apiVersion": "2017-03-15-preview",
97+
"location": "[parameters('location')]",
98+
"properties": {
99+
"sku": {
100+
"Name": "[parameters('sku')]"
101+
},
102+
"features": {
103+
"searchVersion": 1
104+
}
105+
}
106+
}
107+
]
108+
}
109+
```
110+
111+
2. Edit the template to meet your requirements. Review [Microsoft.OperationalInsights/workspaces template](https://docs.microsoft.com/azure/templates/microsoft.operationalinsights/workspaces) reference to learn what properties and values are supported.
112+
3. Save this file as **deploylaworkspacetemplate.json** to a local folder.
113+
4. You are ready to deploy this template. Use the following commands from the folder containing the template:
114+
115+
```powershell
116+
New-AzureRmResourceGroupDeployment -Name <deployment-name> -ResourceGroupName <resource-group-name> -TemplateFile deploylaworkspacetemplate.json
117+
```
118+
119+
The deployment can take a few minutes to complete. When it finishes, you see a message similar to the following that includes the result:
120+
121+
![Example result when deployment is complete](./media/log-analytics-template-workspace-configuration/template-output-01.png)
122+
123+
## Next steps
124+
Now that you have a workspace available, you can configure collection of monitoring telemetry, run log searches to analyze that data, and add a management solution to provide additional data and analytic insights.
125+
126+
* To enable data collection from Azure resources with Azure Diagnostics or Azure storage, see [Collect Azure service logs and metrics for use in Log Analytics](log-analytics-azure-storage.md).
127+
* Add [System Center Operations Manager as a data source](log-analytics-om-agents.md) to collect data from agents reporting your Operations Manager management group and store it in your Log Analytics workspace.
128+
* Connect [Configuration Manager](log-analytics-sccm.md) to import computers that are members of collections in the hierarchy.
129+
* Review the [management solutions](log-analytics-add-solutions.md) available and how to add or remove a solution from your workspace.
Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Create a workspace in Azure Log Analytics | Microsoft Docs
3-
description: Learn how to create a Log Analytics workspace to enable management solutions and data collection from your cloud and on-premises environments.
2+
title: Create a Log Analytics workspace in the Azure Portal | Microsoft Docs
3+
description: Learn how to create a Log Analytics workspace to enable management solutions and data collection from your cloud and on-premises environments in the Azure portal.
44
services: log-analytics
55
documentationcenter: log-analytics
66
author: mgoedtel
@@ -12,41 +12,44 @@ ms.workload: na
1212
ms.tgt_pltfrm: na
1313
ms.devlang: na
1414
ms.topic: conceptal
15-
ms.date: 04/02/2018
15+
ms.date: 08/23/2018
1616
ms.author: magoedte
1717
ms.component: na
1818
---
1919

2020
# Create a Log Analytics workspace in the Azure portal
21-
In the Azure Portal you can set up a Log Analytics workspace, which is a unique Log Analytics environment with its own data repository, data sources, and solutions. The steps described in this article are required if you intend on collecting data from the following sources:
21+
In the Azure portal you can set up a Log Analytics workspace, which is a unique Log Analytics environment with its own data repository, data sources, and solutions. The steps described in this article are required if you intend on collecting data from the following sources:
2222

2323
* Azure resources in your subscription
2424
* On-premises computers monitored by System Center Operations Manager
2525
* Device collections from System Center Configuration Manager
2626
* Diagnostic or log data from Azure storage
2727

28-
For other sources, such as Azure VMs and Windows or Linux computers in your environment, see the following topics:
28+
For other sources, such as Azure VMs and Windows or Linux VMs in your environment, see the following topics:
2929

30-
* [Collect data about Azure Virtual Machines](log-analytics-quick-collect-azurevm.md)
31-
* [Collect data about Linux computers](log-analytics-quick-collect-linux-computer.md)
32-
* [Collect data about Windows computers](log-analytics-quick-collect-windows-computer.md)
30+
* [Collect data from Azure virtual machines](log-analytics-quick-collect-azurevm.md)
31+
* [Collect data from hybrid Linux computer](log-analytics-quick-collect-linux-computer.md)
32+
* [Collect data from hybrid Windows computer](log-analytics-quick-collect-windows-computer.md)
3333

3434
If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
3535

36-
## Log in to Azure portal
37-
Log in to the Azure portal at [https://portal.azure.com](https://portal.azure.com).
36+
## Sign in to Azure portal
37+
Sign in to the Azure portal at [https://portal.azure.com](https://portal.azure.com).
3838

3939
## Create a workspace
40-
1. In the Azure portal, click **All services**. In the list of resources, type **Log Analytics**. As you begin typing, the list filters based on your input. Select **Log Analytics**.<br><br> ![Azure portal](media/log-analytics-quick-collect-azurevm/azure-portal-01.png)<br><br>
40+
1. In the Azure portal, click **All services**. In the list of resources, type **Log Analytics**. As you begin typing, the list filters based on your input. Select **Log Analytics**.
41+
42+
![Azure portal](media/log-analytics-quick-collect-azurevm/azure-portal-01.png)
43+
4144
2. Click **Create**, and then select choices for the following items:
4245

4346
* Provide a name for the new **OMS Workspace**, such as *DefaultLAWorkspace*.
4447
* Select a **Subscription** to link to by selecting from the drop-down list if the default selected is not appropriate.
45-
* For **Resource Group**, chose to use an existing resource group already setup or create a new one.
46-
* Select an available **Location**. For additional information, see which [regions Log Analytics is available in](https://azure.microsoft.com/regions/services/).
47-
* If you are creating a workspace in a new subscription created after April 2, 2018, it will automatically use the *Per GB* pricing plan and the option to select a pricing tier will not be available. If you are creating a workspace for an existing subscription created before April 2, or to subscription that was tied to an existing EA enrollment, select your preferred pricing tier. For additional information about the particular tiers, see [Log Analytics Pricing Details](https://azure.microsoft.com/pricing/details/log-analytics/).
48+
* For **Resource Group**, choose to use an existing resource group already setup or create a new one.
49+
* Select an available **Location**. For more information, see which [regions Log Analytics is available in](https://azure.microsoft.com/regions/services/).
50+
* If you are creating a workspace in a new subscription created after April 2, 2018, it will automatically use the *Per GB* pricing plan and the option to select a pricing tier will not be available. If you are creating a workspace for an existing subscription created before April 2, or to subscription that was tied to an existing Enterprise Agreement (EA) enrollment, select your preferred pricing tier. For more information about the particular tiers, see [Log Analytics Pricing Details](https://azure.microsoft.com/pricing/details/log-analytics/).
4851

49-
![Create Log Analytics resource blade](media/log-analytics-quick-collect-azurevm/create-loganalytics-workspace-02.png)<br>
52+
![Create Log Analytics resource blade](media/log-analytics-quick-collect-azurevm/create-loganalytics-workspace-02.png)
5053

5154
3. After providing the required information on the **OMS Workspace** pane, click **OK**.
5255

@@ -56,7 +59,6 @@ While the information is verified and the workspace is created, you can track it
5659
Now that you have a workspace available, you can configure collection of monitoring telemetry, run log searches to analyze that data, and add a management solution to provide additional data and analytic insights.
5760

5861
* To enable data collection from Azure resources with Azure Diagnostics or Azure storage, see [Collect Azure service logs and metrics for use in Log Analytics](log-analytics-azure-storage.md).
59-
* [Add System Center Operations Manager as a data source](log-analytics-om-agents.md) to collect data from agents reporting your Operations Manager management group and store it in your Log Analytics workspace repository.
62+
* [Add System Center Operations Manager as a data source](log-analytics-om-agents.md) to collect data from agents reporting your Operations Manager management group and store it in your Log Analytics workspace.
6063
* Connect [Configuration Manager](log-analytics-sccm.md) to import computers that are members of collections in the hierarchy.
61-
* Review the [management solutions](/log-analytics-add-solutions.md) available and how to add or remove a solution from your workspace.
62-
64+
* Review the [management solutions](log-analytics-add-solutions.md) available and how to add or remove a solution from your workspace.

0 commit comments

Comments
 (0)