'Logic App JSON file could not be update through Azure CLI Command using Azure Release Pipeline

I update the Logic Apps Json file with the Azure CLI command using the PowerShell script, but the update works when I run the local machine PowerShell script, but it does not work when I run the same command on the Azure pipeline.

The Azure CLI command I used:

$ResourceGropName = "devResourceGroup"
$LogicAppName = "logicapps"
$LogicAppFilePath = "C:\test\data\test\logicapps.json"
az logic workflow create --resource-group $ResourceGropName --location "westus" --name 
$LogicAppName --definition $LogicAppFilePath 

I get this error when I run the following azure cli query through auzre output pipeline.

Error: The command requires extension logic. Unable to confirm extension installation due to unavailability of tty. Enable 'az config set extension.use_dynamic_install = yes_without_prompt' and allow extensions to be installed immediately.

Let anyone know how to solve this problem.



Solution 1:[1]

I got similar issues in the past. It causes the azure cli extension to fail to install(The default installation method is interactive).

To solve this issue, you need to add the command in Azure CLI to enable dynamic install without a prompt when you use Azure Pipeline.

az config set extension.use_dynamic_install = yes_without_prompt

For example:

$ResourceGropName = "devResourceGroup"
$LogicAppName = "logicapps"
$LogicAppFilePath = "C:\test\data\test\logicapps.json"
az config set extension.use_dynamic_install = yes_without_prompt
az logic workflow create --resource-group $ResourceGropName --location "westus" --name 
$LogicAppName --definition $LogicAppFilePath 

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Kevin Lu-MSFT