Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.25k stars 3.85k forks source link

New-AzAutomationVariable does not set description #14774

Closed achimismaili closed 3 years ago

achimismaili commented 3 years ago

Description

Parameter -Description for command New-AzAutomationVariable is ignored. Description is always set to string "description" only.

Steps to reproduce

Run

New-AzAutomationVariable -AutomationAccountName $AutomationAccountName -Name "Test" -Value "Test" -Description "Description is not set"  -ResourceGroupName $resourceGroup -Encrypted $false

A variable name test with value Test is created, but description is "description".

Environment data

Name                           Value
----                           -----
PSVersion                      7.1.3
PSEdition                      Core
GitCommitId                    7.1.3
OS                             Microsoft Windows 10.0.19041
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Module versions

PS D:\> (Get-Module  -ListAvailable)

    Directory: E:\xxx\PowerShell\Modules

ModuleType Version    PreRelease Name                                PSEdi
                                                                     tion 
---------- -------    ---------- ----                                -----
Binary     1.0.1                 ARMLinker                           Desk 
Binary     2.0.2.128             AzureAD                             Desk 
Binary     16.0.2091…            Microsoft.Online.SharePoint.PowerS… Desk 

    Directory: C:\program files\powershell\7\Modules

ModuleType Version    PreRelease Name                                PSEdi 
                                                                     tion  
---------- -------    ---------- ----                                ----- 
Manifest   7.0.0.0               CimCmdlets                          Core  
Manifest   1.2.5                 Microsoft.PowerShell.Archive        Desk 
Manifest   7.0.0.0               Microsoft.PowerShell.Diagnostics    Core 
Manifest   7.0.0.0               Microsoft.PowerShell.Host           Core  
Manifest   7.0.0.0               Microsoft.PowerShell.Management     Core 
Manifest   7.0.0.0               Microsoft.PowerShell.Security       Core 
Manifest   7.0.0.0               Microsoft.PowerShell.Utility        Core 
Manifest   7.0.0.0               Microsoft.WSMan.Management          Core 
Script     1.4.7                 PackageManagement                   Desk 
Script     2.2.5                 PowerShellGet                       Desk  
Script     2.0.5                 PSDesiredStateConfiguration         Core 
Script     7.0.0.0               PSDiagnostics                       Core 
Script     2.1.0                 PSReadLine                          Desk 
Binary     2.0.3                 ThreadJob                           Desk 

    Directory: C:\Program Files\WindowsPowerShell\Modules

ModuleType Version    PreRelease Name                                PSEdi 
                                                                     tion  
---------- -------    ---------- ----                                ----- 
Script     5.8.0                 Az                                  Core… 
Script     2.2.8                 Az.Accounts                         Core…
Script     2.2.6                 Az.Accounts                         Core…
Script     1.1.1                 Az.Advisor                          Core…
Script     2.0.2                 Az.Aks                              Core…
Script     1.1.4                 Az.AnalysisServices                 Core…
Script     2.2.0                 Az.ApiManagement                    Core…
Script     1.0.0                 Az.AppConfiguration                 Core…
Script     1.1.0                 Az.ApplicationInsights              Core…
Script     1.6.0                 Az.Automation                       Core…
Script     1.5.1                 Az.Automation                       Core…
Script     3.1.0                 Az.Batch                            Core…
Script     2.0.0                 Az.Billing                          Core…
Script     1.6.0                 Az.Cdn                              Core… 
Script     1.8.0                 Az.CognitiveServices                Core…
Script     4.11.0                Az.Compute                          Core…
Script     4.10.0                Az.Compute                          Core…
Script     1.0.3                 Az.ContainerInstance                Core…
Script     2.2.2                 Az.ContainerRegistry                Core… 
Script     2.2.1                 Az.ContainerRegistry                Core…
Script     1.1.0                 Az.CosmosDB                         Core…
Script     1.1.0                 Az.DataBoxEdge                      Core…
Script     1.1.0                 Az.Databricks                       Core…
Script     1.11.5                Az.DataFactory                      Core…
Script     1.11.4                Az.DataFactory                      Core…
Script     1.0.2                 Az.DataLakeAnalytics                Core…
Script     1.3.0                 Az.DataLakeStore                    Core…
Script     1.0.0                 Az.DataShare                        Core…
Script     1.1.0                 Az.DeploymentManager                Core…
Script     2.1.1                 Az.DesktopVirtualization            Core…
Script     1.0.2                 Az.DevTestLabs                      Core…
Script     1.1.2                 Az.Dns                              Core…
Script     1.3.0                 Az.EventGrid                        Core…
Script     1.7.2                 Az.EventHub                         Core…
Script     1.7.1                 Az.EventHub                         Core…
Script     1.7.0                 Az.FrontDoor                        Core…
Script     2.0.0                 Az.Functions                        Core…
Script     4.2.1                 Az.HDInsight                        Core…
Script     4.2.0                 Az.HDInsight                        Core…
Script     1.3.1                 Az.HealthcareApis                   Core…
Script     1.2.0                 Az.HealthcareApis                   Core…
Script     2.7.3                 Az.IotHub                           Core…
Script     2.7.2                 Az.IotHub                           Core…
Script     3.4.2                 Az.KeyVault                         Core…
Script     3.4.0                 Az.KeyVault                         Core…
Script     1.0.1                 Az.Kusto                            Core…
Script     1.5.0                 Az.LogicApp                         Core…
Script     1.1.3                 Az.MachineLearning                  Core…
Script     1.1.0                 Az.Maintenance                      Core…
Script     2.0.0                 Az.ManagedServices                  Core…
Script     1.0.2                 Az.MarketplaceOrdering              Core…
Script     1.1.1                 Az.Media                            Core…
Script     1.0.1                 Az.Migrate                          Core…
Script     2.5.0                 Az.Monitor                          Core…
Script     2.4.0                 Az.Monitor                          Core…
Script     4.7.0                 Az.Network                          Core…
Script     4.6.0                 Az.Network                          Core…
Script     1.1.1                 Az.NotificationHubs                 Core…
Script     2.3.0                 Az.OperationalInsights              Core…
Script     1.4.1                 Az.PolicyInsights                   Core…
Script     1.1.2                 Az.PowerBIEmbedded                  Core…
Script     1.0.3                 Az.PrivateDns                       Core…
Script     3.5.0                 Az.RecoveryServices                 Core…
Script     3.4.1                 Az.RecoveryServices                 Core…
Script     1.4.0                 Az.RedisCache                       Core…
Script     1.0.0                 Az.RedisEnterpriseCache             Core…
Script     1.0.3                 Az.Relay                            Core…
Script     3.4.1                 Az.Resources                        Core…
Script     3.3.0                 Az.Resources                        Core…
Script     1.5.0                 Az.ServiceBus                       Core…
Script     1.4.1                 Az.ServiceBus                       Core…
Script     2.3.0                 Az.ServiceFabric                    Core…
Script     2.2.2                 Az.ServiceFabric                    Core…
Script     1.2.0                 Az.SignalR                          Core…
Script     2.17.1                Az.Sql                              Core…
Script     2.16.0                Az.Sql                              Core…
Script     1.1.0                 Az.SqlVirtualMachine                Core…
Script     3.5.1                 Az.Storage                          Core…
Script     3.4.0                 Az.Storage                          Core…
Script     1.4.0                 Az.StorageSync                      Core…
Script     1.1.0                 Az.StreamAnalytics                  Core…
Script     1.0.1                 Az.StreamAnalytics                  Core…
Script     1.0.0                 Az.Support                          Core…
Script     1.0.4                 Az.TrafficManager                   Core…
Script     2.5.0                 Az.Websites                         Core…
Script     2.4.0                 Az.Websites                         Core…
Script     5.1.2                 Azure                               Desk 
Manifest   0.5.0                 Azure.AnalysisServices              Desk 
Script     4.2.1                 Azure.Storage                       Desk 
Binary     2.0.2.76              AzureAD                             Desk 
Script     5.7.0                 AzureRM                             Desk 
Script     0.6.6                 AzureRM.AnalysisServices            Desk 
Script     5.1.2                 AzureRM.ApiManagement               Desk 
Script     0.1.3                 AzureRM.ApplicationInsights         Desk 
Script     4.3.2                 AzureRM.Automation                  Desk 
Script     4.0.4                 AzureRM.Backup                      Desk 
Script     4.0.6                 AzureRM.Batch                       Desk 
Script     0.14.1                AzureRM.Billing                     Desk  
Script     4.2.2                 AzureRM.Cdn                         Desk 
Script     0.9.4                 AzureRM.CognitiveServices           Desk 
Script     4.6.0                 AzureRM.Compute                     Desk 
Script     0.3.1                 AzureRM.Consumption                 Desk 
Script     0.2.5                 AzureRM.ContainerInstance           Desk 
Script     1.0.4                 AzureRM.ContainerRegistry           Desk 
Script     4.2.2                 AzureRM.DataFactories               Desk 
Script     0.5.3                 AzureRM.DataFactoryV2               Desk 
Script     4.2.3                 AzureRM.DataLakeAnalytics           Desk 
Script     5.2.0                 AzureRM.DataLakeStore               Desk 
Script     4.0.4                 AzureRM.DevTestLabs                 Desk 
Script     4.1.2                 AzureRM.Dns                         Desk 
Script     0.3.2                 AzureRM.EventGrid                   Desk 
Script     0.6.3                 AzureRM.EventHub                    Desk 
Script     4.1.2                 AzureRM.HDInsight                   Desk 
Script     4.0.4                 AzureRM.Insights                    Desk  
Script     3.1.2                 AzureRM.IotHub                      Desk 
Script     4.3.0                 AzureRM.KeyVault                    Desk 
Script     4.0.3                 AzureRM.LogicApp                    Desk 
Script     0.17.2                AzureRM.MachineLearning             Desk 
Script     0.4.2                 AzureRM.MachineLearningCompute      Desk 
Script     0.2.1                 AzureRM.MarketplaceOrdering         Desk 
Script     0.9.2                 AzureRM.Media                       Desk 
Script     5.4.2                 AzureRM.Network                     Desk 
Script     4.1.1                 AzureRM.NotificationHubs            Desk 
Script     4.3.2                 AzureRM.OperationalInsights         Desk 
Script     4.1.4                 AzureRM.PowerBIEmbedded             Desk 
Script     4.6.0                 AzureRM.Profile                     Desk 
Script     4.1.2                 AzureRM.RecoveryServices            Desk 
Script     4.1.2                 AzureRM.RecoveryServices.Backup     Desk 
Script     0.2.4                 AzureRM.RecoveryServices.SiteRecov… Desk 
Script     4.1.2                 AzureRM.RedisCache                  Desk 
Script     0.3.3                 AzureRM.Relay                       Desk 
Script     5.5.2                 AzureRM.Resources                   Desk 
Script     0.16.3                AzureRM.Scheduler                   Desk 
Script     4.1.2                 AzureRM.ServerManagement            Desk 
Script     0.6.4                 AzureRM.ServiceBus                  Desk 
Script     0.3.4                 AzureRM.ServiceFabric               Desk 
Script     5.0.6                 AzureRM.SiteRecovery                Desk 
Script     4.4.0                 AzureRM.Sql                         Desk  
Script     4.2.3                 AzureRM.Storage                     Desk 
Script     4.0.4                 AzureRM.StreamAnalytics             Desk 
Script     4.0.1                 AzureRM.Tags                        Desk  
Script     4.0.3                 AzureRM.TrafficManager              Desk 
Script     4.0.2                 AzureRM.UsageAggregates             Desk 
Script     4.2.2                 AzureRM.Websites                    Desk 
Script     2.0.3                 ExchangeOnlineManagement            Desk 
Script     1.0.1                 ExchangeOnlineManagement            Desk 
Binary     16.0.2091…            Microsoft.Online.SharePoint.PowerS… Desk 
Script     1.0.1                 Microsoft.PowerShell.Operation.Val… Desk 
Binary     1.1.4                 MicrosoftTeams                      Core…
Binary     1.0.0.1               PackageManagement                   Desk 
Script     3.4.0                 Pester                              Desk 
Script     1.0.2.5               PlannerModule                       Desk 
Manifest   1.5.0                 PnP.PowerShell                      Core…
Manifest   1.4.0                 PnP.PowerShell                      Core…
Script     0.7.3                 posh-git                            Desk 
Script     1.0.0.1               PowerShellGet                       Desk 
Script     2.0.0      beta2      PSReadline                          Desk 

    Directory: C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules

ModuleType Version    PreRelease Name                                PSEdi 
                                                                     tion  
---------- -------    ---------- ----                                ----- 
Manifest   1.0.0.0               AppBackgroundTask                   Core… 
Manifest   2.0.1.0               Appx                                Core…
Script     1.0.0.0               AssignedAccess                      Core…
Manifest   1.0.0.0               BitLocker                           Core… 
Manifest   2.0.0.0               BitsTransfer                        Core…
Manifest   1.0.0.0               BranchCache                         Core…
Manifest   1.0                   Defender                            Core…
Manifest   1.0.2.0               DeliveryOptimization                Core…
Manifest   1.0.0.0               DirectAccessClientComponents        Core…
Script     3.0                   Dism                                Core…
Manifest   1.0.0.0               DnsClient                           Core…
Manifest   1.0.0.0               EventTracingManagement              Core…
Script     1.1.0.0               IISAdministration                   Core… 
Manifest   2.0.0.0               International                       Core…
Manifest   1.0.0.0               Kds                                 Core…
Manifest   3.0.0.0               Microsoft.PowerShell.Diagnostics    Core…
Manifest   1.0.0.0               Microsoft.PowerShell.LocalAccounts  Core…
Manifest   3.1.0.0               Microsoft.PowerShell.Management     Core…
Manifest   1.0                   MMAgent                             Core… 
Manifest   2.0.0.0               NetAdapter                          Core…
Manifest   1.0.0.0               NetConnection                       Core…
Manifest   1.0.0.0               NetEventPacketCapture               Core…
Manifest   2.0.0.0               NetLbfo                             Core…
Manifest   1.0.0.0               NetNat                              Core…
Manifest   2.0.0.0               NetQos                              Core… 
Manifest   2.0.0.0               NetSecurity                         Core…
Manifest   1.0.0.0               NetSwitchTeam                       Core…
Manifest   1.0.0.0               NetTCPIP                            Core…
Manifest   1.0.0.0               NetworkConnectivityStatus           Core…
Manifest   1.0.0.0               NetworkSwitchManager                Core…
Manifest   1.0.0.0               NetworkTransition                   Core…
Manifest   1.0.0.0               PcsvDevice                          Core…
Manifest   1.0.0.0               PKI                                 Core…
Manifest   1.0.0.0               PnpDevice                           Core…
Manifest   1.1                   PrintManagement                     Core…
Binary     1.0.12                ProcessMitigations                  Core… 
Script     3.0                   Provisioning                        Core…
Manifest   1.0.0.0               ScheduledTasks                      Core…
Manifest   2.0.0.0               SecureBoot                          Core…
Manifest   2.0.0.0               SmbShare                            Core…
Manifest   2.0.0.0               SmbWitness                          Core… 
Manifest   1.0.0.0               StartLayout                         Core…
Manifest   2.0.0.0               Storage                             Core…
Manifest   2.0.0.0               TLS                                 Core…
Manifest   1.0.0.0               TroubleshootingPack                 Core…
Manifest   2.0.0.0               TrustedPlatformModule               Core…
Binary     2.1.639.0             UEV                                 Core… 
Manifest   2.0.0.0               VpnClient                           Core…
Manifest   1.0.0.0               Wdac                                Core…
Manifest   2.0.0.0               Whea                                Core…
Manifest   1.0.0.0               WindowsDeveloperLicense             Core…
Script     1.0                   WindowsErrorReporting               Core…
Manifest   1.0.0.0               WindowsSearch                       Core…
Manifest   1.0.0.0               WindowsUpdate                       Core… 
Manifest   1.0.0.2               WindowsUpdateProvider               Core…

    Directory: C:\Program Files (x86)\Microsoft SQL 
Server\140\Tools\PowerShell\Modules

ModuleType Version    PreRelease Name                                PSEdi 
                                                                     tion  
---------- -------    ---------- ----                                ----- 
Manifest   14.0                  SQLPS                               Desk  

    Directory: C:\Program Files\Intel

ModuleType Version    PreRelease Name                                PSEdi 
                                                                     tion  
---------- -------    ---------- ----                                ----- 
Binary     20.2.4000…            IntelNetCmdlets                     Desk  

    Directory: C:\Users\xxx\.vscode\extensions\ms-vscode.powershe
ll-2021.2.2\modules

ModuleType Version    PreRelease Name                                PSEdi 
                                                                     tion  
---------- -------    ---------- ----                                ----- 
Script     1.1.3                 Plaster                             Desk  
Binary     2.3.0                 PowerShellEditorServices            Core…
Binary     0.2.0                 PowerShellEditorServices.VSCode     Desk 
Script     2.2.0      beta2      PSReadLine                          Desk 
Script     2.1.0                 PSReadLine                          Desk  
Script     1.19.1                PSScriptAnalyzer                    Desk 

Debug output

PS D:\> $DebugPreference='Continue'

PS D:\> New-AzAutomationVariable -AutomationAccountName $AutomationAccountName -Name "Test" -Value "Test" -Description "Description is not set"  -ResourceGroupName $resourceGroup -Encrypted $false

DEBUG: 21:02:58 - NewAzureAutomationVariable begin processing with ParameterSet 'ByName'.
DEBUG: 21:02:58 - using account id 'xxxxxxxxxxxx'...
DEBUG: [Common.Authentication]: Authenticating using Account: 'xxxxxxxxxxxx', environment: 'AzureCloud', tenant: 'xxxxxxxxxxxx'
DEBUG: 21:02:58 - [SilentAuthenticator] Calling SharedTokenCacheCredential.GetTokenAsync - TenantId:'xxxxxxxxxxxx', Scopes:'https://management.core.windows.net//.default', AuthorityHost:'https://login.microsoftonline.com/', UserId:'xxxxxxxxxxxx'
DEBUG: SharedTokenCacheCredential.GetToken invoked. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId:
DEBUG: SharedTokenCacheCredential.GetToken succeeded. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId:  ExpiresOn: 2021-04-18T19:49:07.0000000+00:00
DEBUG: [Common.Authentication]: Received token with LoginType 'User', Tenant: 'xxxxxxxxxxxx', UserId: 'xxxxxxxxxxxx'
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://management.azure.com/subscriptions/xxxxxxxxxxxx/resourceGroups/xxxxxxxxxxxxxxx-rg/providers/Microsoft.Automation/automationAccounts/xxxxxxxxxxxx/variables/Test?api-version=2020-01-13-preview

Headers:
x-ms-client-request-id        : 74b2e0b3-7199-4bb3-be54-74f42f5db297
Accept-Language               : en-US

Body:

DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
NotFound

Headers:
Cache-Control                 : no-cache
Pragma                        : no-cache
x-ms-request-id               : 74b2e0b3-7199-4bb3-be54-74f42f5db297
Strict-Transport-Security     : max-age=31536000; includeSubDomains
Server                        : Microsoft-IIS/10.0
X-AspNet-Version              : 4.0.30319
X-Powered-By                  : ASP.NET
x-ms-ratelimit-remaining-subscription-reads: 11997
x-ms-correlation-request-id   : 813a2b44-370c-40c4-af45-bd638592d5f5
x-ms-routing-request-id       : GERMANYWESTCENTRAL:20210418T190259Z:813a2b44-370c-40c4-af45-bd638592d5f5
X-Content-Type-Options        : nosniff
Date                          : Sun, 18 Apr 2021 19:02:58 GMT

Body:
{
  "code": "NotFound",
  "message": "Variable not found."
}

DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
PUT

Absolute Uri:
https://management.azure.com/subscriptions/xxxxxxxxxxxx/resourceGroups/xxxxxxxxxxxxxxx-rg/providers/Microsoft.Automation/automationAccounts/xxxxxxxxxxxx/variables/Test?api-version=2020-01-13-preview

Headers:
x-ms-client-request-id        : 74b2e0b3-7199-4bb3-be54-74f42f5db297
Accept-Language               : en-US

Body:
{
  "name": "Test",
  "properties": {
    "value": "\"Test\"",
    "description": "Description is not set",
    "isEncrypted": false
  }
}

DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
Created

Headers:
Cache-Control                 : no-cache
Pragma                        : no-cache
Location                      : https://management.azure.com/subscriptions/xxxxxxxxxxxx/resourceGroups/xxxxxxxxxxxxxxx-rg/providers/Microsoft.Automation/automationAccounts/xxxxxxxxxxxx/variables/Test?api-version=2020-01-13-preview
x-ms-request-id               : 74b2e0b3-7199-4bb3-be54-74f42f5db297
x-ms-location                 : https://management.azure.com/subscriptions/xxxxxxxxxxxx/resourceGroups/xxxxxxxxxxxxxxx-rg/providers/Microsoft.Automation/automationAccounts/xxxxxxxxxxxx/variables/Test?api-version=2020-01-13-preview
ocp-location                  : https://management.azure.com/subscriptions/xxxxxxxxxxxx/resourceGroups/xxxxxxxxxxxxxxx-rg/providers/Microsoft.Automation/automationAccounts/xxxxxxxxxxxx/variables/Test?api-version=2020-01-13-preview
Strict-Transport-Security     : max-age=31536000; includeSubDomains
Server                        : Microsoft-IIS/10.0
X-AspNet-Version              : 4.0.30319
X-Powered-By                  : ASP.NET
x-ms-ratelimit-remaining-subscription-writes: 1199
x-ms-correlation-request-id   : 53c2139b-09f3-4645-ae1a-834d301de1c3
x-ms-routing-request-id       : GERMANYWESTCENTRAL:20210418T190259Z:53c2139b-09f3-4645-ae1a-834d301de1c3
X-Content-Type-Options        : nosniff
Date                          : Sun, 18 Apr 2021 19:02:59 GMT

Body:
{
  "id": "/subscriptions/xxxxxxxxxxx/resourceGroups/xxxxxxxx/providers/Microsoft.Automation/automationAccounts/xxxxxxxxxxxxxx/variables/Test",
  "name": "Test",
  "type": "Microsoft.Automation/AutomationAccounts/Variables",
  "properties": {
    "creationTime": "2021-04-18T21:02:59.6333333+02:00",
    "lastModifiedTime": "2021-04-18T21:02:59.6333333+02:00",
    "isEncrypted": false,
    "value": "\"Test\"",
    "description": "Description is not set"
  }
}

Value                 : Test
Encrypted             : False
ResourceGroupName     : xxxxxxxxxxxxxxx-rg
AutomationAccountName : xxxxxxxxxxxx
Name                  : Test
CreationTime          : 18.04.2021 21:02:59 +02:00
LastModifiedTime      : 18.04.2021 21:02:59 +02:00
Description           : Description is not set

DEBUG: AzureQoSEvent: CommandName - New-AzAutomationVariable; IsSuccess - True; Duration - 00:00:00.8400978
DEBUG: Finish sending metric.
DEBUG: 21:03:00 - NewAzureAutomationVariable end processing.

Error output

n/a - not an error

achimismaili commented 3 years ago

Screenshot of the problem

Console window on the left, Azure portal window with the created variable on the right. image

ghost commented 3 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @jaspkaur28.

Issue Details
## Description Parameter -Description for command New-AzAutomationVariable is ignored. Description is always set to string "description" only. ## Steps to reproduce Run ```powershell New-AzAutomationVariable -AutomationAccountName $AutomationAccountName -Name "Test" -Value "Test" -Description "Description is not set" -ResourceGroupName $resourceGroup -Encrypted $false ``` A variable name test with value Test is created, but description is "description". ## Environment data ``` Name Value ---- ----- PSVersion 7.1.3 PSEdition Core GitCommitId 7.1.3 OS Microsoft Windows 10.0.19041 Platform Win32NT PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0 ``` ## Module versions ```powershell PS D:\> (Get-Module -ListAvailable) Directory: E:\xxx\PowerShell\Modules ModuleType Version PreRelease Name PSEdi tion ---------- ------- ---------- ---- ----- Binary 1.0.1 ARMLinker Desk Binary 2.0.2.128 AzureAD Desk Binary 16.0.2091… Microsoft.Online.SharePoint.PowerS… Desk Directory: C:\program files\powershell\7\Modules ModuleType Version PreRelease Name PSEdi tion ---------- ------- ---------- ---- ----- Manifest 7.0.0.0 CimCmdlets Core Manifest 1.2.5 Microsoft.PowerShell.Archive Desk Manifest 7.0.0.0 Microsoft.PowerShell.Diagnostics Core Manifest 7.0.0.0 Microsoft.PowerShell.Host Core Manifest 7.0.0.0 Microsoft.PowerShell.Management Core Manifest 7.0.0.0 Microsoft.PowerShell.Security Core Manifest 7.0.0.0 Microsoft.PowerShell.Utility Core Manifest 7.0.0.0 Microsoft.WSMan.Management Core Script 1.4.7 PackageManagement Desk Script 2.2.5 PowerShellGet Desk Script 2.0.5 PSDesiredStateConfiguration Core Script 7.0.0.0 PSDiagnostics Core Script 2.1.0 PSReadLine Desk Binary 2.0.3 ThreadJob Desk Directory: C:\Program Files\WindowsPowerShell\Modules ModuleType Version PreRelease Name PSEdi tion ---------- ------- ---------- ---- ----- Script 5.8.0 Az Core… Script 2.2.8 Az.Accounts Core… Script 2.2.6 Az.Accounts Core… Script 1.1.1 Az.Advisor Core… Script 2.0.2 Az.Aks Core… Script 1.1.4 Az.AnalysisServices Core… Script 2.2.0 Az.ApiManagement Core… Script 1.0.0 Az.AppConfiguration Core… Script 1.1.0 Az.ApplicationInsights Core… Script 1.6.0 Az.Automation Core… Script 1.5.1 Az.Automation Core… Script 3.1.0 Az.Batch Core… Script 2.0.0 Az.Billing Core… Script 1.6.0 Az.Cdn Core… Script 1.8.0 Az.CognitiveServices Core… Script 4.11.0 Az.Compute Core… Script 4.10.0 Az.Compute Core… Script 1.0.3 Az.ContainerInstance Core… Script 2.2.2 Az.ContainerRegistry Core… Script 2.2.1 Az.ContainerRegistry Core… Script 1.1.0 Az.CosmosDB Core… Script 1.1.0 Az.DataBoxEdge Core… Script 1.1.0 Az.Databricks Core… Script 1.11.5 Az.DataFactory Core… Script 1.11.4 Az.DataFactory Core… Script 1.0.2 Az.DataLakeAnalytics Core… Script 1.3.0 Az.DataLakeStore Core… Script 1.0.0 Az.DataShare Core… Script 1.1.0 Az.DeploymentManager Core… Script 2.1.1 Az.DesktopVirtualization Core… Script 1.0.2 Az.DevTestLabs Core… Script 1.1.2 Az.Dns Core… Script 1.3.0 Az.EventGrid Core… Script 1.7.2 Az.EventHub Core… Script 1.7.1 Az.EventHub Core… Script 1.7.0 Az.FrontDoor Core… Script 2.0.0 Az.Functions Core… Script 4.2.1 Az.HDInsight Core… Script 4.2.0 Az.HDInsight Core… Script 1.3.1 Az.HealthcareApis Core… Script 1.2.0 Az.HealthcareApis Core… Script 2.7.3 Az.IotHub Core… Script 2.7.2 Az.IotHub Core… Script 3.4.2 Az.KeyVault Core… Script 3.4.0 Az.KeyVault Core… Script 1.0.1 Az.Kusto Core… Script 1.5.0 Az.LogicApp Core… Script 1.1.3 Az.MachineLearning Core… Script 1.1.0 Az.Maintenance Core… Script 2.0.0 Az.ManagedServices Core… Script 1.0.2 Az.MarketplaceOrdering Core… Script 1.1.1 Az.Media Core… Script 1.0.1 Az.Migrate Core… Script 2.5.0 Az.Monitor Core… Script 2.4.0 Az.Monitor Core… Script 4.7.0 Az.Network Core… Script 4.6.0 Az.Network Core… Script 1.1.1 Az.NotificationHubs Core… Script 2.3.0 Az.OperationalInsights Core… Script 1.4.1 Az.PolicyInsights Core… Script 1.1.2 Az.PowerBIEmbedded Core… Script 1.0.3 Az.PrivateDns Core… Script 3.5.0 Az.RecoveryServices Core… Script 3.4.1 Az.RecoveryServices Core… Script 1.4.0 Az.RedisCache Core… Script 1.0.0 Az.RedisEnterpriseCache Core… Script 1.0.3 Az.Relay Core… Script 3.4.1 Az.Resources Core… Script 3.3.0 Az.Resources Core… Script 1.5.0 Az.ServiceBus Core… Script 1.4.1 Az.ServiceBus Core… Script 2.3.0 Az.ServiceFabric Core… Script 2.2.2 Az.ServiceFabric Core… Script 1.2.0 Az.SignalR Core… Script 2.17.1 Az.Sql Core… Script 2.16.0 Az.Sql Core… Script 1.1.0 Az.SqlVirtualMachine Core… Script 3.5.1 Az.Storage Core… Script 3.4.0 Az.Storage Core… Script 1.4.0 Az.StorageSync Core… Script 1.1.0 Az.StreamAnalytics Core… Script 1.0.1 Az.StreamAnalytics Core… Script 1.0.0 Az.Support Core… Script 1.0.4 Az.TrafficManager Core… Script 2.5.0 Az.Websites Core… Script 2.4.0 Az.Websites Core… Script 5.1.2 Azure Desk Manifest 0.5.0 Azure.AnalysisServices Desk Script 4.2.1 Azure.Storage Desk Binary 2.0.2.76 AzureAD Desk Script 5.7.0 AzureRM Desk Script 0.6.6 AzureRM.AnalysisServices Desk Script 5.1.2 AzureRM.ApiManagement Desk Script 0.1.3 AzureRM.ApplicationInsights Desk Script 4.3.2 AzureRM.Automation Desk Script 4.0.4 AzureRM.Backup Desk Script 4.0.6 AzureRM.Batch Desk Script 0.14.1 AzureRM.Billing Desk Script 4.2.2 AzureRM.Cdn Desk Script 0.9.4 AzureRM.CognitiveServices Desk Script 4.6.0 AzureRM.Compute Desk Script 0.3.1 AzureRM.Consumption Desk Script 0.2.5 AzureRM.ContainerInstance Desk Script 1.0.4 AzureRM.ContainerRegistry Desk Script 4.2.2 AzureRM.DataFactories Desk Script 0.5.3 AzureRM.DataFactoryV2 Desk Script 4.2.3 AzureRM.DataLakeAnalytics Desk Script 5.2.0 AzureRM.DataLakeStore Desk Script 4.0.4 AzureRM.DevTestLabs Desk Script 4.1.2 AzureRM.Dns Desk Script 0.3.2 AzureRM.EventGrid Desk Script 0.6.3 AzureRM.EventHub Desk Script 4.1.2 AzureRM.HDInsight Desk Script 4.0.4 AzureRM.Insights Desk Script 3.1.2 AzureRM.IotHub Desk Script 4.3.0 AzureRM.KeyVault Desk Script 4.0.3 AzureRM.LogicApp Desk Script 0.17.2 AzureRM.MachineLearning Desk Script 0.4.2 AzureRM.MachineLearningCompute Desk Script 0.2.1 AzureRM.MarketplaceOrdering Desk Script 0.9.2 AzureRM.Media Desk Script 5.4.2 AzureRM.Network Desk Script 4.1.1 AzureRM.NotificationHubs Desk Script 4.3.2 AzureRM.OperationalInsights Desk Script 4.1.4 AzureRM.PowerBIEmbedded Desk Script 4.6.0 AzureRM.Profile Desk Script 4.1.2 AzureRM.RecoveryServices Desk Script 4.1.2 AzureRM.RecoveryServices.Backup Desk Script 0.2.4 AzureRM.RecoveryServices.SiteRecov… Desk Script 4.1.2 AzureRM.RedisCache Desk Script 0.3.3 AzureRM.Relay Desk Script 5.5.2 AzureRM.Resources Desk Script 0.16.3 AzureRM.Scheduler Desk Script 4.1.2 AzureRM.ServerManagement Desk Script 0.6.4 AzureRM.ServiceBus Desk Script 0.3.4 AzureRM.ServiceFabric Desk Script 5.0.6 AzureRM.SiteRecovery Desk Script 4.4.0 AzureRM.Sql Desk Script 4.2.3 AzureRM.Storage Desk Script 4.0.4 AzureRM.StreamAnalytics Desk Script 4.0.1 AzureRM.Tags Desk Script 4.0.3 AzureRM.TrafficManager Desk Script 4.0.2 AzureRM.UsageAggregates Desk Script 4.2.2 AzureRM.Websites Desk Script 2.0.3 ExchangeOnlineManagement Desk Script 1.0.1 ExchangeOnlineManagement Desk Binary 16.0.2091… Microsoft.Online.SharePoint.PowerS… Desk Script 1.0.1 Microsoft.PowerShell.Operation.Val… Desk Binary 1.1.4 MicrosoftTeams Core… Binary 1.0.0.1 PackageManagement Desk Script 3.4.0 Pester Desk Script 1.0.2.5 PlannerModule Desk Manifest 1.5.0 PnP.PowerShell Core… Manifest 1.4.0 PnP.PowerShell Core… Script 0.7.3 posh-git Desk Script 1.0.0.1 PowerShellGet Desk Script 2.0.0 beta2 PSReadline Desk Directory: C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules ModuleType Version PreRelease Name PSEdi tion ---------- ------- ---------- ---- ----- Manifest 1.0.0.0 AppBackgroundTask Core… Manifest 2.0.1.0 Appx Core… Script 1.0.0.0 AssignedAccess Core… Manifest 1.0.0.0 BitLocker Core… Manifest 2.0.0.0 BitsTransfer Core… Manifest 1.0.0.0 BranchCache Core… Manifest 1.0 Defender Core… Manifest 1.0.2.0 DeliveryOptimization Core… Manifest 1.0.0.0 DirectAccessClientComponents Core… Script 3.0 Dism Core… Manifest 1.0.0.0 DnsClient Core… Manifest 1.0.0.0 EventTracingManagement Core… Script 1.1.0.0 IISAdministration Core… Manifest 2.0.0.0 International Core… Manifest 1.0.0.0 Kds Core… Manifest 3.0.0.0 Microsoft.PowerShell.Diagnostics Core… Manifest 1.0.0.0 Microsoft.PowerShell.LocalAccounts Core… Manifest 3.1.0.0 Microsoft.PowerShell.Management Core… Manifest 1.0 MMAgent Core… Manifest 2.0.0.0 NetAdapter Core… Manifest 1.0.0.0 NetConnection Core… Manifest 1.0.0.0 NetEventPacketCapture Core… Manifest 2.0.0.0 NetLbfo Core… Manifest 1.0.0.0 NetNat Core… Manifest 2.0.0.0 NetQos Core… Manifest 2.0.0.0 NetSecurity Core… Manifest 1.0.0.0 NetSwitchTeam Core… Manifest 1.0.0.0 NetTCPIP Core… Manifest 1.0.0.0 NetworkConnectivityStatus Core… Manifest 1.0.0.0 NetworkSwitchManager Core… Manifest 1.0.0.0 NetworkTransition Core… Manifest 1.0.0.0 PcsvDevice Core… Manifest 1.0.0.0 PKI Core… Manifest 1.0.0.0 PnpDevice Core… Manifest 1.1 PrintManagement Core… Binary 1.0.12 ProcessMitigations Core… Script 3.0 Provisioning Core… Manifest 1.0.0.0 ScheduledTasks Core… Manifest 2.0.0.0 SecureBoot Core… Manifest 2.0.0.0 SmbShare Core… Manifest 2.0.0.0 SmbWitness Core… Manifest 1.0.0.0 StartLayout Core… Manifest 2.0.0.0 Storage Core… Manifest 2.0.0.0 TLS Core… Manifest 1.0.0.0 TroubleshootingPack Core… Manifest 2.0.0.0 TrustedPlatformModule Core… Binary 2.1.639.0 UEV Core… Manifest 2.0.0.0 VpnClient Core… Manifest 1.0.0.0 Wdac Core… Manifest 2.0.0.0 Whea Core… Manifest 1.0.0.0 WindowsDeveloperLicense Core… Script 1.0 WindowsErrorReporting Core… Manifest 1.0.0.0 WindowsSearch Core… Manifest 1.0.0.0 WindowsUpdate Core… Manifest 1.0.0.2 WindowsUpdateProvider Core… Directory: C:\Program Files (x86)\Microsoft SQL Server\140\Tools\PowerShell\Modules ModuleType Version PreRelease Name PSEdi tion ---------- ------- ---------- ---- ----- Manifest 14.0 SQLPS Desk Directory: C:\Program Files\Intel ModuleType Version PreRelease Name PSEdi tion ---------- ------- ---------- ---- ----- Binary 20.2.4000… IntelNetCmdlets Desk Directory: C:\Users\xxx\.vscode\extensions\ms-vscode.powershe ll-2021.2.2\modules ModuleType Version PreRelease Name PSEdi tion ---------- ------- ---------- ---- ----- Script 1.1.3 Plaster Desk Binary 2.3.0 PowerShellEditorServices Core… Binary 0.2.0 PowerShellEditorServices.VSCode Desk Script 2.2.0 beta2 PSReadLine Desk Script 2.1.0 PSReadLine Desk Script 1.19.1 PSScriptAnalyzer Desk ``` ## Debug output ``` PS D:\> $DebugPreference='Continue' PS D:\> New-AzAutomationVariable -AutomationAccountName $AutomationAccountName -Name "Test" -Value "Test" -Description "Description is not set" -ResourceGroupName $resourceGroup -Encrypted $false DEBUG: 21:02:58 - NewAzureAutomationVariable begin processing with ParameterSet 'ByName'. DEBUG: 21:02:58 - using account id 'xxxxxxxxxxxx'... DEBUG: [Common.Authentication]: Authenticating using Account: 'xxxxxxxxxxxx', environment: 'AzureCloud', tenant: 'xxxxxxxxxxxx' DEBUG: 21:02:58 - [SilentAuthenticator] Calling SharedTokenCacheCredential.GetTokenAsync - TenantId:'xxxxxxxxxxxx', Scopes:'https://management.core.windows.net//.default', AuthorityHost:'https://login.microsoftonline.com/', UserId:'xxxxxxxxxxxx' DEBUG: SharedTokenCacheCredential.GetToken invoked. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId: DEBUG: SharedTokenCacheCredential.GetToken succeeded. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId: ExpiresOn: 2021-04-18T19:49:07.0000000+00:00 DEBUG: [Common.Authentication]: Received token with LoginType 'User', Tenant: 'xxxxxxxxxxxx', UserId: 'xxxxxxxxxxxx' DEBUG: ============================ HTTP REQUEST ============================ HTTP Method: GET Absolute Uri: https://management.azure.com/subscriptions/xxxxxxxxxxxx/resourceGroups/xxxxxxxxxxxxxxx-rg/providers/Microsoft.Automation/automationAccounts/xxxxxxxxxxxx/variables/Test?api-version=2020-01-13-preview Headers: x-ms-client-request-id : 74b2e0b3-7199-4bb3-be54-74f42f5db297 Accept-Language : en-US Body: DEBUG: ============================ HTTP RESPONSE ============================ Status Code: NotFound Headers: Cache-Control : no-cache Pragma : no-cache x-ms-request-id : 74b2e0b3-7199-4bb3-be54-74f42f5db297 Strict-Transport-Security : max-age=31536000; includeSubDomains Server : Microsoft-IIS/10.0 X-AspNet-Version : 4.0.30319 X-Powered-By : ASP.NET x-ms-ratelimit-remaining-subscription-reads: 11997 x-ms-correlation-request-id : 813a2b44-370c-40c4-af45-bd638592d5f5 x-ms-routing-request-id : GERMANYWESTCENTRAL:20210418T190259Z:813a2b44-370c-40c4-af45-bd638592d5f5 X-Content-Type-Options : nosniff Date : Sun, 18 Apr 2021 19:02:58 GMT Body: { "code": "NotFound", "message": "Variable not found." } DEBUG: ============================ HTTP REQUEST ============================ HTTP Method: PUT Absolute Uri: https://management.azure.com/subscriptions/xxxxxxxxxxxx/resourceGroups/xxxxxxxxxxxxxxx-rg/providers/Microsoft.Automation/automationAccounts/xxxxxxxxxxxx/variables/Test?api-version=2020-01-13-preview Headers: x-ms-client-request-id : 74b2e0b3-7199-4bb3-be54-74f42f5db297 Accept-Language : en-US Body: { "name": "Test", "properties": { "value": "\"Test\"", "description": "Description is not set", "isEncrypted": false } } DEBUG: ============================ HTTP RESPONSE ============================ Status Code: Created Headers: Cache-Control : no-cache Pragma : no-cache Location : https://management.azure.com/subscriptions/xxxxxxxxxxxx/resourceGroups/xxxxxxxxxxxxxxx-rg/providers/Microsoft.Automation/automationAccounts/xxxxxxxxxxxx/variables/Test?api-version=2020-01-13-preview x-ms-request-id : 74b2e0b3-7199-4bb3-be54-74f42f5db297 x-ms-location : https://management.azure.com/subscriptions/xxxxxxxxxxxx/resourceGroups/xxxxxxxxxxxxxxx-rg/providers/Microsoft.Automation/automationAccounts/xxxxxxxxxxxx/variables/Test?api-version=2020-01-13-preview ocp-location : https://management.azure.com/subscriptions/xxxxxxxxxxxx/resourceGroups/xxxxxxxxxxxxxxx-rg/providers/Microsoft.Automation/automationAccounts/xxxxxxxxxxxx/variables/Test?api-version=2020-01-13-preview Strict-Transport-Security : max-age=31536000; includeSubDomains Server : Microsoft-IIS/10.0 X-AspNet-Version : 4.0.30319 X-Powered-By : ASP.NET x-ms-ratelimit-remaining-subscription-writes: 1199 x-ms-correlation-request-id : 53c2139b-09f3-4645-ae1a-834d301de1c3 x-ms-routing-request-id : GERMANYWESTCENTRAL:20210418T190259Z:53c2139b-09f3-4645-ae1a-834d301de1c3 X-Content-Type-Options : nosniff Date : Sun, 18 Apr 2021 19:02:59 GMT Body: { "id": "/subscriptions/xxxxxxxxxxx/resourceGroups/xxxxxxxx/providers/Microsoft.Automation/automationAccounts/xxxxxxxxxxxxxx/variables/Test", "name": "Test", "type": "Microsoft.Automation/AutomationAccounts/Variables", "properties": { "creationTime": "2021-04-18T21:02:59.6333333+02:00", "lastModifiedTime": "2021-04-18T21:02:59.6333333+02:00", "isEncrypted": false, "value": "\"Test\"", "description": "Description is not set" } } Value : Test Encrypted : False ResourceGroupName : xxxxxxxxxxxxxxx-rg AutomationAccountName : xxxxxxxxxxxx Name : Test CreationTime : 18.04.2021 21:02:59 +02:00 LastModifiedTime : 18.04.2021 21:02:59 +02:00 Description : Description is not set DEBUG: AzureQoSEvent: CommandName - New-AzAutomationVariable; IsSuccess - True; Duration - 00:00:00.8400978 DEBUG: Finish sending metric. DEBUG: 21:03:00 - NewAzureAutomationVariable end processing. ``` ## Error output n/a - not an error
Author: achimismaili
Assignees: -
Labels: `Automation`, `Service Attention`, `customer-reported`, `question`
Milestone: -
jaspkaur28 commented 3 years ago

Thanks for the feedback. We will take this up as an improvement area for the PS cmdlets , however , deferring it to Q3 CY21 due to other over-arching priorities in the service.

SatishBoddu-MSFT commented 3 years ago

Hello @jaspkaur28 @achimismaili Apologies for the delayed response. I see that this issue is opened a long time ago and no further activity had taken place. So wanted to check if you are still looking for assistance on this query? Please let us know.

Please let us know if we are good to close this issue?

jaspkaur28 commented 3 years ago

@SatishBoddu-MSFT It seems the issue has been fixed already as I could not repro it , hence closing the issue. @achimismaili Could you please confirm ? If you still see an issue , we could re-open it.