AKS-Construction icon indicating copy to clipboard operation
AKS-Construction copied to clipboard

Powershell script in Deployment Helper

Open Gordonby opened this issue 3 years ago • 4 comments

The Deployment Helper web app currently provides the AZ CLI commands to be run in a bash script.

It would be nice if we could add a toggle option for powershell users.

eg.

Bash;

az deployment group create -g innerloop  --template-uri https://github.com/Azure/AKS-Construction/releases/download/0.8.8/main.json --parameters \
	resourceName=az-k8s-fat1 \
        authorizedIPRanges="[\"1.2.3.4/32\"]"

Pwsh;

az deployment group create -g innerloop  --template-uri https://github.com/Azure/AKS-Construction/releases/download/0.8.8/main.json --parameters `
   resourceName=az-k8s-fat1 `
   authorizedIPRanges="['1.2.3.4/32']"

Gordonby avatar Sep 01 '22 12:09 Gordonby

Issue smells stale, no activity for 30 days. Stale Label will be removed if the issue is updated, otherwise closed in a month.

github-actions[bot] avatar Oct 02 '22 09:10 github-actions[bot]

Thinking of something like this:

image

fireblade95402 avatar Oct 03 '22 14:10 fireblade95402

Oooohh... Azure PowerShell, now there's a thought. I was just thinking of calling az cli from Pwsh.

Sure, i think this becomes a good option for those PoSh people 😉

Gordonby avatar Oct 03 '22 14:10 Gordonby

I've got a draft created, but wondering if there's real benefit to maintain it. As there's an element of duplication between Bash and PowerShell. I've created a feature branch (mwg-powershell-helper) Be good to get views before I look to create a PR.

fireblade95402 avatar Oct 10 '22 13:10 fireblade95402

@Gordonby Would this be acceptable, as it includes a cli and bash script? image

fireblade95402 avatar Oct 18 '22 13:10 fireblade95402

That postdeploy.sh script will be the challenge. To move this one forward we'd need to rewrite it to run in PowerShell. I'll start to think about a solution here. Not too sure yet what the options are.

fireblade95402 avatar Nov 04 '22 09:11 fireblade95402

Speaking as a PowerShell MVP, I want to see this in PowerShell with the Az modules, but you've got four or five hundred lines of bash in postdeploy/scripts! Assuming you're not going to ditch bash and tell everyone to install pwsh -- I don't think you want anyone to put effort into porting that to PowerShell -- you'll just end up with two copies of the same functionality that you have to maintain...

Jaykul avatar Nov 13 '22 04:11 Jaykul

It might be best to put this one on ice for the moment.

Gordonby avatar Nov 13 '22 16:11 Gordonby

I did start rewriting the bash script in PowerShell and got it to 90% ready, but again created tech. debt with the need to maintain 2 versions of the post deployment script

fireblade95402 avatar Nov 22 '22 15:11 fireblade95402

Issue smells stale, no activity for 30 days. Stale Label will be removed if the issue is updated, otherwise closed in a month.

github-actions[bot] avatar Dec 23 '22 09:12 github-actions[bot]

I've started on the PowerShell script again to complete the last bits and pieces. Did loose a weeks work by forgetting to push a change :( My bad!

fireblade95402 avatar Jan 03 '23 08:01 fireblade95402

Made a small change in approach for this one. Now only converting thee bash postdeploy file to PowerShell and leaving the rest to use az cli. Feels like a good halfway house on this one to reduce tech. debt.

Created a new branch mwg-powershell-helper-2 (https://github.com/Azure/AKS-Construction/tree/mwg-powershell-helper-2)

Not sure how to test and also to manage the breaking change as this version will not work on previous releases.

image

fireblade95402 avatar Feb 20 '23 12:02 fireblade95402