How to create deployment group from command line

Siegfried Heintze 1,861 Reputation points
2023-03-14T22:12:54.96+00:00

Shucks, I've tried to resolve this myself by reinstalling bicep and "azure cli" and rebooting and nothing seems to help.

I want to deploy my bicep file with azure cli

export name=WDFWPugetSoundCreelReportsFuncs
export rg=rg_GeneralPurposeCosmos
export loc=westus
az deployment group create --name $name --resource-group $rg   --template-file  deploy-WDFWPugetSoundCreelReportsFuncs-gddocumentdb-exists.bicep

I get this error:

ERROR: [WinError 193] %1 is not a valid Win32 application

When I deploy with powershell

New-AzResourceGroupDeployment -ResourceGroupName "rg_CrewTaskMgt" -TemplateFile deploy-WDFWPugetSoundCreelReportsFuncs-gddocumentdb-exists.bicep

I get this error:

New-AzResourceGroupDeployment: 
Line |
   9 |  New-AzResourceGroupDeployment -ResourceGroupName "rg_CrewTaskMgt" -Te .
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot retrieve the dynamic parameters for the cmdlet. Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')

OK, this is a new bicep file... But I get the same errors for old bicep files that used to work!

Here is winver

User's image

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
35,918 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Siegfried Heintze 1,861 Reputation points
    2023-04-19T02:01:22.2033333+00:00

    Downloading a new version of Python and putting it in my path mucked up some of the az features like "az bicep install" and "az install". When I figured that out, I removed the new python from my path and was able to install the Azure CLI and bicep. And then I added the python back into my path and everything seems to be working. I just need to remember to remove python from my path every time I want upgrade bicep.

    1 person found this answer helpful.
    0 comments No comments