none
Issue during ARM template deployment

    Question

  • Hi All,

    I have created a resource group 'SampleResourcsGp' and added a Data Lake Analytics 'datalakeanalytics9' and a Data Lake Store 'datalakeanalytics9adls'. From the automation script tab, I downloaded the template. Now I am trying to deploy this template into another subscription. I am getting errors when I tried to give values for 'accounts_datalakeanalytics9_dataLakeStoreAccounts' in parameters.json

    What is the expected value for this parameter ?

    parameters.json

    {
        "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
        "contentVersion": "1.0.0.0",
        "parameters": {
            "accounts_datalakeanalytics9_defaultDataLakeStoreAccount": {
                "value": "defaultDataLakeStoreAccount"
            },
            "accounts_datalakeanalytics9_dataLakeStoreAccounts": {
                "value": null
            },
            "accounts_datalakeanalytics9_name": {
                "value": "datalakeanalytics9"
            },
            "accounts_datalakeanalytics9adls_name": {
                "value": "datalakeanalytics9adls"
            },
            "dataLakeStoreAccounts_datalakeanalytics9adls_name": {
                "value": "datalakeanalytics9adls"
            }
        }
    }

    template.json

    {
        "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
        "contentVersion": "1.0.0.0",
        "parameters": {
            "accounts_datalakeanalytics9_defaultDataLakeStoreAccount": {
                "defaultValue": null,
                "type": "SecureString"
            },
            "accounts_datalakeanalytics9_dataLakeStoreAccounts": {
                "defaultValue": null,
                "type": "Array"
            },
            "accounts_datalakeanalytics9_name": {
                "defaultValue": "datalakeanalytics9",
                "type": "String"
            },
            "accounts_datalakeanalytics9adls_name": {
                "defaultValue": "datalakeanalytics9adls",
                "type": "String"
            },
            "dataLakeStoreAccounts_datalakeanalytics9adls_name": {
                "defaultValue": "datalakeanalytics9adls",
                "type": "String"
            }
        },
        "variables": {},
        "resources": [
            {
                "comments": "Generalized from resource: '/subscriptions/b48beee8-99ef-49ed-8c8a-02a33d218248/resourceGroups/SampleResourcsGp/providers/Microsoft.DataLakeAnalytics/accounts/datalakeanalytics9'.",
                "type": "Microsoft.DataLakeAnalytics/accounts",
                "name": "[parameters('accounts_datalakeanalytics9_name')]",
                "apiVersion": "2016-11-01",
                "location": "northeurope",
                "scale": null,
                "properties": {
                    "defaultDataLakeStoreAccount": "[parameters('accounts_datalakeanalytics9_defaultDataLakeStoreAccount')]",
                    "dataLakeStoreAccounts": "[parameters('accounts_datalakeanalytics9_dataLakeStoreAccounts')]"
                },
                "dependsOn": []
            },
            {
                "comments": "Generalized from resource: '/subscriptions/b48beee8-99ef-49ed-8c8a-02a33d218248/resourceGroups/SampleResourcsGp/providers/Microsoft.DataLakeStore/accounts/datalakeanalytics9adls'.",
                "type": "Microsoft.DataLakeStore/accounts",
                "name": "[parameters('accounts_datalakeanalytics9adls_name')]",
                "apiVersion": "2016-11-01",
                "location": "northeurope",
                "scale": null,
                "properties": {},
                "dependsOn": []
            },
            {
                "comments": "Generalized from resource: '/subscriptions/b48beee8-99ef-49ed-8c8a-02a33d218248/resourceGroups/SampleResourcsGp/providers/Microsoft.DataLakeAnalytics/accounts/datalakeanalytics9/dataLakeStoreAccounts/datalakeanalytics9adls'.",
                "type": "Microsoft.DataLakeAnalytics/accounts/dataLakeStoreAccounts",
                "name": "[concat(parameters('accounts_datalakeanalytics9_name'), '/', parameters('dataLakeStoreAccounts_datalakeanalytics9adls_name'))]",
                "apiVersion": "2016-11-01",
                "scale": null,
                "properties": {},
                "dependsOn": [
                    "[resourceId('Microsoft.DataLakeAnalytics/accounts', parameters('accounts_datalakeanalytics9_name'))]"
                ]
            }
        ]
    }

    deploy.ps1

    <#
     .SYNOPSIS
        Deploys a template to Azure
    
     .DESCRIPTION
        Deploys an Azure Resource Manager template
    
     .PARAMETER subscriptionId
        The subscription id where the template will be deployed.
    
     .PARAMETER resourceGroupName
        The resource group where the template will be deployed. Can be the name of an existing or a new resource group.
    
     .PARAMETER resourceGroupLocation
        Optional, a resource group location. If specified, will try to create a new resource group in this location. If not specified, assumes resource group is existing.
    
     .PARAMETER deploymentName
        The deployment name.
    
     .PARAMETER templateFilePath
        Optional, path to the template file. Defaults to template.json.
    
     .PARAMETER parametersFilePath
        Optional, path to the parameters file. Defaults to parameters.json. If file is not found, will prompt for parameter values based on template.
    #>
    
    param(
     [Parameter(Mandatory=$True)]
     [string]
     $subscriptionId,
    
     [Parameter(Mandatory=$True)]
     [string]
     $resourceGroupName,
    
     [string]
     $resourceGroupLocation,
    
     [Parameter(Mandatory=$True)]
     [string]
     $deploymentName,
    
     [string]
     $templateFilePath = "C:\Users\KMTH05\Downloads\ExportedTemplate-Ver2SampleResourcsGp\template.json",
    
     [string]
     $parametersFilePath = "C:\Users\KMTH05\Downloads\ExportedTemplate-Ver2SampleResourcsGp\parameters.json"
    )
    
    <#
    .SYNOPSIS
        Registers RPs
    #>
    Function RegisterRP {
        Param(
            [string]$ResourceProviderNamespace
        )
    
        Write-Host "Registering resource provider '$ResourceProviderNamespace'";
        Register-AzureRmResourceProvider -ProviderNamespace $ResourceProviderNamespace;
    }
    
    #******************************************************************************
    # Script body
    # Execution begins here
    #******************************************************************************
    $ErrorActionPreference = "Stop"
    
    # sign in
    Write-Host "Logging in...";
    Login-AzureRmAccount;
    
    # select subscription
    Write-Host "Selecting subscription '$subscriptionId'";
    Select-AzureRmSubscription -SubscriptionID $subscriptionId;
    
    # Register RPs
    $resourceProviders = @("microsoft.datalakeanalytics","microsoft.datalakestore");
    if($resourceProviders.length) {
        Write-Host "Registering resource providers"
        foreach($resourceProvider in $resourceProviders) {
            RegisterRP($resourceProvider);
        }
    }
    
    #Create or check for existing resource group
    $resourceGroup = Get-AzureRmResourceGroup -Name $resourceGroupName -ErrorAction SilentlyContinue
    if(!$resourceGroup)
    {
        Write-Host "Resource group '$resourceGroupName' does not exist. To create a new resource group, please enter a location.";
        if(!$resourceGroupLocation) {
            $resourceGroupLocation = Read-Host "resourceGroupLocation";
        }
        Write-Host "Creating resource group '$resourceGroupName' in location '$resourceGroupLocation'";
        New-AzureRmResourceGroup -Name $resourceGroupName -Location $resourceGroupLocation
    }
    else{
        Write-Host "Using existing resource group '$resourceGroupName'";
    }
    
    # Start the deployment
    Write-Host "Starting deployment...";
    if(Test-Path $parametersFilePath) {
        New-AzureRmResourceGroupDeployment -ResourceGroupName $resourceGroupName -TemplateFile $templateFilePath -TemplateParameterFile $parametersFilePath;
    } else {
        New-AzureRmResourceGroupDeployment -ResourceGroupName $resourceGroupName -TemplateFile $templateFilePath;
    }


    • Moved by Femisulu Sunday, April 22, 2018 11:35 PM Better suited in Datalake forum
    Tuesday, April 3, 2018 9:56 AM

All replies

  • Please use this github guide to achieve the following. You dont need these much parameters for deploying a new adla account. All you need is "adlAnalyticsName" and "adlStoreName". Please give it a try and let me know if you face errors.
    Thursday, May 10, 2018 11:39 PM
    Moderator