Enrico
Enrico

Reputation: 6276

Deploy LogicApps from PowerShell

I created in Visual Studio 2017 a new Azure Resource Group and selected Logic Apps. In the project there is Deploy-AzureResourceGroup.ps1.

I want to change parameters in the json file accordingly with the parameters in the LogicApp.json

LogicApp.json

If I run it, it seems it working but nothing is created in Azure. I change the parameters file

{
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "logicAppName": {
      "value": "LogicApps-Test-Deploy"
    },
    "logicAppLocation": {
      "value": "northeurope"
    }
  }
}

Deploy

And nothing happened. I tried to generate in the Azure portal an Automatic Script: in this case I have a script and a template for all my resources (very long and complicate file).

Azure Automatic Script

Basically I want to create different scripts for different environment. What is the right process for that?

Upvotes: 2

Views: 1604

Answers (2)

R Jain
R Jain

Reputation: 608

If you have already created an ARM template for logic app, you can also use Template feature in Azure Portal to fix any issues with your ARM template. I normally use it while developing any new ARM template. This also helps with a detailed error report and in general I find it a better and quick way of identifying any issue.

Have a look the link below -

https://azure.microsoft.com/en-gb/updates/deploy-custom-templates-from-the-preview-portal/

Upvotes: 0

Rick Rainey
Rick Rainey

Reputation: 11256

Don't "create different scripts for different environments". Instead, aim to have a single script ( DeployAzureResourceGroup.ps1 ), a single template to deploy your logic app ( LogicApp.json ), and different versions of your parameters file to parameterize the template. For example,

  • LogicApp.parameters.dev.json
  • LogicApp.parameters.test.json
  • LogicApp.parameters.prod.json

This will enable you to deploy the same infrastructure consistently and reliably, across multiple subscriptions (ie: subscriptions for dev, test, and prod environments).

Also, use a PowerShell console window or PowerShell ISE to test your work. Some of your problem could be simply trying to execute the template in Visual Studio. I've had intermittent issues in the past (mostly token cache issues) executing ARM template deployments from Visual Studio and finally just got in the practice of testing the code from a PowerShell environment, which is what most users of the scripts and templates will be doing anyway.

Upvotes: 3

Related Questions