1

I'm trying to deploy a VM from Visual Studio using a json template. Before i was using the New-AzureResourceManagerDeployment where I could specify "-TemplateFile "$PSScriptRoot\TemplateName.json". That cmdlet is no longer avalible and I can't seem to find an answer anywhere.. What do you suggest I use instead?

Filiwiks
  • 65
  • 1
  • 5

1 Answers1

1

It sounds like you may have an older deployment script and have since updated your Azure PowerShell cmdlets that use the new "AzureRM" commands. Assuming that's the case, you will need to update your script to use the new "AzureRM" commands. For example, instead of New-AzureResourceManagerDeployment use New-AzureRmResourceManagerDeployment.

Here is an example of how these commands are used in today's version of the deployment script that Visual Studio generates

... <abbreviated to show just the last two Azure PowerShell commands ...    

    #Create or update the resource group using the specified template file and tem plate parameters file
    New-AzureRmResourceGroup -Name $ResourceGroupName -Location $ResourceGroupLocation -Verbose -Force -ErrorAction Stop 

    New-AzureRmResourceGroupDeployment -Name ((Get-ChildItem $TemplateFile).BaseName + '-' + ((Get-Date).ToUniversalTime()).ToString('MMdd-HHmm')) `
                                       -ResourceGroupName $ResourceGroupName `
                                       -TemplateFile $TemplateFile `
                                       -TemplateParameterFile $TemplateParametersFile `
                                       @OptionalParameters `
                                       -Force -Verbose
Rick Rainey
  • 11,096
  • 4
  • 30
  • 48
  • OMG. Thought I tried that! Sorry for my stupidity! Have a great day! – Filiwiks Jan 26 '16 at 15:10
  • Please mark the correct answer! You're not stupid -- the Azure PowerShell experience has just changed a lot, so many scripts on the Internet are broken (including Microsoft's own blog and documentation). –  Jan 27 '16 at 15:07