Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.22k stars 3.82k forks source link

New-AzCognitiveServicesAccount does not create or update tags #15551

Open rink72 opened 3 years ago

rink72 commented 3 years ago

Description

When using New-AzCognitiveServicesAccount or Set-AzCognitiveServicesAccount the -Tag parameter does not set tags and in fact will remove existing tags if specified.

Steps to reproduce


$tags = @{test = 'tag'}

New-AzCognitiveServicesAccount `
  -ResourceGroupName my-rg `
  -Name my-cog `
  -Type LUIS `
  -SkuName S0 `
  -Location 'Australia East' `
  -Tag $tags

Environment data

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

Module versions


    Directory: C:\Program Files\PowerShell\Modules

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Script     6.0.0                 Az                                  Core,Desk
Script     2.3.0                 Az.Accounts                         Core,Desk {Disable-AzDataCollection, Disable-AzCo…
Script     1.1.1                 Az.Advisor                          Core,Desk {Get-AzAdvisorRecommendation, Enable-Az…
Script     2.1.0                 Az.Aks                              Core,Desk {Get-AzAksCluster, New-AzAksCluster, Re…
Script     1.1.4                 Az.AnalysisServices                 Core,Desk {Resume-AzAnalysisServicesServer, Suspe…
Script     2.2.0                 Az.ApiManagement                    Core,Desk {Add-AzApiManagementApiToGateway, Add-A…
Script     1.0.0                 Az.AppConfiguration                 Core,Desk {Get-AzAppConfigurationStore, Get-AzApp…
Script     1.1.0                 Az.ApplicationInsights              Core,Desk {Get-AzApplicationInsights, New-AzAppli…
Script     1.7.0                 Az.Automation                       Core,Desk {Get-AzAutomationHybridWorkerGroup, Rem…
Script     3.1.0                 Az.Batch                            Core,Desk {Remove-AzBatchAccount, Get-AzBatchAcco…
Script     2.0.0                 Az.Billing                          Core,Desk {Get-AzBillingInvoice, Get-AzBillingPer…
Script     1.7.0                 Az.Cdn                              Core,Desk {Get-AzCdnProfile, Get-AzCdnProfileSsoU…
Script     1.8.0                 Az.CognitiveServices                Core,Desk {Get-AzCognitiveServicesAccount, Get-Az…
Script     4.13.0                Az.Compute                          Core,Desk {Remove-AzAvailabilitySet, Get-AzAvaila…
Script     2.0.0                 Az.ContainerInstance                Core,Desk {Add-AzContainerInstanceOutput, Get-AzC…
Script     2.2.3                 Az.ContainerRegistry                Core,Desk {New-AzContainerRegistry, Get-AzContain…
Script     1.2.0                 Az.CosmosDB                         Core,Desk {Get-AzCosmosDBSqlContainer, Get-AzCosm…
Script     1.1.0                 Az.DataBoxEdge                      Core,Desk {Get-AzDataBoxEdgeJob, Get-AzDataBoxEdg…
Script     1.1.0                 Az.Databricks                       Core,Desk {Get-AzDatabricksVNetPeering, Get-AzDat…
Script     1.12.0                Az.DataFactory                      Core,Desk {Set-AzDataFactoryV2, Update-AzDataFact…
Script     1.0.2                 Az.DataLakeAnalytics                Core,Desk {Get-AzDataLakeAnalyticsDataSource, New…
Script     1.3.0                 Az.DataLakeStore                    Core,Desk {Get-AzDataLakeStoreTrustedIdProvider, …
Script     1.0.0                 Az.DataShare                        Core,Desk {New-AzDataShareAccount, Get-AzDataShar…
Script     1.1.0                 Az.DeploymentManager                Core,Desk {Get-AzDeploymentManagerArtifactSource,…
Script     3.0.0                 Az.DesktopVirtualization            Core,Desk {Disconnect-AzWvdUserSession, Expand-Az…
Script     1.0.2                 Az.DevTestLabs                      Core,Desk {Get-AzDtlAllowedVMSizesPolicy, Get-AzD…
Script     1.1.2                 Az.Dns                              Core,Desk {Get-AzDnsRecordSet, New-AzDnsRecordCon…
Script     1.3.0                 Az.EventGrid                        Core,Desk {New-AzEventGridTopic, Get-AzEventGridT…
Script     1.7.2                 Az.EventHub                         Core,Desk {New-AzEventHubNamespace, Get-AzEventHu…
Script     1.8.0                 Az.FrontDoor                        Core,Desk {New-AzFrontDoor, Get-AzFrontDoor, Set-…
Script     3.0.0                 Az.Functions                        Core,Desk {Get-AzFunctionApp, Get-AzFunctionAppAv…
Script     4.2.1                 Az.HDInsight                        Core,Desk {Get-AzHDInsightJob, New-AzHDInsightSqo…
Script     1.3.1                 Az.HealthcareApis                   Core,Desk {New-AzHealthcareApisService, Remove-Az…
Script     2.7.3                 Az.IotHub                           Core,Desk {Add-AzIotHubKey, Get-AzIotHubEventHubC…
Script     3.4.4                 Az.KeyVault                         Core,Desk {Add-AzKeyVaultCertificate, Update-AzKe…
Script     2.0.0                 Az.Kusto                            Core,Desk {Add-AzKustoClusterLanguageExtension, A…
Script     1.5.0                 Az.LogicApp                         Core,Desk {Get-AzIntegrationAccountAgreement, Get…
Script     1.1.3                 Az.MachineLearning                  Core,Desk {Move-AzMlCommitmentAssociation, Get-Az…
Script     1.1.1                 Az.Maintenance                      Core,Desk {Get-AzApplyUpdate, Get-AzConfiguration…
Script     2.0.0                 Az.ManagedServices                  Core,Desk {Get-AzManagedServicesAssignment, New-A…
Script     1.0.2                 Az.MarketplaceOrdering              Core,Desk {Get-AzMarketplaceTerms, Set-AzMarketpl…
Script     1.1.1                 Az.Media                            Core,Desk {Sync-AzMediaServiceStorageKey, Set-AzM…
Script     1.0.2                 Az.Migrate                          Core,Desk {Get-AzMigrateDiscoveredServer, Get-AzM…
Script     2.5.0                 Az.Monitor                          Core,Desk {Get-AzMetricDefinition, Get-AzMetric, …
Script     4.8.0                 Az.Network                          Core,Desk {Add-AzApplicationGatewayAuthentication…
Script     1.1.1                 Az.NotificationHubs                 Core,Desk {Get-AzNotificationHub, Get-AzNotificat…
Script     2.3.0                 Az.OperationalInsights              Core,Desk {New-AzOperationalInsightsAzureActivity…
Script     1.4.1                 Az.PolicyInsights                   Core,Desk {Get-AzPolicyEvent, Get-AzPolicyState, …
Script     1.1.2                 Az.PowerBIEmbedded                  Core,Desk {Remove-AzPowerBIWorkspaceCollection, G…
Script     1.0.3                 Az.PrivateDns                       Core,Desk {Get-AzPrivateDnsZone, Remove-AzPrivate…
Script     4.1.0                 Az.RecoveryServices                 Core,Desk {Get-AzRecoveryServicesBackupProperty, …
Script     1.4.0                 Az.RedisCache                       Core,Desk {Remove-AzRedisCachePatchSchedule, New-…
Script     1.0.0                 Az.RedisEnterpriseCache             Core,Desk {Export-AzRedisEnterpriseCache, Get-AzR…
Script     1.0.3                 Az.Relay                            Core,Desk {New-AzRelayNamespace, Get-AzRelayNames…
Script     1.0.0                 Az.ResourceMover                    Core,Desk {Add-AzResourceMoverMoveResource, Get-A…
Script     4.1.0                 Az.Resources                        Core,Desk {Get-AzProviderOperation, Remove-AzRole…
Script     0.11.0                Az.Security                         Core,Desk {Get-AzSecurityAlert, Set-AzSecurityAle…
Script     1.0.0                 Az.SecurityInsights                 Core,Desk {Get-AzSentinelAlertRuleAction, New-AzS…
Script     1.5.0                 Az.ServiceBus                       Core,Desk {New-AzServiceBusNamespace, Get-AzServi…
Script     3.0.0                 Az.ServiceFabric                    Core,Desk {Add-AzServiceFabricClientCertificate, …
Script     1.2.0                 Az.SignalR                          Core,Desk {New-AzSignalR, Get-AzSignalR, Get-AzSi…
Script     3.1.0                 Az.Sql                              Core,Desk {Get-AzSqlDatabaseTransparentDataEncryp…
Script     1.1.0                 Az.SqlVirtualMachine                Core,Desk {New-AzSqlVM, Get-AzSqlVM, Update-AzSql…
Script     3.7.0                 Az.Storage                          Core,Desk {Get-AzStorageAccount, Get-AzStorageAcc…
Script     1.5.0                 Az.StorageSync                      Core,Desk {Invoke-AzStorageSyncCompatibilityCheck…
Script     2.0.0                 Az.StreamAnalytics                  Core,Desk {Get-AzStreamAnalyticsCluster, Get-AzSt…
Script     1.0.0                 Az.Support                          Core,Desk {Get-AzSupportService, Get-AzSupportPro…
Script     1.0.4                 Az.TrafficManager                   Core,Desk {Add-AzTrafficManagerCustomHeaderToEndp…
Script     2.6.0                 Az.Websites                         Core,Desk {Get-AzAppServicePlan, Set-AzAppService…
Script     0.5.4                 Azure.AnalysisServices              Desk      {Add-AzureAnalysisServicesAccount, Rest…
Script     4.6.1                 Azure.Storage                       Desk      {Get-AzureStorageTable, New-AzureStorag…
Binary     2.0.2.135             AzureAD                             Desk
Script     0.6.15                AzureRM.AnalysisServices            Desk      {Resume-AzureRmAnalysisServicesServer, …
Script     6.1.8                 AzureRM.ApiManagement               Desk      {Add-AzureRmApiManagementRegion, Get-Az…
Script     0.1.9                 AzureRM.ApplicationInsights         Desk      {Get-AzureRmApplicationInsights, New-Az…
Script     6.1.2                 AzureRM.Automation                  Desk      {Get-AzureRMAutomationHybridWorkerGroup…
Script     4.1.6                 AzureRM.Batch                       Desk      {Remove-AzureRmBatchAccount, Get-AzureR…
Script     0.14.7                AzureRM.Billing                     Desk      {Get-AzureRmBillingInvoice, Get-AzureRm…
Script     5.0.7                 AzureRM.Cdn                         Desk      {Get-AzureRmCdnProfile, Get-AzureRmCdnP…
Script     0.9.13                AzureRM.CognitiveServices           Desk      {Get-AzureRmCognitiveServicesAccount, G…
Script     5.9.2                 AzureRM.Compute                     Desk      {Remove-AzureRmAvailabilitySet, Get-Azu…
Script     0.3.8                 AzureRM.Consumption                 Desk      {Get-AzureRmConsumptionBudget, Get-Azur…
Script     0.2.13                AzureRM.ContainerInstance           Desk      {New-AzureRmContainerGroup, Get-AzureRm…
Script     1.0.11                AzureRM.ContainerRegistry           Desk      {New-AzureRmContainerRegistry, Get-Azur…
Script     5.0.4                 AzureRM.DataFactories               Desk      {Remove-AzureRmDataFactory, Get-AzureRm…
Script     0.5.12                AzureRM.DataFactoryV2               Desk      {Set-AzureRmDataFactoryV2, Update-Azure…
Script     5.1.5                 AzureRM.DataLakeAnalytics           Desk      {Get-AzureRmDataLakeAnalyticsDataSource…
Script     6.2.2                 AzureRM.DataLakeStore               Desk      {Get-AzureRmDataLakeStoreTrustedIdProvi…
Script     4.0.10                AzureRM.DevTestLabs                 Desk      {Get-AzureRmDtlAllowedVMSizesPolicy, Ge…
Script     5.1.1                 AzureRM.Dns                         Desk      {Get-AzureRmDnsRecordSet, New-AzureRmDn…
Script     0.3.8                 AzureRM.EventGrid                   Desk      {New-AzureRmEventGridTopic, Get-AzureRm…
Script     0.7.1                 AzureRM.EventHub                    Desk      {New-AzureRmEventHubNamespace, Get-Azur…
Script     4.1.9                 AzureRM.HDInsight                   Desk      {Get-AzureRmHDInsightJob, New-AzureRmHD…
Script     5.1.6                 AzureRM.Insights                    Desk      {Get-AzureRmMetricDefinition, Get-Azure…
Script     3.1.9                 AzureRM.IotHub                      Desk      {Add-AzureRmIotHubKey, Get-AzureRmIotHu…
Script     5.2.2                 AzureRM.KeyVault                    Desk      {Add-AzureKeyVaultCertificate, Update-A…
Script     4.1.5                 AzureRM.LogicApp                    Desk      {Get-AzureRmIntegrationAccountAgreement…
Script     0.18.6                AzureRM.MachineLearning             Desk      {Move-AzureRmMlCommitmentAssociation, G…
Script     0.2.8                 AzureRM.MarketplaceOrdering         Desk      {Get-AzureRmMarketplaceTerms, Set-Azure…
Script     0.10.5                AzureRM.Media                       Desk      {Sync-AzureRmMediaServiceStorageKeys, S…
Script     6.11.2                AzureRM.Network                     Desk      {Add-AzureRmApplicationGatewayAuthentic…
Script     5.0.4                 AzureRM.NotificationHubs            Desk      {Get-AzureRmNotificationHub, Get-AzureR…
Script     5.0.7                 AzureRM.OperationalInsights         Desk      {New-AzureRmOperationalInsightsAzureAct…
Script     1.1.1                 AzureRM.PolicyInsights              Desk      {Get-AzureRmPolicyEvent, Get-AzureRmPol…
Script     4.1.11                AzureRM.PowerBIEmbedded             Desk      {Remove-AzureRmPowerBIWorkspaceCollecti…
Script     5.8.4                 AzureRM.profile                     Desk      {Disable-AzureRmDataCollection, Disable…
Script     4.1.10                AzureRM.RecoveryServices            Desk      {Get-AzureRmRecoveryServicesBackupPrope…
Script     4.5.3                 AzureRM.RecoveryServices.Backup     Desk      {Backup-AzureRmRecoveryServicesBackupIt…
Script     0.2.13                AzureRM.RecoveryServices.SiteRecov… Desk      {Edit-AzureRmRecoveryServicesAsrRecover…
Script     5.1.1                 AzureRM.RedisCache                  Desk      {Remove-AzureRmRedisCachePatchSchedule,…
Script     0.3.13                AzureRM.Relay                       Desk      {New-AzureRmRelayNamespace, Get-AzureRm…
Script     6.7.4                 AzureRM.Resources                   Desk      {Get-AzureRmProviderOperation, Remove-A…
Script     0.6.14                AzureRM.ServiceBus                  Desk      {New-AzureRmServiceBusNamespace, Get-Az…
Script     0.3.16                AzureRM.ServiceFabric               Desk      {Add-AzureRmServiceFabricApplicationCer…
Script     1.0.1                 AzureRM.SignalR                     Desk      {New-AzureRmSignalR, Get-AzureRmSignalR…
Script     4.12.2                AzureRM.Sql                         Desk      {Get-AzureRmSqlDatabaseTransparentDataE…
Script     5.2.1                 AzureRM.Storage                     Desk      {Get-AzureRmStorageAccount, Get-AzureRm…
Script     4.0.11                AzureRM.StreamAnalytics             Desk      {Get-AzureRmStreamAnalyticsFunction, Ge…
Script     4.0.6                 AzureRM.Tags                        Desk      {Remove-AzureRmTag, Get-AzureRmTag, New…
Script     4.1.4                 AzureRM.TrafficManager              Desk      {Add-AzureRmTrafficManagerCustomHeaderT…
Script     4.0.6                 AzureRM.UsageAggregates             Desk      Get-UsageAggregates
Script     5.2.1                 AzureRM.Websites                    Desk      {Get-AzureRmAppServicePlan, Set-AzureRm…
Script     6.2.0                 Indented.Net.IP                     Core,Desk {ConvertFrom-HexIP, ConvertTo-BinaryIP,…
Script     5.2.2                 Pester                              Desk      {Invoke-Pester, Describe, Context, It…}
Script     5.0.4                 Pester                              Desk      {Invoke-Pester, Describe, Context, It…}
Script     1.10.6                PipelineManager                     Desk      {New-PmConfiguration, Get-PmRequiredMod…
Script     2.2.5                 PowerShellGet                       Desk      {Find-Command, Find-DSCResource, Find-M…
Script     1.19.1                PSScriptAnalyzer                    Desk      {Get-ScriptAnalyzerRule, Invoke-ScriptA…
Binary     0.8.1                 SHiPS                               Desk
Script     0.0.2                 Trackyon.Utils                      Desk      {Backup-Location, Get-OperatingSystem, …
Script     7.2.0                 VSTeam                              Core,Desk {Add-VSTeam, Add-VSTeamAccessControlEnt…
Manifest   3.0.6                 VSTeam                              Desk      {Add-VSTeamAzureRMServiceEndpoint, Add-…

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

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Manifest   7.0.0.0               CimCmdlets                          Core      {Get-CimAssociatedInstance, Get-CimClas…
Manifest   1.2.5                 Microsoft.PowerShell.Archive        Desk      {Compress-Archive, Expand-Archive}
Manifest   7.0.0.0               Microsoft.PowerShell.Diagnostics    Core      {Get-WinEvent, New-WinEvent, Get-Counte…
Manifest   7.0.0.0               Microsoft.PowerShell.Host           Core      {Start-Transcript, Stop-Transcript}
Manifest   7.0.0.0               Microsoft.PowerShell.Management     Core      {Add-Content, Clear-Content, Get-Clipbo…
Manifest   7.0.0.0               Microsoft.PowerShell.Security       Core      {Get-Acl, Set-Acl, Get-PfxCertificate, …
Manifest   7.0.0.0               Microsoft.PowerShell.Utility        Core      {Export-Alias, Get-Alias, Import-Alias,…
Manifest   7.0.0.0               Microsoft.WSMan.Management          Core      {Disable-WSManCredSSP, Enable-WSManCred…
Script     1.4.7                 PackageManagement                   Desk      {Find-Package, Get-Package, Get-Package…
Script     2.2.5                 PowerShellGet                       Desk      {Find-Command, Find-DSCResource, Find-M…
Script     2.0.5                 PSDesiredStateConfiguration         Core      {Configuration, New-DscChecksum, Get-Ds…
Script     7.0.0.0               PSDiagnostics                       Core      {Disable-PSTrace, Disable-PSWSManCombin…
Script     2.1.0                 PSReadLine                          Desk      {Get-PSReadLineKeyHandler, Set-PSReadLi…
Binary     2.0.3                 ThreadJob                           Desk      Start-ThreadJob

    Directory: C:\Program Files\WindowsPowerShell\Modules

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Script     0.5.4                 Azure.AnalysisServices              Desk      {Add-AzureAnalysisServicesAccount, Rest…
Script     4.6.1                 Azure.Storage                       Desk      {Get-AzureStorageTable, New-AzureStorag…
Script     6.13.2                AzureRM                             Desk
Script     0.6.15                AzureRM.AnalysisServices            Desk      {Resume-AzureRmAnalysisServicesServer, …
Script     6.1.8                 AzureRM.ApiManagement               Desk      {Add-AzureRmApiManagementRegion, Get-Az…
Script     0.1.9                 AzureRM.ApplicationInsights         Desk      {Get-AzureRmApplicationInsights, New-Az…
Script     6.1.2                 AzureRM.Automation                  Desk      {Get-AzureRMAutomationHybridWorkerGroup…
Script     4.1.6                 AzureRM.Batch                       Desk      {Remove-AzureRmBatchAccount, Get-AzureR…
Script     0.14.7                AzureRM.Billing                     Desk      {Get-AzureRmBillingInvoice, Get-AzureRm…
Script     5.0.7                 AzureRM.Cdn                         Desk      {Get-AzureRmCdnProfile, Get-AzureRmCdnP…
Script     0.9.13                AzureRM.CognitiveServices           Desk      {Get-AzureRmCognitiveServicesAccount, G…
Script     5.9.2                 AzureRM.Compute                     Desk      {Remove-AzureRmAvailabilitySet, Get-Azu…
Script     0.3.8                 AzureRM.Consumption                 Desk      {Get-AzureRmConsumptionBudget, Get-Azur…
Script     0.2.13                AzureRM.ContainerInstance           Desk      {New-AzureRmContainerGroup, Get-AzureRm…
Script     1.0.11                AzureRM.ContainerRegistry           Desk      {New-AzureRmContainerRegistry, Get-Azur…
Script     5.0.4                 AzureRM.DataFactories               Desk      {Remove-AzureRmDataFactory, Get-AzureRm…
Script     0.5.12                AzureRM.DataFactoryV2               Desk      {Set-AzureRmDataFactoryV2, Update-Azure…
Script     5.1.5                 AzureRM.DataLakeAnalytics           Desk      {Get-AzureRmDataLakeAnalyticsDataSource…
Script     6.2.2                 AzureRM.DataLakeStore               Desk      {Get-AzureRmDataLakeStoreTrustedIdProvi…
Script     4.0.10                AzureRM.DevTestLabs                 Desk      {Get-AzureRmDtlAllowedVMSizesPolicy, Ge…
Script     5.1.1                 AzureRM.Dns                         Desk      {Get-AzureRmDnsRecordSet, New-AzureRmDn…
Script     0.3.8                 AzureRM.EventGrid                   Desk      {New-AzureRmEventGridTopic, Get-AzureRm…
Script     0.7.1                 AzureRM.EventHub                    Desk      {New-AzureRmEventHubNamespace, Get-Azur…
Script     4.1.9                 AzureRM.HDInsight                   Desk      {Get-AzureRmHDInsightJob, New-AzureRmHD…
Script     5.1.6                 AzureRM.Insights                    Desk      {Get-AzureRmMetricDefinition, Get-Azure…
Script     3.1.9                 AzureRM.IotHub                      Desk      {Add-AzureRmIotHubKey, Get-AzureRmIotHu…
Script     5.2.2                 AzureRM.KeyVault                    Desk      {Add-AzureKeyVaultCertificate, Update-A…
Script     4.1.5                 AzureRM.LogicApp                    Desk      {Get-AzureRmIntegrationAccountAgreement…
Script     0.18.6                AzureRM.MachineLearning             Desk      {Move-AzureRmMlCommitmentAssociation, G…
Script     0.2.8                 AzureRM.MarketplaceOrdering         Desk      {Get-AzureRmMarketplaceTerms, Set-Azure…
Script     0.10.5                AzureRM.Media                       Desk      {Sync-AzureRmMediaServiceStorageKeys, S…
Script     6.11.2                AzureRM.Network                     Desk      {Add-AzureRmApplicationGatewayAuthentic…
Script     5.0.4                 AzureRM.NotificationHubs            Desk      {Get-AzureRmNotificationHub, Get-AzureR…
Script     5.0.7                 AzureRM.OperationalInsights         Desk      {New-AzureRmOperationalInsightsAzureAct…
Script     1.1.1                 AzureRM.PolicyInsights              Desk      {Get-AzureRmPolicyEvent, Get-AzureRmPol…
Script     4.1.11                AzureRM.PowerBIEmbedded             Desk      {Remove-AzureRmPowerBIWorkspaceCollecti…
Script     5.8.4                 AzureRM.profile                     Desk      {Disable-AzureRmDataCollection, Disable…
Script     4.1.10                AzureRM.RecoveryServices            Desk      {Get-AzureRmRecoveryServicesBackupPrope…
Script     4.5.3                 AzureRM.RecoveryServices.Backup     Desk      {Backup-AzureRmRecoveryServicesBackupIt…
Script     0.2.13                AzureRM.RecoveryServices.SiteRecov… Desk      {Edit-AzureRmRecoveryServicesAsrRecover…
Script     5.1.1                 AzureRM.RedisCache                  Desk      {Remove-AzureRmRedisCachePatchSchedule,…
Script     0.3.13                AzureRM.Relay                       Desk      {New-AzureRmRelayNamespace, Get-AzureRm…
Script     6.7.4                 AzureRM.Resources                   Desk      {Get-AzureRmProviderOperation, Remove-A…
Script     0.6.14                AzureRM.ServiceBus                  Desk      {New-AzureRmServiceBusNamespace, Get-Az…
Script     0.3.16                AzureRM.ServiceFabric               Desk      {Add-AzureRmServiceFabricApplicationCer…
Script     1.0.1                 AzureRM.SignalR                     Desk      {New-AzureRmSignalR, Get-AzureRmSignalR…
Script     4.12.2                AzureRM.Sql                         Desk      {Get-AzureRmSqlDatabaseTransparentDataE…
Script     5.2.1                 AzureRM.Storage                     Desk      {Get-AzureRmStorageAccount, Get-AzureRm…
Script     4.0.11                AzureRM.StreamAnalytics             Desk      {Get-AzureRmStreamAnalyticsFunction, Ge…
Script     4.0.6                 AzureRM.Tags                        Desk      {Remove-AzureRmTag, Get-AzureRmTag, New…
Script     4.1.4                 AzureRM.TrafficManager              Desk      {Add-AzureRmTrafficManagerCustomHeaderT…
Script     4.0.6                 AzureRM.UsageAggregates             Desk      Get-UsageAggregates
Script     5.2.1                 AzureRM.Websites                    Desk      {Get-AzureRmAppServicePlan, Set-AzureRm…
Script     1.0.1                 Microsoft.PowerShell.Operation.Val… Desk      {Get-OperationValidation, Invoke-Operat…
Binary     1.0.0.1               PackageManagement                   Desk      {Find-Package, Get-Package, Get-Package…
Script     3.4.0                 Pester                              Desk      {Describe, Context, It, Should…}
Script     1.0.0.1               PowerShellGet                       Desk      {Install-Module, Find-Module, Save-Modu…
Script     2.0.0      beta2      PSReadline                          Desk      {Get-PSReadLineKeyHandler, Set-PSReadLi…
Binary     0.8.1                 SHiPS                               Desk
Manifest   3.0.6                 VSTeam                              Desk      {Add-VSTeamAzureRMServiceEndpoint, Add-…

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

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Manifest   1.0.0.0               AppBackgroundTask                   Core,Desk {Disable-AppBackgroundTaskDiagnosticLog…
Manifest   2.0.1.0               Appx                                Core,Desk {Add-AppxPackage, Get-AppxPackage, Get-…
Script     1.0.0.0               AssignedAccess                      Core,Desk {Clear-AssignedAccess, Get-AssignedAcce…
Manifest   1.0.0.0               BitLocker                           Core,Desk {Unlock-BitLocker, Suspend-BitLocker, R…
Manifest   1.0.0.0               BranchCache                         Core,Desk {Add-BCDataCacheExtension, Clear-BCCach…
Manifest   1.0                   Defender                            Core,Desk {Get-MpPreference, Set-MpPreference, Ad…
Manifest   1.0.2.0               DeliveryOptimization                Core,Desk {Delete-DeliveryOptimizationCache, Get-…
Manifest   1.0.0.0               DirectAccessClientComponents        Core,Desk {Disable-DAManualEntryPointSelection, E…
Script     3.0                   Dism                                Core,Desk {Add-AppxProvisionedPackage, Add-Window…
Manifest   1.0.0.0               DnsClient                           Core,Desk {Resolve-DnsName, Clear-DnsClientCache,…
Manifest   1.0.0.0               EventTracingManagement              Core,Desk {Start-EtwTraceSession, New-EtwTraceSes…
Manifest   2.0.0.0               International                       Core,Desk {Get-WinDefaultInputMethodOverride, Set…
Manifest   3.0.0.0               Microsoft.PowerShell.Diagnostics    Core,Desk {Get-WinEvent, Get-Counter, Import-Coun…
Manifest   1.0.0.0               Microsoft.PowerShell.LocalAccounts  Core,Desk {Add-LocalGroupMember, Disable-LocalUse…
Manifest   3.1.0.0               Microsoft.PowerShell.Management     Core,Desk {Add-Content, Clear-Content, Clear-Item…
Manifest   1.0                   MMAgent                             Core,Desk {Disable-MMAgent, Enable-MMAgent, Set-M…
Manifest   2.0.0.0               NetAdapter                          Core,Desk {Disable-NetAdapter, Disable-NetAdapter…
Manifest   1.0.0.0               NetConnection                       Core,Desk {Get-NetConnectionProfile, Set-NetConne…
Manifest   1.0.0.0               NetEventPacketCapture               Core,Desk {New-NetEventSession, Remove-NetEventSe…
Manifest   2.0.0.0               NetLbfo                             Core,Desk {Add-NetLbfoTeamMember, Add-NetLbfoTeam…
Manifest   1.0.0.0               NetNat                              Core,Desk {Get-NetNat, Get-NetNatExternalAddress,…
Manifest   2.0.0.0               NetQos                              Core,Desk {Get-NetQosPolicy, Set-NetQosPolicy, Re…
Manifest   2.0.0.0               NetSecurity                         Core,Desk {Get-DAPolicyChange, New-NetIPsecAuthPr…
Manifest   1.0.0.0               NetSwitchTeam                       Core,Desk {New-NetSwitchTeam, Remove-NetSwitchTea…
Manifest   1.0.0.0               NetTCPIP                            Core,Desk {Get-NetIPAddress, Get-NetIPInterface, …
Manifest   1.0.0.0               NetworkConnectivityStatus           Core,Desk {Get-DAConnectionStatus, Get-NCSIPolicy…
Manifest   1.0.0.0               NetworkSwitchManager                Core,Desk {Disable-NetworkSwitchEthernetPort, Ena…
Manifest   1.0.0.0               NetworkTransition                   Core,Desk {Add-NetIPHttpsCertBinding, Disable-Net…
Manifest   1.0.0.0               PcsvDevice                          Core,Desk {Get-PcsvDevice, Start-PcsvDevice, Stop…
Manifest   1.0.0.0               PnpDevice                           Core,Desk {Get-PnpDevice, Get-PnpDeviceProperty, …
Manifest   1.1                   PrintManagement                     Core,Desk {Add-Printer, Add-PrinterDriver, Add-Pr…
Binary     1.0.11                ProcessMitigations                  Core,Desk {Get-ProcessMitigation, Set-ProcessMiti…
Manifest   1.0.0.0               ScheduledTasks                      Core,Desk {Get-ScheduledTask, Set-ScheduledTask, …
Manifest   2.0.0.0               SecureBoot                          Core,Desk {Confirm-SecureBootUEFI, Set-SecureBoot…
Manifest   2.0.0.0               SmbShare                            Core,Desk {Get-SmbShare, Remove-SmbShare, Set-Smb…
Manifest   2.0.0.0               SmbWitness                          Core,Desk {Get-SmbWitnessClient, Move-SmbWitnessC…
Manifest   1.0.0.0               StartLayout                         Core,Desk {Export-StartLayout, Import-StartLayout…
Manifest   2.0.0.0               Storage                             Core,Desk {Add-InitiatorIdToMaskingSet, Add-Parti…
Manifest   1.0.0.0               TroubleshootingPack                 Core,Desk {Get-TroubleshootingPack, Invoke-Troubl…
Manifest   2.0.0.0               TrustedPlatformModule               Core,Desk {Get-Tpm, Initialize-Tpm, Clear-Tpm, Un…
Binary     2.1.639.0             UEV                                 Core,Desk
Manifest   2.0.0.0               VpnClient                           Core,Desk {Add-VpnConnection, Set-VpnConnection, …
Manifest   1.0.0.0               Wdac                                Core,Desk {Get-OdbcDriver, Set-OdbcDriver, Get-Od…
Manifest   2.0.0.0               Whea                                Core,Desk {Get-WheaMemoryPolicy, Set-WheaMemoryPo…
Manifest   1.0.0.0               WindowsDeveloperLicense             Core,Desk {Get-WindowsDeveloperLicense, Unregiste…
Script     1.0                   WindowsErrorReporting               Core,Desk {Enable-WindowsErrorReporting, Disable-…
Manifest   1.0.0.0               WindowsSearch                       Core,Desk {Get-WindowsSearchSetting, Set-WindowsS…
Manifest   1.0.0.0               WindowsUpdate                       Core,Desk Get-WindowsUpdateLog
Manifest   1.0.0.2               WindowsUpdateProvider               Core,Desk {Get-WUAVersion, Get-WULastInstallation…

    Directory: C:\Program Files (x86)\Microsoft Azure Information Protection\Powershell

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Binary     2.11.58.0             AzureInformationProtection          Desk

Debug output

DEBUG: 10:55:03 a.m. - SetAzureCognitiveServicesAccountCommand begin processing with ParameterSet 'CognitiveServicesEncryption'.
DEBUG: 10:55:03 a.m. - using account id '{{user_name}}'...
DEBUG: [Common.Authentication]: Authenticating using Account: '{{user_name}}', environment: 'AzureCloud', tenant: '{{tenant_id}}'
DEBUG: 10:55:03 a.m. - [SilentAuthenticator] Calling SharedTokenCacheCredential.GetTokenAsync - TenantId:'{{tenant_id}}', Scopes:'https://management.core.windows.net//.default', AuthorityHost:'https://login.microsoftonline.com/', UserId:'{{user_name}}'
DEBUG: SharedTokenCacheCredential.GetToken invoked. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId:
DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.18363 [07/26/2021 22:55:03 - ] Azure region was not configured or could not be discovered. Not using a regional authority.
DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.18363 [07/26/2021 22:55:03] Found 1 cache accounts and 0 broker accounts
DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.18363 [07/26/2021 22:55:03] Returning 1 accounts
DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.18363 [07/26/2021 22:55:03 - ] MSAL MSAL.NetCore with assembly version '4.30.1.0'. CorrelationId(f8109b29-9420-4fa8-96c1-7098b80822f5)
DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.18363 [07/26/2021 22:55:03 - ] === AcquireTokenSilent Parameters ===
DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.18363 [07/26/2021 22:55:03 - ] LoginHint provided: False
DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.18363 [07/26/2021 22:55:03 - ] Account provided: True
DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.18363 [07/26/2021 22:55:03 - ] ForceRefresh: False
DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.18363 [07/26/2021 22:55:03 - ]
=== Request Data ===
Authority Provided? - True
Scopes - https://management.core.windows.net//.default
Extra Query Params Keys (space separated) -
ApiId - AcquireTokenSilent
IsConfidentialClient - False
SendX5C - False
LoginHint ? False
IsBrokerConfigured - False
HomeAccountId - False
CorrelationId - f8109b29-9420-4fa8-96c1-7098b80822f5

DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.18363 [07/26/2021 22:55:03 - ] === Token Acquisition (SilentRequest) started:

        Authority Host: login.microsoftonline.com
DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.18363 [07/26/2021 22:55:03 - ] Azure region was not configured or could not be discovered. Not using a regional authority.
DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.18363 [07/26/2021 22:55:03 - ] Access token is not expired. Returning the found cache entry. [Current time (07/26/2021 22:55:03) - Expiration Time (07/26/2021 23:05:26 +00:00) - Extended Expiration Time (07/26/2021 23:05:26 +00:00)]
DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.18363 [07/26/2021 22:55:03 - ] Returning access token found in cache. RefreshOn exists ? False
DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.18363 [07/26/2021 22:55:03 - ] Fetched access token from host login.microsoftonline.com.
DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.18363 [07/26/2021 22:55:03 - ] === Token Acquisition finished successfully. An access token was returned with Expiration Time: 07/26/2021 23:05:26 +00:00 and Scopes https://management.core.windows.net//user_impersonation https://management.core.windows.net//.default
DEBUG: SharedTokenCacheCredential.GetToken succeeded. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId:  ExpiresOn: 2021-07-26T23:05:26.0000000+00:00
DEBUG: [Common.Authentication]: Received token with LoginType 'User', Tenant: '{{tenant_id}}', UserId: '{{user_name}}'
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
PATCH

Absolute Uri:
https://management.azure.com/subscriptions/{{subscription_id}}/resourceGroups/{{rg_name}}/providers/Microsoft.CognitiveServices/accounts/{{cog_account_name}}?api-version=2017-04-18

Headers:
x-ms-client-request-id        : 1f68ad3d-ddd9-4238-b265-e6952bcf5ad5
Accept-Language               : en-US

Body:
{
  "properties": {},
  "sku": {
    "name": "S0"
  },
  "tags": {}
}

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

Status Code:
OK

Headers:
Cache-Control                 : no-cache
Pragma                        : no-cache
ETag                          : "05001263-0000-1a00-0000-60ff3d580000"
X-Content-Type-Options        : nosniff
x-ms-request-id               : 9bfe5173-bc28-497c-a3cc-7e32ebfa6777
x-envoy-upstream-service-time : 36
Server                        : istio-envoy
x-ms-ratelimit-remaining-subscription-writes: 1198
x-ms-correlation-request-id   : c9c1223c-9f92-4c6e-ad78-b27edf37884a
x-ms-routing-request-id       : AUSTRALIAEAST:20210726T225520Z:c9c1223c-9f92-4c6e-ad78-b27edf37884a
Strict-Transport-Security     : max-age=31536000; includeSubDomains
Date                          : Mon, 26 Jul 2021 22:55:19 GMT

Body:
{
  "id": "/subscriptions/{{subscription_id}}/resourceGroups/{{rg_name}}/providers/Microsoft.CognitiveServices/accounts/{{cog_account_name}}",
  "name": "{{cog_account_name}}",
  "type": "Microsoft.CognitiveServices/accounts",
  "etag": "\"05001263-0000-1a00-0000-60ff3d580000\"",
  "location": "Australia East",
  "sku": {
    "name": "S0"
  },
  "kind": "LUIS",
  "tags": {},
  "properties": {
    "endpoint": "https://australiaeast.api.cognitive.microsoft.com/",
    "provisioningState": "Succeeded",
    "internalId": "92c6de10342d4b99a7cc245f368f17a3",
    "dateCreated": "2021-07-26T22:52:24.2955592Z",
    "backupUpperLimit": 0,
    "privateEndpointConnections": [],
    "publicNetworkAccess": "Enabled",
    "capabilities": [
      {
        "name": "VirtualNetworks"
      },
      {
        "name": "Container",
        "value": "LUIS.LUIS"
      }
    ]
  }
}

DEBUG: AzureQoSEvent: CommandName - Set-AzCognitiveServicesAccount; IsSuccess - True; Duration - 00:00:00.5245139
DEBUG: Finish sending metric.
DEBUG: 10:55:04 a.m. - SetAzureCognitiveServicesAccountCommand end processing.
KranthiPakala-MSFT commented 2 years ago

@rink72 Apologies for the delayed response and thanks for bringing this to our notice. We will loop relevant owners to have a look into this issue.

Thanks again for reporting this.

RakeshMohanMSFT commented 2 years ago

@rink72 can you please try adding tags like this? $tags = @(@{"Name"="Dept";"Value"="Finance";},@{"Name"="Status"; "Value"="Normal";})

rink72 commented 2 years ago

@RakeshMohanMSFT , that appears to work and apply tags. However, we apply tags to many other resources and this is not how any other Az cmdlets seem to work with the tag parameter?

Also, I was testing using it how we were originally trying to and this actually reverted tags which doesn't seem correct at all. Steps to reproduce below: