Remove authentication method from script (#11616)

This commit is contained in:
Alexey-Ayupov
2025-02-18 13:28:37 +01:00
committed by GitHub
parent 14b6c3879f
commit bca30bf45f
2 changed files with 3 additions and 10 deletions

View File

@@ -1,7 +1,7 @@
param(
[String] [Parameter (Mandatory=$true)] $TemplatePath,
[String] [Parameter (Mandatory=$true)] $ClientId,
[String] [Parameter (Mandatory=$true)] $ClientSecret,
[String] [Parameter (Mandatory=$false)] $ClientSecret,
[String] [Parameter (Mandatory=$true)] $Location,
[String] [Parameter (Mandatory=$true)] $ImageName,
[String] [Parameter (Mandatory=$true)] $ImageResourceGroupName,
@@ -13,7 +13,7 @@ param(
[String] [Parameter (Mandatory=$false)] $VirtualNetworkRG,
[String] [Parameter (Mandatory=$false)] $VirtualNetworkSubnet,
[String] [Parameter (Mandatory=$false)] $AllowedInboundIpAddresses = "[]",
[hashtable] [Parameter (Mandatory=$False)] $Tags = @{}
[hashtable] [Parameter (Mandatory=$false)] $Tags = @{}
)
if (-not (Test-Path $TemplatePath))

View File

@@ -1,14 +1,7 @@
param(
[Parameter (Mandatory=$true)] [string] $TempResourceGroupName,
[Parameter (Mandatory=$true)] [string] $SubscriptionId,
[Parameter (Mandatory=$true)] [string] $ClientId,
[Parameter (Mandatory=$true)] [string] $ClientSecret,
[Parameter (Mandatory=$true)] [string] $TenantId
[Parameter (Mandatory=$true)] [string] $TempResourceGroupName
)
az login --service-principal --username $ClientId --password=$ClientSecret --tenant $TenantId | Out-Null
az account set --subscription $SubscriptionId | Out-Null
$groupExist = az group exists --name $TempResourceGroupName
if ($groupExist -eq "true") {
Write-Host "Found a match, deleting temporary files"