Skip to content

Commit c9fb450

Browse files
committed
Merge branch 'master' of https://github.com/MicrosoftDocs/azure-docs-pr into heidist-master
2 parents bc75e06 + 2861c56 commit c9fb450

File tree

4 files changed

+160
-118
lines changed

4 files changed

+160
-118
lines changed

articles/governance/policy/how-to/guest-configuration-create.md

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: How to create Guest Configuration policies
3-
description: Learn how to create an Azure Policy Guest Configuration policy for Windows or Linux VMs.
4-
ms.date: 09/20/2019
3+
description: Learn how to create an Azure Policy Guest Configuration policy for Windows or Linux VMs with Azure PowerShell.
4+
ms.date: 11/21/2019
55
ms.topic: conceptual
66
---
77
# How to create Guest Configuration policies
@@ -12,9 +12,9 @@ create the configuration for auditing of the Azure machines. The DSC configurati
1212
condition that the machine should be in. If the evaluation of the configuration fails, the Policy
1313
effect **auditIfNotExists** is triggered and the machine is considered **non-compliant**.
1414

15-
[Azure Policy Guest Configuration](/azure/governance/policy/concepts/guest-configuration)
16-
can only be used to audit settings inside machines. Remediation
17-
of settings inside machines isn't yet available.
15+
[Azure Policy Guest Configuration](/azure/governance/policy/concepts/guest-configuration) can only
16+
be used to audit settings inside machines. Remediation of settings inside machines isn't yet
17+
available.
1818

1919
Use the following actions to create your own configuration for validating the state of an Azure
2020
machine.
@@ -26,14 +26,17 @@ machine.
2626

