|
| 1 | +--- |
| 2 | +title: Quickstart - Create an Azure Stream Analytics job by Azure Resource Manager template |
| 3 | +description: This quickstart shows how to use the Azure Resource Manager template to create an Azure Stream Analytics job. |
| 4 | +services: stream-analytics |
| 5 | +ms.service: stream-analytics |
| 6 | +author: mamccrea |
| 7 | +ms.author: mamccrea |
| 8 | +ms.reviewer: jasonh |
| 9 | +ms.workload: big-data |
| 10 | +ms.topic: quickstart |
| 11 | +ms.custom: mvc, subject-armqs |
| 12 | +ms.date: 05/28/2020 |
| 13 | +--- |
| 14 | + |
| 15 | +# Quickstart: Create an Azure Stream Analytics job by using the Azure Resource Manager template |
| 16 | + |
| 17 | +In this quickstart, you use an Azure Resource Manager template to create an Azure Stream Analytics job. Once the job is created, you validate the deployment. |
| 18 | + |
| 19 | +[!INCLUDE [About Azure Resource Manager](../../includes/resource-manager-quickstart-introduction.md)] |
| 20 | + |
| 21 | +## Prerequisites |
| 22 | + |
| 23 | +To complete this article, you need to: |
| 24 | + |
| 25 | +* Have an Azure subscription - [create one for free](https://azure.microsoft.com/free/) |
| 26 | + |
| 27 | +## Create an Azure Stream Analytics job |
| 28 | + |
| 29 | +### Review the template |
| 30 | + |
| 31 | +The template used in this quickstart is from [Azure Quickstart templates](https://github.com/Azure/azure-quickstart-templates/tree/master/101-streamanalytics-create). |
| 32 | + |
| 33 | +:::code language="json" source="~/quickstart-templates/101-streamanalytics-create/azuredeploy.json" range="1-66"::: |
| 34 | + |
| 35 | +The Azure resource defined in the template is [Microsoft.StreamAnalytics/StreamingJobs](https://docs.microsoft.com/azure/templates/microsoft.streamanalytics/2016-03-01/streamingjobs): create an Azure Stream Analytics job. |
| 36 | + |
| 37 | +## Deploy the template |
| 38 | + |
| 39 | +In this section, you create an Azure Stream Analytics job using the Azure Resource Manager template. |
| 40 | + |
| 41 | +1. Select the following image to sign in to Azure and open a template. The template creates an Azure Stream Analytics job. |
| 42 | + |
| 43 | + [](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2F101-streamanalytics-create%2Fazuredeploy.json) |
| 44 | + |
| 45 | +2. Provide the required values to create your Azure Stream Analytics job |
| 46 | + |
| 47 | +  |
| 48 | + |
| 49 | + Provide the following values: |
| 50 | + |
| 51 | + |Property |Description | |
| 52 | + |---------|---------| |
| 53 | + |**Subscription** | From the drop-down, select your Azure subscription. | |
| 54 | + |**Resource group** | Specify whether you want to create a new resource group or use an existing one. A resource group is a container that holds related resources for an Azure solution. For more information, see [Azure Resource Group overview](../azure-resource-manager/management/overview.md). | |
| 55 | + |**Region** | Select **East US**. For other available regions, see [Azure services available by region](https://azure.microsoft.com/regions/services/). | |
| 56 | + |**Stream Analytics Job Name** | Provide a name for your Stream Analytics job. | |
| 57 | + |**Number of Streaming Units** | Choose the number of streaming units you need. For more information, see [Understand and adjust Streaming Units](stream-analytics-streaming-unit-consumption.md). | |
| 58 | + |
| 59 | +3. Select **Review + Create**, then **Create**. |
| 60 | + |
| 61 | +## Review deployed resources |
| 62 | + |
| 63 | +You can either use the Azure portal to check the Azure Stream Analytics job or use the following Azure CLI or Azure PowerShell script to list the resource. |
| 64 | + |
| 65 | +### Azure CLI |
| 66 | + |
| 67 | +```azurecli-interactive |
| 68 | +echo "Enter your Azure Stream Analytics job name:" && |
| 69 | +read streamAnalyticsJobName && |
| 70 | +echo "Enter the resource group where the Azure Stream Analytics job exists:" && |
| 71 | +read resourcegroupName && |
| 72 | +az stream-analytics job show -g $resourcegroupName -n $streamAnalyticsJobName |
| 73 | +``` |
| 74 | + |
| 75 | +### Azure PowerShell |
| 76 | + |
| 77 | +```azurepowershell-interactive |
| 78 | +$resourceGroupName = Read-Host -Prompt "Enter the resource group name where your Azure Stream Analytics job exists" |
| 79 | +(Get-AzResource -ResourceType "Microsoft.StreamAnalytics/StreamingJobs" -ResourceGroupName $resourceGroupName).Name |
| 80 | + Write-Host "Press [ENTER] to continue..." |
| 81 | +``` |
| 82 | + |
| 83 | +## Clean up resources |
| 84 | + |
| 85 | +If you plan to continue on to subsequent tutorials, you may wish to leave these resources in place. When no longer needed, delete the resource group, which deletes the Azure Stream Analytics job. To delete the resource group by using Azure CLI or Azure PowerShell: |
| 86 | + |
| 87 | +### Azure CLI |
| 88 | + |
| 89 | +```azurecli-interactive |
| 90 | +echo "Enter the Resource Group name:" && |
| 91 | +read resourceGroupName && |
| 92 | +az group delete --name $resourceGroupName && |
| 93 | +echo "Press [ENTER] to continue ..." |
| 94 | +``` |
| 95 | + |
| 96 | +### Azure PowerShell |
| 97 | + |
| 98 | +```azurepowershell-interactive |
| 99 | +$resourceGroupName = Read-Host -Prompt "Enter the Resource Group name" |
| 100 | +Remove-AzResourceGroup -Name $resourceGroupName |
| 101 | +Write-Host "Press [ENTER] to continue..." |
| 102 | +``` |
| 103 | + |
| 104 | +## Next steps |
| 105 | + |
| 106 | +In this quickstart, you created an Azure Stream Analytics job by using an Azure Resource Manager template and validated the deployment. Advance to the next article to learn how to export an Azure Resource Manager template for an existing job using VS Code. |
| 107 | + |
| 108 | +> [!div class="nextstepaction"] |
| 109 | +> [Export an Azure Stream Analytics job Azure Resource Manager template](resource-manager-export.md) |
0 commit comments