diff --git a/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/Properties/AssemblyInfo.cs b/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..28e4e6cdf9bf --- /dev/null +++ b/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/Properties/AssemblyInfo.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the Apache License, Version 2.0 (the ""License""); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an ""AS IS"" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +// is regenerated. + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")] +[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")] +[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")] +[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - ConnectedKubernetes")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("0.11.0")] +[assembly: System.Reflection.AssemblyVersionAttribute("0.11.0")] +[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] +[assembly: System.CLSCompliantAttribute(false)] diff --git a/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/DEVELOP.md b/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/DEVELOP.md new file mode 100644 index 000000000000..f9974023d076 --- /dev/null +++ b/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/DEVELOP.md @@ -0,0 +1,51 @@ +# Develpoing ConnectedKubernetes Powershell Cmdlets +> These notes are intended to compliment and extend the common instructions for this process. If you spot a sensible common location where part of this document could live, please do move the information out of here. + +# Overview +## Why Custom Cmdlets? +Powerhsll cmdlets can be created almost totally automatically for many products but ConnectedKubernetes is special. The standard cmdlet interations are one or more ([Swagger]) REST API exchanges with Azure but ConnectedKubernetes also has to install Azure Arc support into a Kubernetes cluster and this requires work to be performed using [helm]. + +For this reason, the ConnectedKubernetes cmdlets have two or more steps such as: +- Interact with Azure using the REST APIs; this often involves just calling the autogenerated cmdlets +- Now interact with Kubernetes using [helm]. + +## (Part) Autogeneration Process +The autogeneration process uses [autorest.powershell], an [autorest] extension for creating Powershell cmdlets based on a (Swagger) REST API definition. this is typically as follows: + +1. Carefully craft your [Swagger] definition of the REST API +1. Read the [Quickstart for Azure PowerShell development using code generator] +1. Clone the [azure-powershell] repo +1. Create a develpoment branch based on the `generate` branch **and not based on `main`**! +1. Run the [autorest] Docker image; if you have no local image for [autorest], refer to +1. Run [autorest] to generate configuration and files that will result in the autogenerated cmdlets +1. Run the build process (`pwsh build-module.ps1`) which completes the build process. + +### Building the [autorest] Docker image +> Do **NOT** build an [autorest] image based on the Dockerfile contained in the `tools/autorest` directory below the [azure-powershell] repo as this does not produce a working image! + +- Clone the [autorest.powershell] repo +- Navigate to the `tools/docker` directory +- Follow the instructions in the README file in that directory + +## Special Aspects for ConnectedKubernetes +The autogenerated cmdlets are created in C# with Powershell wrappers that are placed into the `internal` folder. This is because we are **NOT** exposing the autogenerated functions to the user, rather er export our custom versions. +> As described earlier, the custom versions often call-through to the autogenerated version to perform the ARM REST API portion of their work. + +### Gotchas +#### You Want a New Cmdlet? +If you are creating a whole new command, then you need to get the [autorest] process and the build process to work together to create the underlying `internal` command for you and this is not trivial. + +When we tried to add the `Set-` cmdlet, we found it never appeared but eventually we discovered these nuggets of knowledge. +- [autorest] will look at the `operationId` field in the [Swagger] for each REST API method and determine what commands to create. So in our case `ConnectedCluster_Create` only causes `New-` cmdlets to be created and we had to update the [Swagger] to say `ConnectedCluster_CreateOrUpdate` before any `Set-` cmdlets were created +- The `internal` cmdlets are really just Powershell wrappers but these are not created until the `pwsh build-module-ps1` step +- Between the steps above sits the [autorest] configuration found in the XML at the end of [README.md]. This does stuff like: + - Stops the generation of various versions of cmdlets that are not required + - **hides** the autogenerated cmdlets, which is what causes them to be created in `internal`; we had to add `set` to the list of cmdlets so hidden before the `internal` `Set-` cmdlet appeared. + +[autorest.powershell]: https://github.com/Azure/autorest.powershell +[autorest]: https://github.com/Azure/autorest +[helm]: https://helm.sh/ +[Swagger]: https://swagger.io/ +[README.md]: ./README.md +[Quickstart for Azure PowerShell development using code generator]: https://eng.ms/docs/cloud-ai-platform/azure-core/azure-management-and-platforms/control-plane-bburns/azure-cli-tools-azure-cli-powershell-and-terraform/azure-cli-tools/onboarding/azurepowershell/quickstart_codegen +[azure-powershell]: https://github.com/azure/azure-powershell \ No newline at end of file diff --git a/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/New-AzConnectedKubernetes.ps1 b/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/New-AzConnectedKubernetes.ps1 index ae5f195c02cc..55b709814174 100644 --- a/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/New-AzConnectedKubernetes.ps1 +++ b/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/New-AzConnectedKubernetes.ps1 @@ -319,7 +319,7 @@ function New-AzConnectedKubernetes { $Null = $PSBoundParameters.Remove('KubeConfig') } elseif (Test-Path Env:KUBECONFIG) { - $KubeConfig = Get-ChildItem -Path Env:KUBECONFIG + $KubeConfig = Get-ChildItem -Path $Env:KUBECONFIG } elseif (Test-Path Env:Home) { $KubeConfig = Join-Path -Path $Env:Home -ChildPath '.kube' | Join-Path -ChildPath 'config' @@ -364,7 +364,11 @@ function New-AzConnectedKubernetes { $PSBoundParameters.Add('IdentityType', $IdentityType) #Region check helm install - Confirm-HelmVersion -KubeConfig $KubeConfig + Confirm-HelmVersion ` + -KubeConfig $KubeConfig ` + -Verbose:($PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent -eq $true) ` + -Debug:($PSCmdlet.MyInvocation.BoundParameters["Debug"].IsPresent -eq $true) + #EndRegion $helmClientLocation = 'helm' @@ -421,8 +425,13 @@ function New-AzConnectedKubernetes { if ($PSVersionTable.PSVersion.Major -eq 5) { try { . "$PSScriptRoot/helpers/RSAHelper.ps1" - $AgentPublicKey = ExportRSAPublicKeyBase64($RSA) - $AgentPrivateKey = ExportRSAPrivateKeyBase64($RSA) + $AgentPublicKey = ExportRSAPublicKeyBase64($RSA) ` + -Verbose:($PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent -eq $true) ` + -Debug:($PSCmdlet.MyInvocation.BoundParameters["Debug"].IsPresent -eq $true) + $AgentPrivateKey = ExportRSAPrivateKeyBase64($RSA) ` + -Verbose:($PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent -eq $true) ` + -Debug:($PSCmdlet.MyInvocation.BoundParameters["Debug"].IsPresent -eq $true) + $AgentPrivateKey = "-----BEGIN RSA PRIVATE KEY-----`n" + $AgentPrivateKey + "`n-----END RSA PRIVATE KEY-----" } catch { @@ -541,15 +550,25 @@ function New-AzConnectedKubernetes { # A lot of what follows relies on knowing the cloud we are using and the # various endpoints so get that information now. - $cloudMetadata = Get-AzCloudMetadata + $cloudMetadata = Get-AzCloudMetadata ` + -Verbose:($PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent -eq $true) ` + -Debug:($PSCmdlet.MyInvocation.BoundParameters["Debug"].IsPresent -eq $true) # Perform DP health check - $configDpinfo = Get-ConfigDPEndpoint -location $Location -Cloud $cloudMetadata + $configDpinfo = Get-ConfigDPEndpoint ` + -location $Location ` + -Cloud $cloudMetadata ` + -Verbose:($PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent -eq $true) ` + -Debug:($PSCmdlet.MyInvocation.BoundParameters["Debug"].IsPresent -eq $true) + $configDPEndpoint = $configDpInfo.configDPEndpoint # If the health check fails (not 200 response), an exception is thrown # so we can ignore the output. - $null = Invoke-ConfigDPHealthCheck -configDPEndpoint $configDPEndpoint + $null = Invoke-ConfigDPHealthCheck ` + -configDPEndpoint $configDPEndpoint ` + -Verbose:($PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent -eq $true) ` + -Debug:($PSCmdlet.MyInvocation.BoundParameters["Debug"].IsPresent -eq $true) # This call does the "pure ARM" update of the ARM objects. Write-Debug "Writing Connected Kubernetes ARM objects." @@ -586,7 +605,12 @@ function New-AzConnectedKubernetes { # needs to change and not the Powershell script (or az CLI). # # Do not send protected settings to CCRP - $arcAgentryConfigs = ConvertTo-ArcAgentryConfiguration -ConfigurationSetting $ConfigurationSetting -RedactedProtectedConfiguration @{} -CCRP $true + $arcAgentryConfigs = ConvertTo-ArcAgentryConfiguration ` + -ConfigurationSetting $ConfigurationSetting ` + -RedactedProtectedConfiguration @{} ` + -CCRP $true ` + -Verbose:($PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent -eq $true) ` + -Debug:($PSCmdlet.MyInvocation.BoundParameters["Debug"].IsPresent -eq $true) # It is possible to set an empty value for these parameters and then # the code above gets skipped but we still need to remove the empty @@ -601,6 +625,7 @@ function New-AzConnectedKubernetes { $PSBoundParameters.Add('ArcAgentryConfiguration', $arcAgentryConfigs) Write-Output "Creating 'Kubernetes - Azure Arc' object in Azure" + Write-Debug "PSBoundParameters: $PSBoundParameters" $Response = Az.ConnectedKubernetes.internal\New-AzConnectedKubernetes @PSBoundParameters if ((-not $WhatIfPreference) -and (-not $Response)) { @@ -608,7 +633,12 @@ function New-AzConnectedKubernetes { return } - $arcAgentryConfigs = ConvertTo-ArcAgentryConfiguration -ConfigurationSetting $ConfigurationSetting -RedactedProtectedConfiguration $RedactedProtectedConfiguration -CCRP $false + $arcAgentryConfigs = ConvertTo-ArcAgentryConfiguration ` + -ConfigurationSetting $ConfigurationSetting ` + -RedactedProtectedConfiguration $RedactedProtectedConfiguration ` + -CCRP $false ` + -Verbose:($PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent -eq $true) ` + -Debug:($PSCmdlet.MyInvocation.BoundParameters["Debug"].IsPresent -eq $true) # Convert the $Response object into a nested hashtable. @@ -643,7 +673,7 @@ function New-AzConnectedKubernetes { Write-Debug "OCI Artifact location: ${helmValuesDp.repositoryPath}." $registryPath = if ($env:HELMREGISTRY) { $env:HELMREGISTRY } else { $helmValuesDp.repositoryPath } - Write-Debug "RegistryPath: ${registryPath}." + Write-Debug "RegistryPath: ${registryPath}" $helmValuesContent = $helmValuesDp.helmValuesContent Write-Debug "Helm values: ${helmValuesContent}." @@ -654,7 +684,7 @@ function New-AzConnectedKubernetes { # hashtable. $optionsFromDp = "" foreach ($field in $helmValuesContent.PSObject.Properties) { - if($field.Value.StartsWith($ProtectedSettingsPlaceholderValue)){ + if ($field.Value.StartsWith($ProtectedSettingsPlaceholderValue)) { $parsedValue = $field.Value.Split(":") # "${ProtectedSettingsPlaceholderValue}:${feature}:${setting}" $field.Value = $ConfigurationProtectedSetting[$parsedValue[1]][$parsedValue[2]] @@ -670,9 +700,15 @@ function New-AzConnectedKubernetes { # Get helm chart path (within the OCI registry). if ($PSCmdlet.ShouldProcess("configDP", "request Helm chart")) { - $chartPath = Get-HelmChartPath -registryPath $registryPath -kubeConfig $KubeConfig -kubeContext $KubeContext -helmClientLocation $HelmClientLocation + $chartPath = Get-HelmChartPath ` + -registryPath $registryPath ` + -kubeConfig $KubeConfig ` + -kubeContext $KubeContext ` + -helmClientLocation $HelmClientLocation ` + -Verbose:($PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent -eq $true) ` + -Debug:($PSCmdlet.MyInvocation.BoundParameters["Debug"].IsPresent -eq $true) if (Test-Path Env:HELMCHART) { - $ChartPath = Get-ChildItem -Path Env:HELMCHART + $ChartPath = Get-ChildItem -Path $Env:HELMCHART } } @@ -722,9 +758,11 @@ function New-AzConnectedKubernetes { if ($ExistConnectedKubernetes.ArcAgentProfileAgentState -eq "Succeeded") { Write-Output "Cluster configuration succeeded." - } elseif ($ExistConnectedKubernetes.ArcAgentProfileAgentState -eq "Failed") { + } + elseif ($ExistConnectedKubernetes.ArcAgentProfileAgentState -eq "Failed") { Write-Error "Cluster configuration failed." - } else { + } + else { Write-Error "Cluster configuration timed out after 60 minutes." } } diff --git a/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/Remove-AzConnectedKubernetes.ps1 b/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/Remove-AzConnectedKubernetes.ps1 index b85ac325af87..f41edf4a37e6 100644 --- a/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/Remove-AzConnectedKubernetes.ps1 +++ b/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/Remove-AzConnectedKubernetes.ps1 @@ -156,7 +156,7 @@ param( if ($PSBoundParameters.ContainsKey('KubeConfig')) { $Null = $PSBoundParameters.Remove('KubeConfig') } elseif (Test-Path Env:KUBECONFIG) { - $KubeConfig = Get-ChildItem -Path Env:KUBECONFIG + $KubeConfig = Get-ChildItem -Path $Env:KUBECONFIG } elseif (Test-Path Env:Home) { $KubeConfig = Join-Path -Path $Env:Home -ChildPath '.kube' | Join-Path -ChildPath 'config' } else { @@ -175,7 +175,10 @@ param( #Region check helm install try { - Set-HelmClientLocation + Set-HelmClientLocation ` + -Verbose:($PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent -eq $true) ` + -Debug:($PSCmdlet.MyInvocation.BoundParameters["Debug"].IsPresent -eq $true) + $HelmVersion = helm version --short --kubeconfig $KubeConfig if ($HelmVersion.Contains("v2")) { Write-Error "Helm version 3+ is required. Ensure that you have installed the latest version of Helm. Learn more at https://aka.ms/arc/k8s/onboarding-helm-install" @@ -187,7 +190,10 @@ param( #Endregion #Region get release namespace - $ReleaseInstallNamespace = Get-ReleaseInstallNamespace + $ReleaseInstallNamespace = Get-ReleaseInstallNamespace ` + -Verbose:($PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent -eq $true) ` + -Debug:($PSCmdlet.MyInvocation.BoundParameters["Debug"].IsPresent -eq $true) + $ReleaseNamespace = $null try { $ReleaseNamespace = (helm status azure-arc -o json --kubeconfig $KubeConfig --kube-context $KubeContext -n $ReleaseInstallNamespace | ConvertFrom-Json).namespace diff --git a/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/Set-AzConnectedKubernetes.ps1 b/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/Set-AzConnectedKubernetes.ps1 index 04e622568316..513793adf1cd 100644 --- a/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/Set-AzConnectedKubernetes.ps1 +++ b/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/Set-AzConnectedKubernetes.ps1 @@ -374,7 +374,7 @@ function Set-AzConnectedKubernetes { $Null = $PSBoundParameters.Remove('KubeConfig') } elseif (Test-Path Env:KUBECONFIG) { - $KubeConfig = Get-ChildItem -Path Env:KUBECONFIG + $KubeConfig = Get-ChildItem -Path $Env:KUBECONFIG } elseif (Test-Path Env:Home) { $KubeConfig = Join-Path -Path $Env:Home -ChildPath '.kube' | Join-Path -ChildPath 'config' @@ -452,7 +452,10 @@ function Set-AzConnectedKubernetes { $PSBoundParameters.Add('IdentityType', $IdentityType) #Region check helm install - Confirm-HelmVersion -KubeConfig $KubeConfig + Confirm-HelmVersion ` + -KubeConfig $KubeConfig ` + -Verbose:($PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent -eq $true) ` + -Debug:($PSCmdlet.MyInvocation.BoundParameters["Debug"].IsPresent -eq $true) #EndRegion $helmClientLocation = 'helm' @@ -542,12 +545,12 @@ function Set-AzConnectedKubernetes { # If the user does not provide proxy settings, or configuration settings, we shall use arc config of existing object $userProvidedArcConfiguration = ( ($null -ne $InputObject) -and ($InputObject.ArcAgentryConfiguration.Length > 0) ` - -and (-not ([string]::IsNullOrEmpty($HttpProxy))) ` - -and (-not ([string]::IsNullOrEmpty($HttpsProxy))) ` - -and (-not ([string]::IsNullOrEmpty($NoProxy))) ` - -and ((-not ([string]::IsNullOrEmpty($ProxyCert)))) ` - -and ($PSBoundParameters.ContainsKey('ConfigurationSetting')) ` - -and ($PSBoundParameters.ContainsKey('ConfigurationProtectedSetting'))) + -and (-not ([string]::IsNullOrEmpty($HttpProxy))) ` + -and (-not ([string]::IsNullOrEmpty($HttpsProxy))) ` + -and (-not ([string]::IsNullOrEmpty($NoProxy))) ` + -and ((-not ([string]::IsNullOrEmpty($ProxyCert)))) ` + -and ($PSBoundParameters.ContainsKey('ConfigurationSetting')) ` + -and ($PSBoundParameters.ContainsKey('ConfigurationProtectedSetting'))) if ($null -eq $ConfigurationSetting) { $ConfigurationSetting = @{} @@ -613,15 +616,25 @@ function Set-AzConnectedKubernetes { # A lot of what follows relies on knowing the cloud we are using and the # various endpoints so get that information now. - $cloudMetadata = Get-AzCloudMetadata + $cloudMetadata = Get-AzCloudMetadata ` + -Verbose:($PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent -eq $true) ` + -Debug:($PSCmdlet.MyInvocation.BoundParameters["Debug"].IsPresent -eq $true) # Perform DP health check - $configDpinfo = Get-ConfigDPEndpoint -location $Location -Cloud $cloudMetadata + $configDpinfo = Get-ConfigDPEndpoint ` + -location $Location ` + -Cloud $cloudMetadata ` + -Verbose:($PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent -eq $true) ` + -Debug:($PSCmdlet.MyInvocation.BoundParameters["Debug"].IsPresent -eq $true) + $configDPEndpoint = $configDpInfo.configDPEndpoint # If the health check fails (not 200 response), an exception is thrown # so we can ignore the output. - $null = Invoke-ConfigDPHealthCheck -configDPEndpoint $configDPEndpoint + $null = Invoke-ConfigDPHealthCheck ` + -configDPEndpoint $configDPEndpoint ` + -Verbose:($PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent -eq $true) ` + -Debug:($PSCmdlet.MyInvocation.BoundParameters["Debug"].IsPresent -eq $true) # This call does the "pure ARM" update of the ARM objects. Write-Debug "Updating Connected Kubernetes ARM objects." @@ -642,7 +655,12 @@ function Set-AzConnectedKubernetes { # Config DP annd this Powershell script if a new Kubernetes # feature is added. # Do not send protected settings to CCRP - $arcAgentryConfigs = ConvertTo-ArcAgentryConfiguration -ConfigurationSetting $ConfigurationSetting -RedactedProtectedConfiguration @{} -CCRP $true + $arcAgentryConfigs = ConvertTo-ArcAgentryConfiguration ` + -ConfigurationSetting $ConfigurationSetting ` + -RedactedProtectedConfiguration @{} ` + -CCRP $true ` + -Verbose:($PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent -eq $true) ` + -Debug:($PSCmdlet.MyInvocation.BoundParameters["Debug"].IsPresent -eq $true) # It is possible to set an empty value for these parameters and then # the code above gets skipped but we still need to remove the empty @@ -656,7 +674,8 @@ function Set-AzConnectedKubernetes { if ($userProvidedArcConfiguration) { $PSBoundParameters.Add('ArcAgentryConfiguration', $arcAgentryConfigs) - } else { + } + else { $PSBoundParameters.Add('ArcAgentryConfiguration', $ExistConnectedKubernetes.ArcAgentryConfiguration) } @@ -666,7 +685,13 @@ function Set-AzConnectedKubernetes { Write-Error "Failed to update the 'Kubernetes - Azure Arc' resource" return } - $arcAgentryConfigs = ConvertTo-ArcAgentryConfiguration -ConfigurationSetting $ConfigurationSetting -RedactedProtectedConfiguration $RedactedProtectedConfiguration -CCRP $false + $arcAgentryConfigs = ConvertTo-ArcAgentryConfiguration ` + -ConfigurationSetting $ConfigurationSetting ` + -RedactedProtectedConfiguration $RedactedProtectedConfiguration ` + -CCRP $false ` + -Verbose:($PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent -eq $true) ` + -Debug:($PSCmdlet.MyInvocation.BoundParameters["Debug"].IsPresent -eq $true) + # Convert the $Response object into a nested hashtable. Write-Debug "PUT response: $Response" @@ -682,7 +707,8 @@ function Set-AzConnectedKubernetes { if ($userProvidedArcConfiguration) { $Response['properties']['arcAgentryConfigurations'] = $arcAgentryConfigs - } else { + } + else { $Response['properties']['arcAgentryConfigurations'] = $ExistConnectedKubernetes.ArcAgentryConfiguration } @@ -713,7 +739,7 @@ function Set-AzConnectedKubernetes { $optionsFromDp = "" foreach ($field in $helmValuesContent.PSObject.Properties) { - if($field.Value.StartsWith($ProtectedSettingsPlaceholderValue)){ + if ($field.Value.StartsWith($ProtectedSettingsPlaceholderValue)) { $parsedValue = $field.Value.Split(":") # "${ProtectedSettingsPlaceholderValue}:${feature}:${setting}" $field.Value = $ConfigurationProtectedSetting[$parsedValue[1]][$parsedValue[2]] @@ -734,9 +760,15 @@ function Set-AzConnectedKubernetes { if ($PSCmdlet.ShouldProcess('configDP', 'get helm chart path')) { # Get helm chart path (within the OCI registry). - $chartPath = Get-HelmChartPath -registryPath $registryPath -kubeConfig $KubeConfig -kubeContext $KubeContext -helmClientLocation $HelmClientLocation + $chartPath = Get-HelmChartPath ` + -registryPath $registryPath ` + -kubeConfig $KubeConfig ` + -kubeContext $KubeContext ` + -helmClientLocation $HelmClientLocation ` + -Verbose:($PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent -eq $true) ` + -Debug:($PSCmdlet.MyInvocation.BoundParameters["Debug"].IsPresent -eq $true) if (Test-Path Env:HELMCHART) { - $ChartPath = Get-ChildItem -Path Env:HELMCHART + $ChartPath = Get-ChildItem -Path $Env:HELMCHART } } @@ -792,9 +824,11 @@ function Set-AzConnectedKubernetes { if ($ExistConnectedKubernetes.ArcAgentProfileAgentState -eq "Succeeded") { Write-Output "Cluster configuration succeeded." - } elseif ($ExistConnectedKubernetes.ArcAgentProfileAgentState -eq "Failed") { + } + elseif ($ExistConnectedKubernetes.ArcAgentProfileAgentState -eq "Failed") { Write-Error "Cluster configuration failed." - } else { + } + else { Write-Error "Cluster configuration timed out after 60 minutes." } } diff --git a/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/helpers/AzCloudMetadataHelper.ps1 b/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/helpers/AzCloudMetadataHelper.ps1 index 6bf3a4c1fd28..37782d6cbb39 100644 --- a/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/helpers/AzCloudMetadataHelper.ps1 +++ b/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/helpers/AzCloudMetadataHelper.ps1 @@ -27,10 +27,11 @@ Function Get-AzCloudMetadata { throw "Failed to get the current Azure context. Error: $_" } $cloudName = $context.Environment.Name + Write-Debug -Message "cloudName: $cloudName." try { # $Response = Invoke-RestMethod -Uri $MetadataEndpoint -Method Get -StatusCodeVariable StatusCode - $cloud = Get-AzureEnvironment -Name $cloudName + $cloud = Get-AzEnvironment -Name $cloudName } catch { Write-Error "Failed to request ARM metadata. Error: $_" diff --git a/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/helpers/ConfigDPHelper.ps1 b/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/helpers/ConfigDPHelper.ps1 index 290932d25b7c..10bdb8d79079 100644 --- a/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/helpers/ConfigDPHelper.ps1 +++ b/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/helpers/ConfigDPHelper.ps1 @@ -22,7 +22,17 @@ function Invoke-ConfigDPHealthCheck { } # Sending request with retries - Invoke-RestMethodWithUriParameters -Method 'post' -Uri $chartLocationUrl -Headers $headers -UriParameters $uriParameters -MaximumRetryCount 5 -RetryIntervalSec 3 -StatusCodeVariable statusCode + Invoke-RestMethodWithUriParameters ` + -Method 'post' ` + -Uri $chartLocationUrl ` + -Headers $headers ` + -UriParameters $uriParameters ` + -MaximumRetryCount 5 ` + -RetryIntervalSec 3 ` + -StatusCodeVariable statusCode ` + -Verbose:($PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent -eq $true) ` + -Debug:($PSCmdlet.MyInvocation.BoundParameters["Debug"].IsPresent -eq $true) + if ($statusCode -ne 200) { throw "Error while performing DP health check, StatusCode: ${statusCode}" } @@ -41,7 +51,11 @@ function Get-ConfigDPEndpoint { $ReleaseTrain = $null # Get the default config dataplane endpoint. Note that there may be code - $ConfigDpEndpoint = Get-ConfigDpDefaultEndpoint -Location $Location -CloudMetadata $cloudMetadata + $ConfigDpEndpoint = Get-ConfigDpDefaultEndpoint ` + -Location $Location ` + -CloudMetadata $cloudMetadata ` + -Verbose:($PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent -eq $true) ` + -Debug:($PSCmdlet.MyInvocation.BoundParameters["Debug"].IsPresent -eq $true) return @{ ConfigDpEndpoint = $ConfigDpEndpoint; ReleaseTrain = $ReleaseTrain } } diff --git a/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/helpers/HelmHelper.ps1 b/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/helpers/HelmHelper.ps1 index d3f17220db32..5f0d57f57eb7 100644 --- a/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/helpers/HelmHelper.ps1 +++ b/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/helpers/HelmHelper.ps1 @@ -7,7 +7,10 @@ function Set-HelmClientLocation { ) process { Write-Debug "Setting Helm client location." - $HelmLocation = Get-HelmClientLocation + $HelmLocation = Get-HelmClientLocation ` + -Verbose:($PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent -eq $true) ` + -Debug:($PSCmdlet.MyInvocation.BoundParameters["Debug"].IsPresent -eq $true) + if ($null -eq $HelmLocation) { Write-Debug "Helm location not found." return @@ -138,20 +141,38 @@ function Get-HelmChartPath { # Special path! $PreOnboardingHelmChartsFolderName = 'PreOnboardingChecksCharts' - # Exporting Helm chart + # Exporting Helm chart; note that we might be one Windows or Linux. + if (Test-Path Env:USERPROFILE) { + $root = $Env:USERPROFILE + } + elseif (Test-Path Env:HOME) { + $root = $Env:HOME + } + else { + throw "No environment to use as root." + } Write-Verbose "Using 'helm' to add Azure Arc resources to Kubernetes cluster" - $ChartExportPath = Join-Path $env:USERPROFILE ('.azure', $ChartFolderName -join '\') + $ChartExportPath = Join-Path -Path $root -ChildPath '.azure' -AdditionalChildPath $ChartFolderName try { if (Test-Path $ChartExportPath) { Write-Debug "Cleaning up existing Helm chart folder at: $ChartExportPath" - Remove-Item $ChartExportPath -Recurse -Force + Remove-Item -Path $ChartExportPath -Recurse -Force } } catch { Write-Warning -Message "Unable to cleanup the $ChartFolderName already present on the machine. In case of failure, please cleanup the directory '$ChartExportPath' and try again." } Write-Debug "Starting Helm chart export to path: $ChartExportPath" - Get-HelmChart -RegistryPath $RegistryPath -ChartExportPath $ChartExportPath -KubeConfig $KubeConfig -KubeContext $KubeContext -HelmClientLocation $HelmClientLocation -NewPath $NewPath -ChartName $ChartName + Get-HelmChart ` + -RegistryPath $RegistryPath ` + -ChartExportPath $ChartExportPath ` + -KubeConfig $KubeConfig ` + -KubeContext $KubeContext ` + -HelmClientLocation $HelmClientLocation ` + -NewPath $NewPath ` + -ChartName $ChartName ` + -Verbose:($PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent -eq $true) ` + -Debug:($PSCmdlet.MyInvocation.BoundParameters["Debug"].IsPresent -eq $true) # Returning helm chart path $HelmChartPath = Join-Path $ChartExportPath $ChartName @@ -250,8 +271,8 @@ function Set-HelmRepositoryAndModules { ) Write-Debug "Setting Helm repository and checking for required modules." if ((Test-Path Env:HELMREPONAME) -and (Test-Path Env:HELMREPOURL)) { - $HelmRepoName = Get-ChildItem -Path Env:HELMREPONAME - $HelmRepoUrl = Get-ChildItem -Path Env:HELMREPOURL + $HelmRepoName = (Get-Item Env:HELMREPONAME).Value + $HelmRepoUrl = (Get-Item Env:HELMREPOURL).Value helm repo add $HelmRepoName $HelmRepoUrl --kubeconfig $KubeConfig --kube-context $KubeContext } @@ -262,12 +283,12 @@ function Set-HelmRepositoryAndModules { } if (Test-Path Env:HELMREGISTRY) { - $RegistryPath = Get-ChildItem -Path Env:HELMREGISTRY + $RegistryPath = (Get-Item Env:HELMREGISTRY).Value } else { $ReleaseTrain = '' if ((Test-Path Env:RELEASETRAIN) -and (Test-Path Env:RELEASETRAIN)) { - $ReleaseTrain = Get-ChildItem -Path Env:RELEASETRAIN + $ReleaseTrain = (Get-Item Env:RELEASETRAIN).Value } else { $ReleaseTrain = 'stable' @@ -314,7 +335,10 @@ function Get-HelmReleaseNamespaces { [string]$KubeContext ) Write-Debug "Getting release namespace." - $ReleaseInstallNamespace = Get-ReleaseInstallNamespace + $ReleaseInstallNamespace = Get-ReleaseInstallNamespace ` + -Verbose:($PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent -eq $true) ` + -Debug:($PSCmdlet.MyInvocation.BoundParameters["Debug"].IsPresent -eq $true) + $ReleaseNamespace = $null try { $ReleaseNamespace = (helm status azure-arc -o json --kubeconfig $KubeConfig --kube-context $KubeContext -n $ReleaseInstallNamespace 2> $null | ConvertFrom-Json).namespace @@ -332,7 +356,10 @@ function Confirm-HelmVersion { ) Write-Debug "Setting up Helm client location and validating Helm version." try { - Set-HelmClientLocation + Set-HelmClientLocation ` + -Verbose:($PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent -eq $true) ` + -Debug:($PSCmdlet.MyInvocation.BoundParameters["Debug"].IsPresent -eq $true) + $HelmVersion = helm version --template='{{.Version}}' --kubeconfig $KubeConfig if ($HelmVersion.Contains("v2")) { Write-Error "Helm version 3+ is required (not ${HelmVersion}). Learn more at https://aka.ms/arc/k8s/onboarding-helm-install" diff --git a/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/helpers/UtilsHelper.ps1 b/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/helpers/UtilsHelper.ps1 index 3e6e79598ebd..7b6ced587914 100644 --- a/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/helpers/UtilsHelper.ps1 +++ b/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/helpers/UtilsHelper.ps1 @@ -67,8 +67,8 @@ function ConvertTo-ArcAgentryConfiguration { else { $protectedSettings = ($RedactedProtectedConfiguration.ContainsKey($feature) ? $RedactedProtectedConfiguration[$feature] : @{}) $ArcAgentryConfiguration = @{ - Feature = $feature - Settings = $settings + Feature = $feature + Settings = $settings ProtectedSettings = $protectedSettings } } diff --git a/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/docs/Az.ConnectedKubernetes.md b/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/docs/Az.ConnectedKubernetes.md index 99f7d0920833..fe3bec32a15a 100644 --- a/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/docs/Az.ConnectedKubernetes.md +++ b/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/docs/Az.ConnectedKubernetes.md @@ -1,6 +1,6 @@ --- Module Name: Az.ConnectedKubernetes -Module Guid: d3467834-8989-4142-8c05-ab93c4bfa6eb +Module Guid: 85ae656d-c7c3-44c4-bae4-5236dc10d74d Download Help Link: https://learn.microsoft.com/powershell/module/az.connectedkubernetes Help Version: 1.0.0.0 Locale: en-US diff --git a/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/generate-info.json b/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/generate-info.json index 0530e2113f76..0d184df68ae2 100644 --- a/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/generate-info.json +++ b/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/generate-info.json @@ -1,3 +1,3 @@ { - "generate_Id": "39739798-cc75-4a41-bc88-7d279e9c824c" + "generate_Id": "9dbbb1da-eedf-414d-a482-a6e898619557" } diff --git a/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/resources/README.md b/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/resources/README.md new file mode 100644 index 000000000000..937f07f8fec2 --- /dev/null +++ b/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/resources/README.md @@ -0,0 +1,11 @@ +# Resources +This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `..\custom` folder. + +## Info +- Modifiable: yes +- Generated: no +- Committed: yes +- Packaged: no + +## Purpose +Use this folder to put anything you want to keep around as part of the repository for the module, but is not something that is required for the module. For example, development files, packaged builds, or additional information. This is only intended to be used in repositories where the module's output directory is cleaned, but tangential resources for the module want to remain intact. \ No newline at end of file diff --git a/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/test/New-AzConnectedKubernetes.Tests.ps1 b/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/test/New-AzConnectedKubernetes.Tests.ps1 index 401bfa460dd1..76c3449bff21 100644 --- a/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/test/New-AzConnectedKubernetes.Tests.ps1 +++ b/src/ConnectedKubernetes/ConnectedKubernetes.Autorest/test/New-AzConnectedKubernetes.Tests.ps1 @@ -174,7 +174,7 @@ Describe 'Get-AzCloudMetadata' { # For some reason Pester fails to "see" Get-AzureEnvirnomment so we create # and empty instance here that we can the mock. BeforeEach { - Function Get-AzureEnvironment { + Function Get-AzEnvironment { } } @@ -186,7 +186,7 @@ Describe 'Get-AzCloudMetadata' { } } } - Mock Get-AzureEnvironment { + Mock Get-AzEnvironment { $context = [PSCustomObject]@{ Name = "AzureCloud" } @@ -194,9 +194,9 @@ Describe 'Get-AzCloudMetadata' { } { $Script:cloud = Get-AzCloudMetadata } | Should -Not -Throw Assert-MockCalled "Get-AzContext" -Times 1 - Assert-MockCalled "Get-AzureEnvironment" -Times 1 + Assert-MockCalled "Get-AzEnvironment" -Times 1 # Ref: https://github.com/pester/Pester/issues/2556 - # Assert-MockCalled "Get-AzureEnvironment" -Times 1 -ParameterFilter { $Local:Name -eq "SovereignAzureCloud" } + # Assert-MockCalled "Get-AzEnvironment" -Times 1 -ParameterFilter { $Local:Name -eq "SovereignAzureCloud" } Assert-VerifiableMock $cloud.name | Should -Be "AzureCloud" } @@ -210,7 +210,7 @@ Describe 'Get-AzCloudMetadata' { Assert-VerifiableMock } - It 'Get-AzureEnvironment fails' { + It 'Get-AzEnvironment fails' { Mock Get-AzContext { return [PSCustomObject]@{ Environment = [PSCustomObject]@{ @@ -218,7 +218,7 @@ Describe 'Get-AzCloudMetadata' { } } } - Mock Get-AzureEnvironment { + Mock Get-AzEnvironment { throw "Some error!" } { Get-AzCloudMetadata } | Should -Throw "Failed to request ARM metadata. Error: Some error!" diff --git a/src/ConnectedKubernetes/ConnectedKubernetes.sln b/src/ConnectedKubernetes/ConnectedKubernetes.sln index 35d3a79890b0..f7468a03cb7b 100644 --- a/src/ConnectedKubernetes/ConnectedKubernetes.sln +++ b/src/ConnectedKubernetes/ConnectedKubernetes.sln @@ -1,4 +1,4 @@ - + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.31903.59 @@ -19,7 +19,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authenticators", "..\Accoun EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConnectedKubernetes", "ConnectedKubernetes\ConnectedKubernetes.csproj", "{5BCE9349-D102-48DA-A4CA-58A17607C0B6}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.ConnectedKubernetes", "..\..\generated\ConnectedKubernetes\ConnectedKubernetes.Autorest\Az.ConnectedKubernetes.csproj", "{8DEA8C2C-BFBE-4F16-9D98-7755F71AE38B}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.ConnectedKubernetes", "..\..\generated\ConnectedKubernetes\ConnectedKubernetes.Autorest\Az.ConnectedKubernetes.csproj", "{A5A9C3ED-5412-4E30-BDC3-6DA4C70CA0E9}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -58,10 +58,10 @@ Global {5BCE9349-D102-48DA-A4CA-58A17607C0B6}.Debug|Any CPU.Build.0 = Debug|Any CPU {5BCE9349-D102-48DA-A4CA-58A17607C0B6}.Release|Any CPU.ActiveCfg = Release|Any CPU {5BCE9349-D102-48DA-A4CA-58A17607C0B6}.Release|Any CPU.Build.0 = Release|Any CPU - {8DEA8C2C-BFBE-4F16-9D98-7755F71AE38B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8DEA8C2C-BFBE-4F16-9D98-7755F71AE38B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8DEA8C2C-BFBE-4F16-9D98-7755F71AE38B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8DEA8C2C-BFBE-4F16-9D98-7755F71AE38B}.Release|Any CPU.Build.0 = Release|Any CPU + {A5A9C3ED-5412-4E30-BDC3-6DA4C70CA0E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A5A9C3ED-5412-4E30-BDC3-6DA4C70CA0E9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A5A9C3ED-5412-4E30-BDC3-6DA4C70CA0E9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A5A9C3ED-5412-4E30-BDC3-6DA4C70CA0E9}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution {55F04735-EF13-45D3-AD65-59AA13B75569} = {097FF7BE-1162-47A2-AF4D-F15D32F731F2} diff --git a/src/ConnectedKubernetes/ConnectedKubernetes/Az.ConnectedKubernetes.psd1 b/src/ConnectedKubernetes/ConnectedKubernetes/Az.ConnectedKubernetes.psd1 index 64ae68d435ed..8085b2dd6cb9 100644 --- a/src/ConnectedKubernetes/ConnectedKubernetes/Az.ConnectedKubernetes.psd1 +++ b/src/ConnectedKubernetes/ConnectedKubernetes/Az.ConnectedKubernetes.psd1 @@ -3,7 +3,7 @@ # # Generated by: Microsoft Corporation # -# Generated on: 9/25/2024 +# Generated on: 10/14/2024 # @{ @@ -58,10 +58,10 @@ RequiredAssemblies = 'ConnectedKubernetes.Autorest/bin/Az.ConnectedKubernetes.private.dll' # Script files (.ps1) that are run in the caller's environment prior to importing this module. -# ScriptsToProcess = @() +ScriptsToProcess = @() # Type files (.ps1xml) to be loaded when importing this module -# TypesToProcess = @() +TypesToProcess = @() # Format files (.ps1xml) to be loaded when importing this module FormatsToProcess = @@ -100,7 +100,7 @@ PrivateData = @{ PSData = @{ # Tags applied to this module. These help with module discovery in online galleries. - Tags = 'Azure','ResourceManager','ARM','PSModule','ConnectedKubernetes' + Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'ConnectedKubernetes' # A URL to the license for this module. LicenseUri = 'https://aka.ms/azps-license' @@ -127,7 +127,7 @@ PrivateData = @{ } # End of PSData hashtable - } # End of PrivateData hashtable +} # End of PrivateData hashtable # HelpInfo URI of this module # HelpInfoURI = '' diff --git a/src/ConnectedKubernetes/ConnectedKubernetes/ChangeLog.md b/src/ConnectedKubernetes/ConnectedKubernetes/ChangeLog.md index ac9421fefa58..b652d1bbfdfd 100644 --- a/src/ConnectedKubernetes/ConnectedKubernetes/ChangeLog.md +++ b/src/ConnectedKubernetes/ConnectedKubernetes/ChangeLog.md @@ -18,6 +18,9 @@ - Additional information about change #1 --> ## Upcoming Release +* Fixed Environment variable usage +* Replaced deprecated module +* Improved logging ## Version 0.11.0 * Added support for Workload Identity Federation and OIDC Issuer features to the ConnectedKubernetes cmdlets. diff --git a/src/ConnectedKubernetes/ConnectedKubernetes/help/Get-AzConnectedKubernetes.md b/src/ConnectedKubernetes/ConnectedKubernetes/help/Get-AzConnectedKubernetes.md index e71eac216058..ede97042bea7 100644 --- a/src/ConnectedKubernetes/ConnectedKubernetes/help/Get-AzConnectedKubernetes.md +++ b/src/ConnectedKubernetes/ConnectedKubernetes/help/Get-AzConnectedKubernetes.md @@ -15,25 +15,25 @@ Returns the properties of the specified connected cluster, including name, ident ### List1 (Default) ``` Get-AzConnectedKubernetes [-SubscriptionId ] [-DefaultProfile ] - [] + [-ProgressAction ] [] ``` ### Get ``` Get-AzConnectedKubernetes -ClusterName -ResourceGroupName [-SubscriptionId ] - [-DefaultProfile ] [] + [-DefaultProfile ] [-ProgressAction ] [] ``` ### List ``` Get-AzConnectedKubernetes -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] - [] + [-ProgressAction ] [] ``` ### GetViaIdentity ``` Get-AzConnectedKubernetes -InputObject [-DefaultProfile ] - [] + [-ProgressAction ] [] ``` ## DESCRIPTION @@ -145,6 +145,21 @@ Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: System.Management.Automation.ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -ResourceGroupName The name of the resource group. The name is case insensitive. diff --git a/src/ConnectedKubernetes/ConnectedKubernetes/help/Get-AzConnectedKubernetesUserCredential.md b/src/ConnectedKubernetes/ConnectedKubernetes/help/Get-AzConnectedKubernetesUserCredential.md index 29236a32fb92..a637be44a2d9 100644 --- a/src/ConnectedKubernetes/ConnectedKubernetes/help/Get-AzConnectedKubernetesUserCredential.md +++ b/src/ConnectedKubernetes/ConnectedKubernetes/help/Get-AzConnectedKubernetesUserCredential.md @@ -16,14 +16,14 @@ Gets cluster user credentials of the connected cluster with a specified resource ``` Get-AzConnectedKubernetesUserCredential -ClusterName -ResourceGroupName [-SubscriptionId ] -AuthenticationMethod [-ClientProxy] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] + [-DefaultProfile ] [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` ### List ``` Get-AzConnectedKubernetesUserCredential -ClusterName -ResourceGroupName [-SubscriptionId ] -Property [-DefaultProfile ] - [-WhatIf] [-Confirm] [] + [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -130,6 +130,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: System.Management.Automation.ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Property . To construct, see NOTES section for PROPERTY properties and create a hash table. diff --git a/src/ConnectedKubernetes/ConnectedKubernetes/help/New-AzConnectedKubernetes.md b/src/ConnectedKubernetes/ConnectedKubernetes/help/New-AzConnectedKubernetes.md index 8b20dcb33233..089741860d62 100644 --- a/src/ConnectedKubernetes/ConnectedKubernetes/help/New-AzConnectedKubernetes.md +++ b/src/ConnectedKubernetes/ConnectedKubernetes/help/New-AzConnectedKubernetes.md @@ -22,7 +22,7 @@ New-AzConnectedKubernetes -ClusterName -ResourceGroupName [-Su [-CustomLocationsOid ] [-OidcIssuerProfileEnabled] [-OidcIssuerProfileSelfHostedIssuerUrl ] [-WorkloadIdentityEnabled] [-AcceptEULA] [-DefaultProfile ] [-AsJob] [-NoWait] [-ConfigurationSetting ] [-ConfigurationProtectedSetting ] [-GatewayResourceId ] - [-WhatIf] [-Confirm] [] + [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -531,6 +531,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: System.Management.Automation.ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -ProvisioningState Provisioning state of the connected cluster resource. diff --git a/src/ConnectedKubernetes/ConnectedKubernetes/help/Remove-AzConnectedKubernetes.md b/src/ConnectedKubernetes/ConnectedKubernetes/help/Remove-AzConnectedKubernetes.md index 53da0f8dffd1..58ef17e2141a 100644 --- a/src/ConnectedKubernetes/ConnectedKubernetes/help/Remove-AzConnectedKubernetes.md +++ b/src/ConnectedKubernetes/ConnectedKubernetes/help/Remove-AzConnectedKubernetes.md @@ -16,14 +16,14 @@ Delete a connected cluster, removing the tracked resource in Azure Resource Mana ``` Remove-AzConnectedKubernetes -ClusterName -ResourceGroupName [-SubscriptionId ] [-KubeConfig ] [-KubeContext ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] - [-WhatIf] [-Confirm] [] + [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` ### DeleteViaIdentity ``` Remove-AzConnectedKubernetes -InputObject [-KubeConfig ] [-KubeContext ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] - [-WhatIf] [-Confirm] [] + [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -168,6 +168,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: System.Management.Automation.ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -ResourceGroupName The name of the resource group. The name is case insensitive. diff --git a/src/ConnectedKubernetes/ConnectedKubernetes/help/Set-AzConnectedKubernetes.md b/src/ConnectedKubernetes/ConnectedKubernetes/help/Set-AzConnectedKubernetes.md index 51761d0e98c7..9b38d47ecf54 100644 --- a/src/ConnectedKubernetes/ConnectedKubernetes/help/Set-AzConnectedKubernetes.md +++ b/src/ConnectedKubernetes/ConnectedKubernetes/help/Set-AzConnectedKubernetes.md @@ -23,7 +23,7 @@ Set-AzConnectedKubernetes -ClusterName -ResourceGroupName [-Su [-OidcIssuerProfileEnabled] [-OidcIssuerProfileSelfHostedIssuerUrl ] [-WorkloadIdentityEnabled] [-AcceptEULA] [-ConfigurationSetting ] [-ConfigurationProtectedSetting ] [-GatewayResourceId ] [-DefaultProfile ] [-AsJob] [-NoWait] - [-WhatIf] [-Confirm] [] + [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` ### SetExpandedDisableGateway @@ -37,7 +37,7 @@ Set-AzConnectedKubernetes -ClusterName -ResourceGroupName [-Su [-OidcIssuerProfileEnabled] [-OidcIssuerProfileSelfHostedIssuerUrl ] [-WorkloadIdentityEnabled] [-AcceptEULA] [-ConfigurationSetting ] [-ConfigurationProtectedSetting ] [-GatewayResourceId ] [-DisableGateway] [-DefaultProfile ] [-AsJob] [-NoWait] - [-WhatIf] [-Confirm] [] + [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` ### SetDisableGateway @@ -51,7 +51,7 @@ Set-AzConnectedKubernetes [-SubscriptionId ] [-HttpProxy ] [-HttpsP [-WorkloadIdentityEnabled] [-AcceptEULA] [-ConfigurationSetting ] [-ConfigurationProtectedSetting ] [-GatewayResourceId ] [-DisableGateway] -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] - [-WhatIf] [-Confirm] [] + [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` ### Set @@ -64,7 +64,7 @@ Set-AzConnectedKubernetes [-SubscriptionId ] [-HttpProxy ] [-HttpsP [-CustomLocationsOid ] [-OidcIssuerProfileEnabled] [-OidcIssuerProfileSelfHostedIssuerUrl ] [-WorkloadIdentityEnabled] [-AcceptEULA] [-ConfigurationSetting ] [-ConfigurationProtectedSetting ] [-GatewayResourceId ] -InputObject - [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] + [-DefaultProfile ] [-AsJob] [-NoWait] [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` @@ -505,6 +505,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: System.Management.Automation.ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -ProvisioningState Provisioning state of the connected cluster resource. diff --git a/src/ConnectedKubernetes/ConnectedKubernetes/help/Update-AzConnectedKubernetes.md b/src/ConnectedKubernetes/ConnectedKubernetes/help/Update-AzConnectedKubernetes.md index 4ee40c351d11..8bb7e117f9db 100644 --- a/src/ConnectedKubernetes/ConnectedKubernetes/help/Update-AzConnectedKubernetes.md +++ b/src/ConnectedKubernetes/ConnectedKubernetes/help/Update-AzConnectedKubernetes.md @@ -17,7 +17,7 @@ API to update certain properties of the connected cluster resource Update-AzConnectedKubernetes -ClusterName -ResourceGroupName [-SubscriptionId ] [-AzureHybridBenefit ] [-AcceptEULA] [-Distribution ] [-DistributionVersion ] [-Tag ] [-DefaultProfile ] - [-WhatIf] [-Confirm] [] + [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` ### UpdateViaIdentityExpanded @@ -25,7 +25,7 @@ Update-AzConnectedKubernetes -ClusterName -ResourceGroupName [ Update-AzConnectedKubernetes -InputObject [-AzureHybridBenefit ] [-AcceptEULA] [-Distribution ] [-DistributionVersion ] [-Tag ] [-DefaultProfile ] - [-WhatIf] [-Confirm] [] + [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -196,6 +196,21 @@ Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: System.Management.Automation.ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -ResourceGroupName The name of the resource group. The name is case insensitive.