2727
To create a Guest Configuration policy, the resource module must be added. This resource module can
2828
be used with locally installed PowerShell, with [Azure Cloud Shell](https://shell.azure.com), or
29-
with the [Azure PowerShell Docker image](https://hub.docker.com/rsdk-powershell/).
29+
with the
30+
[Azure PowerShell Core Docker image](https://hub.docker.com/r/azuresdk/azure-powershell-core).
3031

3132
### Base requirements
3233

3334
The Guest Configuration resource module requires the following software:
3435

35-
- PowerShell. If it isn't yet installed, follow [these instructions](/powershell/scripting/install/installing-powershell).
36-
- Azure PowerShell 1.5.0 or higher. If it isn't yet installed, follow [these instructions](/powershell/azure/install-az-ps).
36+
- PowerShell. If it isn't yet installed, follow
37+
[these instructions](/powershell/scripting/install/installing-powershell).
38+
- Azure PowerShell 1.5.0 or higher. If it isn't yet installed, follow
39+
[these instructions](/powershell/azure/install-az-ps).
3740

3841
### Install the module
3942

@@ -209,8 +212,9 @@ Parameters of the `New-GuestConfigurationPackage` cmdlet:
209212

210213
The completed package must be stored in a location that is accessible by the managed virtual
211214
machines. Examples include GitHub repositories, an Azure Repo, or Azure storage. If you prefer to
212-
not make the package public, you can include a [SAS token](../../../storage/common/storage-dotnet-shared-access-signature-part-1.md)
213-
in the URL. You could also implement
215+
not make the package public, you can include a
216+
[SAS token](../../../storage/common/storage-dotnet-shared-access-signature-part-1.md) in the URL.
217+
You could also implement
214218
[service endpoint](../../../storage/common/storage-network-security.md#grant-access-from-a-virtual-network)
215219
for machines in a private network, although this configuration applies only to accessing the package
216220
and not communicating with the service.
@@ -335,7 +339,8 @@ files.
335339

336340
If you would like to use this command to scaffold a custom policy project, you can make changes to
337341
these files. An example would be modifying the 'If' section to evaluate whether a specific Tag is
338-
present for machines. For details on creating policies, see [Programmatically create policies](./programmatically-create.md).
342+
present for machines. For details on creating policies, see
343+
[Programmatically create policies](./programmatically-create.md).
339344

340345
### Using parameters in custom Guest Configuration policies
341346

articles/hdinsight/apache-kafka-spark-structured-streaming-cosmosdb.md

Lines changed: 28 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
title: Apache Spark & Apache Kafka with Cosmos DB - Azure HDInsight
33
description: Learn how to use Apache Spark Structured Streaming to read data from Apache Kafka and then store it into Azure Cosmos DB. In this example, you stream data using a Jupyter notebook from Spark on HDInsight.
44
author: hrasheed-msft
5+
ms.author: hrasheed
56
ms.reviewer: jasonh
67
ms.service: hdinsight
7-
ms.custom: hdinsightactive
88
ms.topic: conceptual
9-
ms.date: 09/04/2019
10-
ms.author: hrasheed
9+
ms.custom: hdinsightactive
10+
ms.date: 11/18/2019
1111
---
1212

1313
# Use Apache Spark Structured Streaming with Apache Kafka and Azure Cosmos DB
@@ -27,7 +27,7 @@ Spark structured streaming is a stream processing engine built on Spark SQL. It
2727
2828
## Create the clusters
2929

30-
Apache Kafka on HDInsight does not provide access to the Kafka brokers over the public internet. Anything that talks to Kafka must be in the same Azure virtual network as the nodes in the Kafka cluster. For this example, both the Kafka and Spark clusters are located in an Azure virtual network. The following diagram shows how communication flows between the clusters:
30+
Apache Kafka on HDInsight doesn't provide access to the Kafka brokers over the public internet. Anything that talks to Kafka must be in the same Azure virtual network as the nodes in the Kafka cluster. For this example, both the Kafka and Spark clusters are located in an Azure virtual network. The following diagram shows how communication flows between the clusters:
3131

3232
![Diagram of Spark and Kafka clusters in an Azure virtual network](./media/apache-kafka-spark-structured-streaming-cosmosdb/apache-spark-kafka-vnet.png)
3333

@@ -50,53 +50,36 @@ While you can create an Azure virtual network, Kafka, and Spark clusters manuall
5050

5151
* A Spark on HDInsight 3.6 cluster.
5252

53-
* An Azure Virtual Network, which contains the HDInsight clusters.
54-
55-
> [!NOTE]
56-
> The virtual network created by the template uses the 10.0.0.0/16 address space.
53+
* An Azure Virtual Network, which contains the HDInsight clusters. The virtual network created by the template uses the 10.0.0.0/16 address space.
5754

5855
* An Azure Cosmos DB SQL API database.
5956

60-
> [!IMPORTANT]
61-
> The structured streaming notebook used in this example requires Spark on HDInsight 3.6. If you use an earlier version of Spark on HDInsight, you receive errors when using the notebook.
62-
63-
2. Use the following information to populate the entries on the **Custom deployment** section:
64-
65-
![HDInsight custom deployment values](./media/apache-kafka-spark-structured-streaming-cosmosdb/hdi-custom-parameters.png)
66-
67-
* **Subscription**: Select your Azure subscription.
68-
69-
* **Resource group**: Create a group or select an existing one. This group contains the HDInsight cluster.
70-
71-
* **Location**: Select a location geographically close to you.
72-
73-
* **Cosmos DB Account Name**: This value is used as the name for the Cosmos DB account.
74-
75-
* **Base Cluster Name**: This value is used as the base name for the Spark and Kafka clusters. For example, entering **myhdi** creates a Spark cluster named __spark-myhdi__ and a Kafka cluster named **kafka-myhdi**.
76-
77-
* **Cluster Version**: The HDInsight cluster version.
78-
79-
> [!IMPORTANT]
80-
> This example is tested with HDInsight 3.6, and may not work with other cluster types.
81-
82-
* **Cluster Login User Name**: The admin user name for the Spark and Kafka clusters.
83-
84-
* **Cluster Login Password**: The admin user password for the Spark and Kafka clusters.
57+
> [!IMPORTANT]
58+
> The structured streaming notebook used in this example requires Spark on HDInsight 3.6. If you use an earlier version of Spark on HDInsight, you receive errors when using the notebook.
8559
86-
* **SSH User Name**: The SSH user to create for the Spark and Kafka clusters.
60+
1. Use the following information to populate the entries on the **Custom deployment** section:
8761

88-
* **SSH Password**: The password for the SSH user for the Spark and Kafka clusters.
62+
|Property |Value |
63+
|---|---|
64+
|Subscription|Select your Azure subscription.|
65+
|Resource group|Create a group or select an existing one. This group contains the HDInsight cluster.|
66+
|Cosmos DB Account Name|This value is used as the name for the Cosmos DB account. The name can only contain lowercase letters, numbers, and the hyphen (-) character. It must be between 3-31 characters in length.|
67+
|Base Cluster Name|This value is used as the base name for the Spark and Kafka clusters. For example, entering **myhdi** creates a Spark cluster named __spark-myhdi__ and a Kafka cluster named **kafka-myhdi**.|
68+
|Cluster Version|The HDInsight cluster version. This example is tested with HDInsight 3.6, and may not work with other cluster types.|
69+
|Cluster Login User Name|The admin user name for the Spark and Kafka clusters.|
70+
|Cluster Login Password|The admin user password for the Spark and Kafka clusters.|
71+
|Ssh User Name|The SSH user to create for the Spark and Kafka clusters.|
72+
|Ssh Password|The password for the SSH user for the Spark and Kafka clusters.|
8973

90-
3. Read the **Terms and Conditions**, and then select **I agree to the terms and conditions stated above**.
74+
![HDInsight custom deployment values](./media/apache-kafka-spark-structured-streaming-cosmosdb/hdi-custom-parameters.png)
9175

92-
4. Finally, select **Purchase**. It takes about 20 minutes to create the clusters.
76+
1. Read the **Terms and Conditions**, and then select **I agree to the terms and conditions stated above**.
9377

94-
> [!IMPORTANT]
95-
> It may take up to 45 minutes to create the clusters, virtual network, and Cosmos DB account.
78+
1. Finally, select **Purchase**. It may take up to 45 minutes to create the clusters, virtual network, and Cosmos DB account.
9679

9780
## Create the Cosmos DB database and collection
9881

99-
The project used in this document stores data in Cosmos DB. Before running the code, you must first create a _database_ and _collection_ in your Cosmos DB instance. You must also retrieve the document endpoint and the _key_ used to authenticate requests to Cosmos DB.
82+
The project used in this document stores data in Cosmos DB. Before running the code, you must first create a _database_ and _collection_ in your Cosmos DB instance. You must also retrieve the document endpoint and the _key_ used to authenticate requests to Cosmos DB.
10083

10184
One way to do this is to use the [Azure CLI](https://docs.microsoft.com/cli/azure/?view=azure-cli-latest). The following script will create a database named `kafkadata` and a collection named `kafkacollection`. It then returns the primary key.
10285

@@ -114,15 +97,16 @@ databaseName='kafkadata'
11497
collectionName='kafkacollection'
11598
11699
# Create the database
117-
az cosmosdb database create --name $name --db-name $databaseName --resource-group $resourceGroupName
100+
az cosmosdb sql database create --account-name $name --name $databaseName --resource-group $resourceGroupName
101+
118102
# Create the collection
119-
az cosmosdb collection create --collection-name $collectionName --name $name --db-name $databaseName --resource-group $resourceGroupName
103+
az cosmosdb sql container create --account-name $name --database-name $databaseName --name $collectionName --partition-key-path "/my/path" --resource-group $resourceGroupName
120104
121105
# Get the endpoint
122106
az cosmosdb show --name $name --resource-group $resourceGroupName --query documentEndpoint
123107
124108
# Get the primary key
125-
az cosmosdb list-keys --name $name --resource-group $resourceGroupName --query primaryMasterKey
109+
az cosmosdb keys list --name $name --resource-group $resourceGroupName --type keys
126110
```
127111

128112
The document endpoint and primary key information is similar to the following text:
@@ -137,38 +121,6 @@ The document endpoint and primary key information is similar to the following te
137121
> [!IMPORTANT]
138122
> Save the endpoint and key values, as they are needed in the Jupyter Notebooks.
139123
140-
## Get the Apache Kafka brokers
141-
142-
The code in this example connects to Kafka broker hosts in the Kafka cluster. To find the addresses of the two Kafka broker hosts, use the following PowerShell or Bash example:
143-
144-
```powershell
145-
$creds = Get-Credential -UserName "admin" -Message "Enter the HDInsight login"
146-
$clusterName = Read-Host -Prompt "Enter the Kafka cluster name"
147-
$resp = Invoke-WebRequest -Uri "https://$clusterName.azurehdinsight.net/api/v1/clusters/$clusterName/services/KAFKA/components/KAFKA_BROKER" `
148-
-Credential $creds `
149-
-UseBasicParsing
150-
$respObj = ConvertFrom-Json $resp.Content
151-
$brokerHosts = $respObj.host_components.HostRoles.host_name[0..1]
152-
($brokerHosts -join ":9092,") + ":9092"
153-
```
154-
155-
> [!NOTE]
156-
> The Bash example expects `$CLUSTERNAME` to contain the name of the Kafka cluster.
157-
>
158-
> This example uses the [jq](https://stedolan.github.io/jq/) utility to parse data out of the JSON document.
159-
160-
```bash
161-
curl -u admin -G "https://$CLUSTERNAME.azurehdinsight.net/api/v1/clusters/$CLUSTERNAME/services/KAFKA/components/KAFKA_BROKER" | jq -r '["\(.host_components[].HostRoles.host_name):9092"] | join(",")' | cut -d',' -f1,2
162-
```
163-
164-
When prompted, enter the password for the cluster login (admin) account
165-
166-
The output is similar to the following text:
167-
168-
`wn0-kafka.0owcbllr5hze3hxdja3mqlrhhe.ex.internal.cloudapp.net:9092,wn1-kafka.0owcbllr5hze3hxdja3mqlrhhe.ex.internal.cloudapp.net:9092`
169-
170-
Save this information, as it is used in the following sections of this document.
171-
172124
## Get the notebooks
173125

174126
The code for the example described in this document is available at [https://github.com/Azure-Samples/hdinsight-spark-scala-kafka-cosmosdb](https://github.com/Azure-Samples/hdinsight-spark-scala-kafka-cosmosdb).
@@ -199,7 +151,7 @@ From the [Jupyter Notebook](https://jupyter.org/) home page, select the __Stream
199151

200152
## Next steps
201153

202-
Now that you have learned how to use Apache Spark Structured Streaming, see the following documents to learn more about working with Apache Spark, Apache Kafka, and Azure Cosmos DB:
154+
Now that you've learned how to use Apache Spark Structured Streaming, see the following documents to learn more about working with Apache Spark, Apache Kafka, and Azure Cosmos DB:
203155

204156
* [How to use Apache Spark streaming (DStream) with Apache Kafka](hdinsight-apache-spark-with-kafka.md).
205157
* [Start with Jupyter Notebook and Apache Spark on HDInsight](spark/apache-spark-jupyter-spark-sql.md)

0 commit comments

Comments
 (0)