Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.24k stars 3.84k forks source link

Tags passed as parameters to New-AzDeployment and New-AzResourceGroupDeployment deployment have their initial character case change #15876

Closed ChristopherGLewis closed 2 years ago

ChristopherGLewis commented 3 years ago

Description

Tags passed as parameters to New-AzDeployment and New-AzResourceGroupDeployment deployment have their initial character case change

Tag case gets changed in those two commandlets

Steps to reproduce

Bicep file:

targetScope = 'subscription'
param tags object = {}
resource rgTest 'Microsoft.Resources/resourceGroups@2020-06-01' = {
  name: 'rgTest'
  location: 'central us'
  tags: tags
}

ARM:

{
  "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "metadata": {
    "_generator": {
      "name": "bicep",
      "version": "0.4.613.9944",
      "templateHash": "10140413462284698591"
    }
  },
  "parameters": {
    "tags": {
      "type": "object",
      "defaultValue": {}
    }
  },
  "functions": [],
  "resources": [
    {
      "type": "Microsoft.Resources/resourceGroups",
      "apiVersion": "2020-06-01",
      "name": "rgTest",
      "location": "central us",
      "tags": "[parameters('tags')]"
    }
  ]
}

Parameter file

{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "tags": {
            "value": {
                "ALL_CAPS": "ALL_CAPS",
                "all_lower": "all_lower",
                "Mixed_Case": "Mixed_Case"
            }
        }
    }
}
c:> New-AzDeployment -Name test -Location 'Central us' -TemplateFile .\TagTest.json -TemplateParameterFile .\TagTest.parameters.json

Id                      : /subscriptions/11-22-33-44/providers/Microsoft.Resources/deployments/test
DeploymentName          : test
Location                : centralus
ProvisioningState       : Succeeded
Timestamp               : 9/14/2021 3:55:51 PM
Mode                    : Incremental
TemplateLink            :
Parameters              :
                          Name             Type                       Value
                          ===============  =========================  ==========
                          tags             Object                     {
                            "alL_CAPS": "ALL_CAPS",
                            "all_lower": "all_lower",
                            "mixed_Case": "Mixed_Case"
                          }

Outputs                 :
DeploymentDebugLogLevel :

c:> Get-AzResourceGroup rgtest

ResourceGroupName : rgTest
Location          : centralus
ProvisioningState : Succeeded
Tags              :
                    Name        Value
                    ==========  ==========
                    all_lower   all_lower
                    mixed_Case  Mixed_Case
                    alL_CAPS    ALL_CAPS

ResourceId        : /subscriptions/11-22-33-44/resourceGroups/rgTest

Environment data

> $PSVersionTable

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

Module versions

> Get-Module  -ListAvailable | Where-Object { $_.name -like 'az*' }

    Directory: C:\Program Files\PowerShell\Modules

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Script     6.4.0                 Az                                  Core,Desk
Script     2.5.3                 Az.Accounts                         Core,Desk {Disable-AzDataCollection, Disable-AzContextAutosave, Enable-AzDataCollection, Enable-AzContextAutosave…}
Script     1.1.1                 Az.Advisor                          Core,Desk {Get-AzAdvisorRecommendation, Enable-AzAdvisorRecommendation, Disable-AzAdvisorRecommendation, Get-AzAdvisorConfiguratio… 
Script     2.4.0                 Az.Aks                              Core,Desk {Get-AzAksCluster, New-AzAksCluster, Remove-AzAksCluster, Import-AzAksCredential…}
Script     1.1.4                 Az.AnalysisServices                 Core,Desk {Resume-AzAnalysisServicesServer, Suspend-AzAnalysisServicesServer, Get-AzAnalysisServicesServer, Remove-AzAnalysisServi… 
Script     2.3.0                 Az.ApiManagement                    Core,Desk {Add-AzApiManagementApiToGateway, Add-AzApiManagementApiToProduct, Add-AzApiManagementProductToGroup, Add-AzApiManagemen… 
Script     1.0.0                 Az.AppConfiguration                 Core,Desk {Get-AzAppConfigurationStore, Get-AzAppConfigurationStoreKey, New-AzAppConfigurationStore, New-AzAppConfigurationStoreKe…
Script     1.2.0                 Az.ApplicationInsights              Core,Desk {Get-AzApplicationInsights, New-AzApplicationInsights, Remove-AzApplicationInsights, Update-AzApplicationInsights…}       
Script     1.7.1                 Az.Automation                       Core,Desk {Get-AzAutomationHybridWorkerGroup, Remove-AzAutomationHybridWorkerGroup, Get-AzAutomationJobOutputRecord, Import-AzAuto… 
Script     3.1.0                 Az.Batch                            Core,Desk {Remove-AzBatchAccount, Get-AzBatchAccount, Get-AzBatchAccountKey, New-AzBatchAccount…}
Script     2.0.0                 Az.Billing                          Core,Desk {Get-AzBillingInvoice, Get-AzBillingPeriod, Get-AzEnrollmentAccount, Get-AzConsumptionBudget…}
Script     1.8.0                 Az.Cdn                              Core,Desk {Get-AzCdnProfile, Get-AzCdnProfileSsoUrl, New-AzCdnProfile, Remove-AzCdnProfile…}
Script     1.9.0                 Az.CognitiveServices                Core,Desk {Get-AzCognitiveServicesAccount, Get-AzCognitiveServicesAccountKey, Get-AzCognitiveServicesAccountSku, Get-AzCognitiveSe… 
Script     4.17.0                Az.Compute                          Core,Desk {Remove-AzAvailabilitySet, Get-AzAvailabilitySet, New-AzAvailabilitySet, Update-AzAvailabilitySet…}
Script     2.1.0                 Az.ContainerInstance                Core,Desk {Add-AzContainerInstanceOutput, Get-AzContainerGroup, Get-AzContainerInstanceCachedImage, Get-AzContainerInstanceCapabil… 
Script     2.2.3                 Az.ContainerRegistry                Core,Desk {New-AzContainerRegistry, Get-AzContainerRegistry, Update-AzContainerRegistry, Remove-AzContainerRegistry…}
Script     1.3.1                 Az.CosmosDB                         Core,Desk {Get-AzCosmosDBSqlContainer, Get-AzCosmosDBSqlContainerThroughput, Get-AzCosmosDBSqlDatabase, Get-AzCosmosDBSqlDatabaseT… 
Script     1.1.0                 Az.DataBoxEdge                      Core,Desk {Get-AzDataBoxEdgeJob, Get-AzDataBoxEdgeDevice, Invoke-AzDataBoxEdgeDevice, New-AzDataBoxEdgeDevice…}
Script     1.1.0                 Az.Databricks                       Core,Desk {Get-AzDatabricksVNetPeering, Get-AzDatabricksWorkspace, New-AzDatabricksVNetPeering, New-AzDatabricksWorkspace…}
Script     1.14.0                Az.DataFactory                      Core,Desk {Set-AzDataFactoryV2, Update-AzDataFactoryV2, Get-AzDataFactoryV2, Remove-AzDataFactoryV2…}
Script     1.0.2                 Az.DataLakeAnalytics                Core,Desk {Get-AzDataLakeAnalyticsDataSource, New-AzDataLakeAnalyticsCatalogCredential, Remove-AzDataLakeAnalyticsCatalogCredentia… 
Script     1.3.0                 Az.DataLakeStore                    Core,Desk {Get-AzDataLakeStoreTrustedIdProvider, Remove-AzDataLakeStoreTrustedIdProvider, Remove-AzDataLakeStoreFirewallRule, Set-… 
Script     1.0.0                 Az.DataShare                        Core,Desk {New-AzDataShareAccount, Get-AzDataShareAccount, Remove-AzDataShareAccount, New-AzDataShare…}
Script     1.1.0                 Az.DeploymentManager                Core,Desk {Get-AzDeploymentManagerArtifactSource, New-AzDeploymentManagerArtifactSource, Set-AzDeploymentManagerArtifactSource, Re…
Script     3.0.0                 Az.DesktopVirtualization            Core,Desk {Disconnect-AzWvdUserSession, Expand-AzWvdMsixImage, Get-AzWvdApplication, Get-AzWvdApplicationGroup…}
Script     1.0.2                 Az.DevTestLabs                      Core,Desk {Get-AzDtlAllowedVMSizesPolicy, Get-AzDtlAutoShutdownPolicy, Get-AzDtlAutoStartPolicy, Get-AzDtlVMsPerLabPolicy…}
Script     1.1.2                 Az.Dns                              Core,Desk {Get-AzDnsRecordSet, New-AzDnsRecordConfig, Remove-AzDnsRecordSet, Set-AzDnsRecordSet…}
Script     1.3.0                 Az.EventGrid                        Core,Desk {New-AzEventGridTopic, Get-AzEventGridTopic, Set-AzEventGridTopic, New-AzEventGridTopicKey…}
Script     1.8.0                 Az.EventHub                         Core,Desk {New-AzEventHubNamespace, Get-AzEventHubNamespace, Set-AzEventHubNamespace, Remove-AzEventHubNamespace…}
Script     1.8.0                 Az.FrontDoor                        Core,Desk {New-AzFrontDoor, Get-AzFrontDoor, Set-AzFrontDoor, Remove-AzFrontDoor…}
Script     3.1.0                 Az.Functions                        Core,Desk {Get-AzFunctionApp, Get-AzFunctionAppAvailableLocation, Get-AzFunctionAppPlan, Get-AzFunctionAppSetting…}
Script     4.3.0                 Az.HDInsight                        Core,Desk {Get-AzHDInsightJob, New-AzHDInsightSqoopJobDefinition, Wait-AzHDInsightJob, New-AzHDInsightStreamingMapReduceJobDefinit…
Script     1.3.1                 Az.HealthcareApis                   Core,Desk {New-AzHealthcareApisService, Remove-AzHealthcareApisService, Set-AzHealthcareApisService, Get-AzHealthcareApisService}   
Script     2.7.3                 Az.IotHub                           Core,Desk {Add-AzIotHubKey, Get-AzIotHubEventHubConsumerGroup, Get-AzIotHubConnectionString, Get-AzIotHubJob…}
Script     3.5.0                 Az.KeyVault                         Core,Desk {Add-AzKeyVaultCertificate, Update-AzKeyVaultCertificate, Stop-AzKeyVaultCertificateOperation, Get-AzKeyVaultCertificate…
Script     2.0.0                 Az.Kusto                            Core,Desk {Add-AzKustoClusterLanguageExtension, Add-AzKustoDatabasePrincipal, Get-AzKustoAttachedDatabaseConfiguration, Get-AzKust…
Script     1.5.0                 Az.LogicApp                         Core,Desk {Get-AzIntegrationAccountAgreement, Get-AzIntegrationAccountAssembly, Get-AzIntegrationAccountBatchConfiguration, Get-Az… 
Script     1.1.3                 Az.MachineLearning                  Core,Desk {Move-AzMlCommitmentAssociation, Get-AzMlCommitmentAssociation, Get-AzMlCommitmentPlanUsageHistory, Remove-AzMlCommitmen… 
Script     1.1.1                 Az.Maintenance                      Core,Desk {Get-AzApplyUpdate, Get-AzConfigurationAssignment, Get-AzMaintenanceConfiguration, Get-AzMaintenanceUpdate…}
Script     2.0.0                 Az.ManagedServices                  Core,Desk {Get-AzManagedServicesAssignment, New-AzManagedServicesAssignment, Remove-AzManagedServicesAssignment, Get-AzManagedServ… 
Script     1.0.2                 Az.MarketplaceOrdering              Core,Desk {Get-AzMarketplaceTerms, Set-AzMarketplaceTerms}
Script     1.1.1                 Az.Media                            Core,Desk {Sync-AzMediaServiceStorageKey, Set-AzMediaServiceKey, Get-AzMediaServiceKey, Get-AzMediaServiceNameAvailability…}        
Script     1.1.1                 Az.Migrate                          Core,Desk {Get-AzMigrateDiscoveredServer, Get-AzMigrateJob, Get-AzMigrateProject, Get-AzMigrateReplicationEligibilityResult…}       
Script     2.7.0                 Az.Monitor                          Core,Desk {Get-AzMetricDefinition, Get-AzMetric, Remove-AzLogProfile, Get-AzLogProfile…}
Script     4.11.0                Az.Network                          Core,Desk {Add-AzApplicationGatewayAuthenticationCertificate, Get-AzApplicationGatewayAuthenticationCertificate, New-AzApplication… 
Script     1.1.1                 Az.NotificationHubs                 Core,Desk {Get-AzNotificationHub, Get-AzNotificationHubAuthorizationRule, Get-AzNotificationHubListKey, Get-AzNotificationHubPNSCr… 
Script     2.3.0                 Az.OperationalInsights              Core,Desk {New-AzOperationalInsightsAzureActivityLogDataSource, New-AzOperationalInsightsCustomLogDataSource, Disable-AzOperationa… 
Script     1.4.1                 Az.PolicyInsights                   Core,Desk {Get-AzPolicyEvent, Get-AzPolicyState, Get-AzPolicyStateSummary, Get-AzPolicyRemediation…}
Script     1.1.2                 Az.PowerBIEmbedded                  Core,Desk {Remove-AzPowerBIWorkspaceCollection, Get-AzPowerBIWorkspaceCollection, Get-AzPowerBIWorkspaceCollectionAccessKey, Get-A… 
Script     1.0.3                 Az.PrivateDns                       Core,Desk {Get-AzPrivateDnsZone, Remove-AzPrivateDnsZone, Set-AzPrivateDnsZone, New-AzPrivateDnsZone…}
Script     4.6.0                 Az.RecoveryServices                 Core,Desk {Get-AzRecoveryServicesBackupProperty, Get-AzRecoveryServicesVault, Get-AzRecoveryServicesVaultSettingsFile, New-AzRecov… 
Script     1.5.0                 Az.RedisCache                       Core,Desk {Remove-AzRedisCachePatchSchedule, New-AzRedisCacheScheduleEntry, Get-AzRedisCachePatchSchedule, New-AzRedisCachePatchSc…
Script     1.0.0                 Az.RedisEnterpriseCache             Core,Desk {Export-AzRedisEnterpriseCache, Get-AzRedisEnterpriseCache, Get-AzRedisEnterpriseCacheDatabase, Get-AzRedisEnterpriseCac…
Script     1.0.3                 Az.Relay                            Core,Desk {New-AzRelayNamespace, Get-AzRelayNamespace, Set-AzRelayNamespace, Remove-AzRelayNamespace…}
Script     1.0.0                 Az.ResourceMover                    Core,Desk {Add-AzResourceMoverMoveResource, Get-AzResourceMoverMoveCollection, Get-AzResourceMoverMoveResource, Get-AzResourceMove… 
Script     4.3.1                 Az.Resources                        Core,Desk {Get-AzProviderOperation, Remove-AzRoleAssignment, Get-AzRoleAssignment, New-AzRoleAssignment…}
Script     1.0.0                 Az.Security                         Core,Desk {Get-AzSecurityAlert, Set-AzSecurityAlert, Get-AzSecurityAutoProvisioningSetting, Set-AzSecurityAutoProvisioningSetting…}
Script     1.1.0                 Az.SecurityInsights                 Core,Desk {Get-AzSentinelAlertRuleAction, New-AzSentinelAlertRuleAction, Remove-AzSentinelAlertRuleAction, Update-AzSentinelAlertR… 
Script     1.5.0                 Az.ServiceBus                       Core,Desk {New-AzServiceBusNamespace, Get-AzServiceBusNamespace, Set-AzServiceBusNamespace, Remove-AzServiceBusNamespace…}
Script     3.0.1                 Az.ServiceFabric                    Core,Desk {Add-AzServiceFabricClientCertificate, Add-AzServiceFabricNode, Add-AzServiceFabricNodeType, Get-AzServiceFabricCluster…}
Script     1.3.0                 Az.SignalR                          Core,Desk {New-AzSignalR, Get-AzSignalR, Get-AzSignalRKey, New-AzSignalRKey…}
Script     3.5.0                 Az.Sql                              Core,Desk {Get-AzSqlDatabaseTransparentDataEncryption, Get-AzSqlDatabaseTransparentDataEncryptionActivity, Set-AzSqlDatabaseTransp…
Script     1.1.0                 Az.SqlVirtualMachine                Core,Desk {New-AzSqlVM, Get-AzSqlVM, Update-AzSqlVM, Remove-AzSqlVM…}
Script     3.11.0                Az.Storage                          Core,Desk {Get-AzStorageAccount, Get-AzStorageAccountKey, New-AzStorageAccount, New-AzStorageAccountKey…}
Script     1.6.0                 Az.StorageSync                      Core,Desk {Invoke-AzStorageSyncCompatibilityCheck, New-AzStorageSyncService, Get-AzStorageSyncService, Set-AzStorageSyncService…}
Script     2.0.0                 Az.StreamAnalytics                  Core,Desk {Get-AzStreamAnalyticsCluster, Get-AzStreamAnalyticsClusterStreamingJob, Get-AzStreamAnalyticsDefaultFunctionDefinition,… 
Script     1.0.0                 Az.Support                          Core,Desk {Get-AzSupportService, Get-AzSupportProblemClassification, Get-AzSupportTicket, Get-AzSupportTicketCommunication…}
Script     1.0.4                 Az.TrafficManager                   Core,Desk {Add-AzTrafficManagerCustomHeaderToEndpoint, Remove-AzTrafficManagerCustomHeaderFromEndpoint, Add-AzTrafficManagerCustom… 
Script     2.8.2                 Az.Websites                         Core,Desk {Get-AzAppServicePlan, Set-AzAppServicePlan, New-AzAppServicePlan, Remove-AzAppServicePlan…}

Debug output

>  New-AzDeployment -Name test -Location 'Central us' -TemplateFile .\TagTest.json -TemplateParameterFile .\TagTest.parameters.json -Debug    

DEBUG: 11:05:03 AM - NewAzureSubscriptionDeploymentCmdlet begin processing with ParameterSet 'ByTemplateFileAndParameterFile'.
DEBUG: 11:05:03 AM - using account id 'user@sample.com'...
Confirm
Are you sure you want to perform this action?

[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Yes"): y
DEBUG: [Common.Authentication]: Authenticating using Account: 'user@sample.com', environment: 'AzureCloud', tenant: '11-22-33-44-55'
DEBUG: 11:05:09 AM - [SilentAuthenticator] Calling SharedTokenCacheCredential.GetTokenAsync - TenantId:'11-22-33-44-55', Scopes:'https://management.core.windows.net//.default', AuthorityHost:'https://login.microsoftonline.com/', UserId:'user@sample.com'
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.19043 [09/14/2021 16:05:09 - ] 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.19043 [09/14/2021 16:05:09] Found 5 cache accounts and 0 broker accounts
DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.19043 [09/14/2021 16:05:09] Returning 5 accounts
DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.19043 [09/14/2021 16:05:09 - ] MSAL MSAL.NetCore with assembly version '4.30.1.0'. CorrelationId(37af88f4-4860-4eec-be0a-064a68872a01)  
DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.19043 [09/14/2021 16:05:09 - ] === AcquireTokenSilent Parameters ===
DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.19043 [09/14/2021 16:05:09 - ] LoginHint provided: False
DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.19043 [09/14/2021 16:05:09 - ] Account provided: True
DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.19043 [09/14/2021 16:05:09 - ] ForceRefresh: False
DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.19043 [09/14/2021 16:05:09 - ]
=== 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 - 37af88f4-4860-4eec-be0a-064a68872a01

DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.19043 [09/14/2021 16:05:09 - ] === Token Acquisition (SilentRequest) started:

        Authority Host: login.microsoftonline.com
DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.19043 [09/14/2021 16:05:09 - ] 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.19043 [09/14/2021 16:05:09 - ] Access token is not expired. Returning the found cache entry. [Current time (09/14/2021 16:05:09) - Expiration Time (09/14/2021 16:55:18 +00:00) - Extended Expiration Time (09/14/2021 16:55:18 +00:00)]
DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.19043 [09/14/2021 16:05:09 - ] Returning access token found in cache. RefreshOn exists ? False
DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.19043 [09/14/2021 16:05:09 - ] Fetched access token from host login.microsoftonline.com.
DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.19043 [09/14/2021 16:05:09 - ] === Token Acquisition finished successfully. An access token was returned with Expiration Time: 09/14/2021 16:55:18 +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-09-14T16:55:18.0000000+00:00
DEBUG: [Common.Authentication]: Received token with LoginType 'User', Tenant: '11-22-33-44-55', UserId: 'user@sample.com'
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
POST

Absolute Uri:
https://management.azure.com/subscriptions/11-22-33-44/providers/Microsoft.Resources/deployments/test/validate?api-version=2021-04-01

Headers:
x-ms-client-request-id        : 11-22-33-44
Accept-Language               : en-US

Body:
{
  "location": "Central us",
  "properties": {
    "template": {
      "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
      "contentVersion": "1.0.0.0",
      "metadata": {
        "_generator": {
          "name": "bicep",
          "version": "0.4.613.9944",
          "templateHash": "10140413462284698591"
        }
      },
      "parameters": {
        "tags": {
          "type": "object",
          "defaultValue": {}
        }
      },
      "functions": [],
      "resources": [
        {
          "type": "Microsoft.Resources/resourceGroups",
          "apiVersion": "2020-06-01",
          "name": "rgTest",
          "location": "central us",
          "tags": "[parameters('tags')]"
        }
      ]
    },
    "parameters": {
      "tags": {
        "value": {
          "alL_CAPS": "ALL_CAPS",
          "all_lower": "all_lower",
          "mixed_Case": "Mixed_Case"
        }
      }
    },
    "mode": "Incremental"
  }
}

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

Status Code:
OK

Headers:
Cache-Control                 : no-cache
Pragma                        : no-cache
x-ms-ratelimit-remaining-subscription-writes: 1199
x-ms-request-id               : 0b06d6af-f68e-417e-9ac1-2cd4b5a641bc
x-ms-correlation-request-id   : 0b06d6af-f68e-417e-9ac1-2cd4b5a641bc
x-ms-routing-request-id       : NORTHCENTRALUS:20210914T160509Z:0b06d6af-f68e-417e-9ac1-2cd4b5a641bc
Strict-Transport-Security     : max-age=31536000; includeSubDomains
X-Content-Type-Options        : nosniff
Date                          : Tue, 14 Sep 2021 16:05:08 GMT

Body:
{
  "id": "/subscriptions/11-22-33-44/providers/Microsoft.Resources/deployments/test",
  "name": "test",
  "type": "Microsoft.Resources/deployments",
  "location": "centralus",
  "properties": {
    "templateHash": "10140413462284698591",
    "parameters": {
      "tags": {
        "type": "Object",
        "value": {
          "alL_CAPS": "ALL_CAPS",
          "all_lower": "all_lower",
          "mixed_Case": "Mixed_Case"
        }
      }
    },
    "mode": "Incremental",
    "provisioningState": "Succeeded",
    "timestamp": "2021-09-14T16:05:09.3690598Z",
    "duration": "PT0S",
    "correlationId": "0b06d6af-f68e-417e-9ac1-2cd4b5a641bc",
    "providers": [
      {
        "namespace": "Microsoft.Resources",
        "resourceTypes": [
          {
            "resourceType": "resourceGroups",
            "locations": [
              "centralus"
            ]
          }
        ]
      }
    ],
    "dependencies": [],
    "validatedResources": [
      {
        "id": "/subscriptions/11-22-33-44/resourceGroups/rgTest"
      }
    ]
  }
}

VERBOSE: 11:05:09 AM - Template is valid.
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Yes"): y
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
PUT

Absolute Uri:
https://management.azure.com/subscriptions/11-22-33-44/providers/Microsoft.Resources/deployments/test?api-version=2021-04-01

Headers:
x-ms-client-request-id        : 11-22-33-44
Accept-Language               : en-US

Body:
{
  "location": "Central us",
  "properties": {
    "template": {
      "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
      "contentVersion": "1.0.0.0",
      "metadata": {
        "_generator": {
          "name": "bicep",
          "version": "0.4.613.9944",
          "templateHash": "10140413462284698591"
        }
      },
      "parameters": {
        "tags": {
          "type": "object",
          "defaultValue": {}
        }
      },
      "functions": [],
      "resources": [
        {
          "type": "Microsoft.Resources/resourceGroups",
          "apiVersion": "2020-06-01",
          "name": "rgTest",
          "location": "central us",
          "tags": "[parameters('tags')]"
        }
      ]
    },
    "parameters": {
      "tags": {
        "value": {
          "alL_CAPS": "ALL_CAPS",
          "all_lower": "all_lower",
          "mixed_Case": "Mixed_Case"
        }
      }
    },
    "mode": "Incremental"
  }
}

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

Status Code:
OK

Headers:
Cache-Control                 : no-cache
Pragma                        : no-cache
Azure-AsyncOperation          : https://management.azure.com/subscriptions/11-22-33-44/providers/Microsoft.Resources/deployments/test/operationStatuses/08585699713747816395?api-version=2021-04-01
x-ms-ratelimit-remaining-subscription-writes: 1199
x-ms-request-id               : cab678b4-8615-4e3f-9343-b12acd3ef4e6
x-ms-correlation-request-id   : cab678b4-8615-4e3f-9343-b12acd3ef4e6
x-ms-routing-request-id       : NORTHCENTRALUS:20210914T160511Z:cab678b4-8615-4e3f-9343-b12acd3ef4e6
Strict-Transport-Security     : max-age=31536000; includeSubDomains
X-Content-Type-Options        : nosniff
Date                          : Tue, 14 Sep 2021 16:05:10 GMT

Body:
{
  "id": "/subscriptions/11-22-33-44/providers/Microsoft.Resources/deployments/test",
  "name": "test",
  "type": "Microsoft.Resources/deployments",
  "location": "centralus",
  "properties": {
    "templateHash": "10140413462284698591",
    "parameters": {
      "tags": {
        "type": "Object",
        "value": {
          "alL_CAPS": "ALL_CAPS",
          "all_lower": "all_lower",
          "mixed_Case": "Mixed_Case"
        }
      }
    },
    "mode": "Incremental",
    "provisioningState": "Accepted",
    "timestamp": "2021-09-14T16:05:11.1148573Z",
    "duration": "PT0.4188776S",
    "correlationId": "cab678b4-8615-4e3f-9343-b12acd3ef4e6",
    "providers": [
      {
        "namespace": "Microsoft.Resources",
        "resourceTypes": [
          {
            "resourceType": "resourceGroups",
            "locations": [
              "centralus"
            ]
          }
        ]
      }
    ],
    "dependencies": []
  }
}

VERBOSE: 11:05:11 AM - Create template deployment 'test'
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Yes"): y
VERBOSE: 11:05:12 AM - Checking deployment status in 5 seconds
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Yes"): y
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://management.azure.com/subscriptions/11-22-33-44/providers/Microsoft.Resources/deployments/test/operations?api-version=2021-04-01

Headers:
x-ms-client-request-id        : 11-22-33-44
Accept-Language               : en-US

Body:

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

Status Code:
OK

Headers:
Cache-Control                 : no-cache
Pragma                        : no-cache
x-ms-ratelimit-remaining-subscription-reads: 11999
x-ms-request-id               : daca6d9a-3104-4fe4-8ac0-87a4c98b78db
x-ms-correlation-request-id   : daca6d9a-3104-4fe4-8ac0-87a4c98b78db
x-ms-routing-request-id       : NORTHCENTRALUS:20210914T160518Z:daca6d9a-3104-4fe4-8ac0-87a4c98b78db
Strict-Transport-Security     : max-age=31536000; includeSubDomains
X-Content-Type-Options        : nosniff
Date                          : Tue, 14 Sep 2021 16:05:18 GMT

Body:
{
  "value": [
    {
      "id": "/subscriptions/11-22-33-44/providers/Microsoft.Resources/deployments/test/operations/210D8C630275C413",
      "operationId": "210D8C630275C413",
      "properties": {
        "provisioningOperation": "Create",
        "provisioningState": "Succeeded",
        "timestamp": "2021-09-14T16:05:11.9954639Z",
        "duration": "PT0.6044729S",
        "trackingId": "2a8d284c-d73e-4e9a-a99a-85eb09f98ee2",
        "serviceRequestId": "e0505f25-3c80-46c8-a379-f1dc7e43c6ba",
        "statusCode": "Created",
        "targetResource": {
          "id": "/subscriptions/11-22-33-44/resourceGroups/rgTest",
          "resourceType": "Microsoft.Resources/resourceGroups",
          "resourceName": "rgTest"
        }
      }
    },
    {
      "id": "/subscriptions/11-22-33-44/providers/Microsoft.Resources/deployments/test/operations/08585699713747816395",
      "operationId": "08585699713747816395",
      "properties": {
        "provisioningOperation": "EvaluateDeploymentOutput",
        "provisioningState": "Succeeded",
        "timestamp": "2021-09-14T16:05:12.0754242Z",
        "duration": "PT0.6844332S",
        "trackingId": "902a65d4-0e5b-4d60-aed9-b68704e549c0",
        "statusCode": "OK"
      }
    }
  ]
}

VERBOSE: 11:05:18 AM - Resource Microsoft.Resources/resourceGroups 'rgTest' provisioning status is succeeded
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Yes"): y
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://management.azure.com/subscriptions/11-22-33-44/providers/Microsoft.Resources/deployments/test?api-version=2021-04-01

Headers:
x-ms-client-request-id        : 11-22-33-44
Accept-Language               : en-US

Body:

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

Status Code:
OK

Headers:
Cache-Control                 : no-cache
Pragma                        : no-cache
x-ms-ratelimit-remaining-subscription-reads: 11998
x-ms-request-id               : 0a2a1143-8a1b-4aa7-84ac-1e9903a9c787
x-ms-correlation-request-id   : 0a2a1143-8a1b-4aa7-84ac-1e9903a9c787
x-ms-routing-request-id       : NORTHCENTRALUS:20210914T160519Z:0a2a1143-8a1b-4aa7-84ac-1e9903a9c787
Strict-Transport-Security     : max-age=31536000; includeSubDomains
X-Content-Type-Options        : nosniff
Date                          : Tue, 14 Sep 2021 16:05:19 GMT

Body:
{
  "id": "/subscriptions/11-22-33-44/providers/Microsoft.Resources/deployments/test",
  "name": "test",
  "type": "Microsoft.Resources/deployments",
  "location": "centralus",
  "properties": {
    "templateHash": "10140413462284698591",
    "parameters": {
      "tags": {
        "type": "Object",
        "value": {
          "alL_CAPS": "ALL_CAPS",
          "all_lower": "all_lower",
          "mixed_Case": "Mixed_Case"
        }
      }
    },
    "mode": "Incremental",
    "provisioningState": "Succeeded",
    "timestamp": "2021-09-14T16:05:12.1033208Z",
    "duration": "PT1.4073411S",
    "correlationId": "cab678b4-8615-4e3f-9343-b12acd3ef4e6",
    "providers": [
      {
        "namespace": "Microsoft.Resources",
        "resourceTypes": [
          {
            "resourceType": "resourceGroups",
            "locations": [
              "centralus"
            ]
          }
        ]
      }
    ],
    "dependencies": [],
    "outputResources": [
      {
        "id": "/subscriptions/11-22-33-44/resourceGroups/rgTest"
      }
    ]
  }
}

Id                      : /subscriptions/11-22-33-44/providers/Microsoft.Resources/deployments/test
DeploymentName          : test
Location                : centralus
ProvisioningState       : Succeeded
Timestamp               : 9/14/2021 4:05:12 PM
Mode                    : Incremental
TemplateLink            :
Parameters              :
                          Name             Type                       Value
                          ===============  =========================  ==========
                          tags             Object                     {
                            "alL_CAPS": "ALL_CAPS",
                            "all_lower": "all_lower",
                            "mixed_Case": "Mixed_Case"
                          }

Outputs                 :
DeploymentDebugLogLevel :

DEBUG: AzureQoSEvent: Module: Az.Resources:4.3.1; CommandName: New-AzDeployment; PSVersion: 7.1.4; IsSuccess: True; Duration: 00:00:15.8460269
DEBUG: Finish sending metric.
DEBUG: 11:05:20 AM - NewAzureSubscriptionDeploymentCmdlet end processing.

DEBUG: Setting WindowTitle: vNet-Bicep [main] - PowerShell 7.1 (102208)
c:\ > 

Error output

No Error
ghost commented 3 years ago

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

Issue Details
## Description Tags passed as parameters to New-AzDeployment and New-AzResourceGroupDeployment deployment have their initial character case change Tag case gets changed in those two commandlets ## Steps to reproduce Bicep file: ``` bicep targetScope = 'subscription' param tags object = {} resource rgTest 'Microsoft.Resources/resourceGroups@2020-06-01' = { name: 'rgTest' location: 'central us' tags: tags } ``` ARM: ``` json { "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.4.613.9944", "templateHash": "10140413462284698591" } }, "parameters": { "tags": { "type": "object", "defaultValue": {} } }, "functions": [], "resources": [ { "type": "Microsoft.Resources/resourceGroups", "apiVersion": "2020-06-01", "name": "rgTest", "location": "central us", "tags": "[parameters('tags')]" } ] } ``` Parameter file ``` json { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", "contentVersion": "1.0.0.0", "parameters": { "tags": { "value": { "ALL_CAPS": "ALL_CAPS", "all_lower": "all_lower", "Mixed_Case": "Mixed_Case" } } } } ``` ```powershell c:> New-AzDeployment -Name test -Location 'Central us' -TemplateFile .\TagTest.json -TemplateParameterFile .\TagTest.parameters.json Id : /subscriptions/11-22-33-44/providers/Microsoft.Resources/deployments/test DeploymentName : test Location : centralus ProvisioningState : Succeeded Timestamp : 9/14/2021 3:55:51 PM Mode : Incremental TemplateLink : Parameters : Name Type Value =============== ========================= ========== tags Object { "alL_CAPS": "ALL_CAPS", "all_lower": "all_lower", "mixed_Case": "Mixed_Case" } Outputs : DeploymentDebugLogLevel : c:> Get-AzResourceGroup rgtest ResourceGroupName : rgTest Location : centralus ProvisioningState : Succeeded Tags : Name Value ========== ========== all_lower all_lower mixed_Case Mixed_Case alL_CAPS ALL_CAPS ResourceId : /subscriptions/11-22-33-44/resourceGroups/rgTest ``` ## Environment data ``` > $PSVersionTable Name Value ---- ----- PSVersion 7.1.4 PSEdition Core GitCommitId 7.1.4 OS Microsoft Windows 10.0.19043 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 > Get-Module -ListAvailable | Where-Object { $_.name -like 'az*' } Directory: C:\Program Files\PowerShell\Modules ModuleType Version PreRelease Name PSEdition ExportedCommands ---------- ------- ---------- ---- --------- ---------------- Script 6.4.0 Az Core,Desk Script 2.5.3 Az.Accounts Core,Desk {Disable-AzDataCollection, Disable-AzContextAutosave, Enable-AzDataCollection, Enable-AzContextAutosave…} Script 1.1.1 Az.Advisor Core,Desk {Get-AzAdvisorRecommendation, Enable-AzAdvisorRecommendation, Disable-AzAdvisorRecommendation, Get-AzAdvisorConfiguratio… Script 2.4.0 Az.Aks Core,Desk {Get-AzAksCluster, New-AzAksCluster, Remove-AzAksCluster, Import-AzAksCredential…} Script 1.1.4 Az.AnalysisServices Core,Desk {Resume-AzAnalysisServicesServer, Suspend-AzAnalysisServicesServer, Get-AzAnalysisServicesServer, Remove-AzAnalysisServi… Script 2.3.0 Az.ApiManagement Core,Desk {Add-AzApiManagementApiToGateway, Add-AzApiManagementApiToProduct, Add-AzApiManagementProductToGroup, Add-AzApiManagemen… Script 1.0.0 Az.AppConfiguration Core,Desk {Get-AzAppConfigurationStore, Get-AzAppConfigurationStoreKey, New-AzAppConfigurationStore, New-AzAppConfigurationStoreKe… Script 1.2.0 Az.ApplicationInsights Core,Desk {Get-AzApplicationInsights, New-AzApplicationInsights, Remove-AzApplicationInsights, Update-AzApplicationInsights…} Script 1.7.1 Az.Automation Core,Desk {Get-AzAutomationHybridWorkerGroup, Remove-AzAutomationHybridWorkerGroup, Get-AzAutomationJobOutputRecord, Import-AzAuto… Script 3.1.0 Az.Batch Core,Desk {Remove-AzBatchAccount, Get-AzBatchAccount, Get-AzBatchAccountKey, New-AzBatchAccount…} Script 2.0.0 Az.Billing Core,Desk {Get-AzBillingInvoice, Get-AzBillingPeriod, Get-AzEnrollmentAccount, Get-AzConsumptionBudget…} Script 1.8.0 Az.Cdn Core,Desk {Get-AzCdnProfile, Get-AzCdnProfileSsoUrl, New-AzCdnProfile, Remove-AzCdnProfile…} Script 1.9.0 Az.CognitiveServices Core,Desk {Get-AzCognitiveServicesAccount, Get-AzCognitiveServicesAccountKey, Get-AzCognitiveServicesAccountSku, Get-AzCognitiveSe… Script 4.17.0 Az.Compute Core,Desk {Remove-AzAvailabilitySet, Get-AzAvailabilitySet, New-AzAvailabilitySet, Update-AzAvailabilitySet…} Script 2.1.0 Az.ContainerInstance Core,Desk {Add-AzContainerInstanceOutput, Get-AzContainerGroup, Get-AzContainerInstanceCachedImage, Get-AzContainerInstanceCapabil… Script 2.2.3 Az.ContainerRegistry Core,Desk {New-AzContainerRegistry, Get-AzContainerRegistry, Update-AzContainerRegistry, Remove-AzContainerRegistry…} Script 1.3.1 Az.CosmosDB Core,Desk {Get-AzCosmosDBSqlContainer, Get-AzCosmosDBSqlContainerThroughput, Get-AzCosmosDBSqlDatabase, Get-AzCosmosDBSqlDatabaseT… Script 1.1.0 Az.DataBoxEdge Core,Desk {Get-AzDataBoxEdgeJob, Get-AzDataBoxEdgeDevice, Invoke-AzDataBoxEdgeDevice, New-AzDataBoxEdgeDevice…} Script 1.1.0 Az.Databricks Core,Desk {Get-AzDatabricksVNetPeering, Get-AzDatabricksWorkspace, New-AzDatabricksVNetPeering, New-AzDatabricksWorkspace…} Script 1.14.0 Az.DataFactory Core,Desk {Set-AzDataFactoryV2, Update-AzDataFactoryV2, Get-AzDataFactoryV2, Remove-AzDataFactoryV2…} Script 1.0.2 Az.DataLakeAnalytics Core,Desk {Get-AzDataLakeAnalyticsDataSource, New-AzDataLakeAnalyticsCatalogCredential, Remove-AzDataLakeAnalyticsCatalogCredentia… Script 1.3.0 Az.DataLakeStore Core,Desk {Get-AzDataLakeStoreTrustedIdProvider, Remove-AzDataLakeStoreTrustedIdProvider, Remove-AzDataLakeStoreFirewallRule, Set-… Script 1.0.0 Az.DataShare Core,Desk {New-AzDataShareAccount, Get-AzDataShareAccount, Remove-AzDataShareAccount, New-AzDataShare…} Script 1.1.0 Az.DeploymentManager Core,Desk {Get-AzDeploymentManagerArtifactSource, New-AzDeploymentManagerArtifactSource, Set-AzDeploymentManagerArtifactSource, Re… Script 3.0.0 Az.DesktopVirtualization Core,Desk {Disconnect-AzWvdUserSession, Expand-AzWvdMsixImage, Get-AzWvdApplication, Get-AzWvdApplicationGroup…} Script 1.0.2 Az.DevTestLabs Core,Desk {Get-AzDtlAllowedVMSizesPolicy, Get-AzDtlAutoShutdownPolicy, Get-AzDtlAutoStartPolicy, Get-AzDtlVMsPerLabPolicy…} Script 1.1.2 Az.Dns Core,Desk {Get-AzDnsRecordSet, New-AzDnsRecordConfig, Remove-AzDnsRecordSet, Set-AzDnsRecordSet…} Script 1.3.0 Az.EventGrid Core,Desk {New-AzEventGridTopic, Get-AzEventGridTopic, Set-AzEventGridTopic, New-AzEventGridTopicKey…} Script 1.8.0 Az.EventHub Core,Desk {New-AzEventHubNamespace, Get-AzEventHubNamespace, Set-AzEventHubNamespace, Remove-AzEventHubNamespace…} Script 1.8.0 Az.FrontDoor Core,Desk {New-AzFrontDoor, Get-AzFrontDoor, Set-AzFrontDoor, Remove-AzFrontDoor…} Script 3.1.0 Az.Functions Core,Desk {Get-AzFunctionApp, Get-AzFunctionAppAvailableLocation, Get-AzFunctionAppPlan, Get-AzFunctionAppSetting…} Script 4.3.0 Az.HDInsight Core,Desk {Get-AzHDInsightJob, New-AzHDInsightSqoopJobDefinition, Wait-AzHDInsightJob, New-AzHDInsightStreamingMapReduceJobDefinit… Script 1.3.1 Az.HealthcareApis Core,Desk {New-AzHealthcareApisService, Remove-AzHealthcareApisService, Set-AzHealthcareApisService, Get-AzHealthcareApisService} Script 2.7.3 Az.IotHub Core,Desk {Add-AzIotHubKey, Get-AzIotHubEventHubConsumerGroup, Get-AzIotHubConnectionString, Get-AzIotHubJob…} Script 3.5.0 Az.KeyVault Core,Desk {Add-AzKeyVaultCertificate, Update-AzKeyVaultCertificate, Stop-AzKeyVaultCertificateOperation, Get-AzKeyVaultCertificate… Script 2.0.0 Az.Kusto Core,Desk {Add-AzKustoClusterLanguageExtension, Add-AzKustoDatabasePrincipal, Get-AzKustoAttachedDatabaseConfiguration, Get-AzKust… Script 1.5.0 Az.LogicApp Core,Desk {Get-AzIntegrationAccountAgreement, Get-AzIntegrationAccountAssembly, Get-AzIntegrationAccountBatchConfiguration, Get-Az… Script 1.1.3 Az.MachineLearning Core,Desk {Move-AzMlCommitmentAssociation, Get-AzMlCommitmentAssociation, Get-AzMlCommitmentPlanUsageHistory, Remove-AzMlCommitmen… Script 1.1.1 Az.Maintenance Core,Desk {Get-AzApplyUpdate, Get-AzConfigurationAssignment, Get-AzMaintenanceConfiguration, Get-AzMaintenanceUpdate…} Script 2.0.0 Az.ManagedServices Core,Desk {Get-AzManagedServicesAssignment, New-AzManagedServicesAssignment, Remove-AzManagedServicesAssignment, Get-AzManagedServ… Script 1.0.2 Az.MarketplaceOrdering Core,Desk {Get-AzMarketplaceTerms, Set-AzMarketplaceTerms} Script 1.1.1 Az.Media Core,Desk {Sync-AzMediaServiceStorageKey, Set-AzMediaServiceKey, Get-AzMediaServiceKey, Get-AzMediaServiceNameAvailability…} Script 1.1.1 Az.Migrate Core,Desk {Get-AzMigrateDiscoveredServer, Get-AzMigrateJob, Get-AzMigrateProject, Get-AzMigrateReplicationEligibilityResult…} Script 2.7.0 Az.Monitor Core,Desk {Get-AzMetricDefinition, Get-AzMetric, Remove-AzLogProfile, Get-AzLogProfile…} Script 4.11.0 Az.Network Core,Desk {Add-AzApplicationGatewayAuthenticationCertificate, Get-AzApplicationGatewayAuthenticationCertificate, New-AzApplication… Script 1.1.1 Az.NotificationHubs Core,Desk {Get-AzNotificationHub, Get-AzNotificationHubAuthorizationRule, Get-AzNotificationHubListKey, Get-AzNotificationHubPNSCr… Script 2.3.0 Az.OperationalInsights Core,Desk {New-AzOperationalInsightsAzureActivityLogDataSource, New-AzOperationalInsightsCustomLogDataSource, Disable-AzOperationa… Script 1.4.1 Az.PolicyInsights Core,Desk {Get-AzPolicyEvent, Get-AzPolicyState, Get-AzPolicyStateSummary, Get-AzPolicyRemediation…} Script 1.1.2 Az.PowerBIEmbedded Core,Desk {Remove-AzPowerBIWorkspaceCollection, Get-AzPowerBIWorkspaceCollection, Get-AzPowerBIWorkspaceCollectionAccessKey, Get-A… Script 1.0.3 Az.PrivateDns Core,Desk {Get-AzPrivateDnsZone, Remove-AzPrivateDnsZone, Set-AzPrivateDnsZone, New-AzPrivateDnsZone…} Script 4.6.0 Az.RecoveryServices Core,Desk {Get-AzRecoveryServicesBackupProperty, Get-AzRecoveryServicesVault, Get-AzRecoveryServicesVaultSettingsFile, New-AzRecov… Script 1.5.0 Az.RedisCache Core,Desk {Remove-AzRedisCachePatchSchedule, New-AzRedisCacheScheduleEntry, Get-AzRedisCachePatchSchedule, New-AzRedisCachePatchSc… Script 1.0.0 Az.RedisEnterpriseCache Core,Desk {Export-AzRedisEnterpriseCache, Get-AzRedisEnterpriseCache, Get-AzRedisEnterpriseCacheDatabase, Get-AzRedisEnterpriseCac… Script 1.0.3 Az.Relay Core,Desk {New-AzRelayNamespace, Get-AzRelayNamespace, Set-AzRelayNamespace, Remove-AzRelayNamespace…} Script 1.0.0 Az.ResourceMover Core,Desk {Add-AzResourceMoverMoveResource, Get-AzResourceMoverMoveCollection, Get-AzResourceMoverMoveResource, Get-AzResourceMove… Script 4.3.1 Az.Resources Core,Desk {Get-AzProviderOperation, Remove-AzRoleAssignment, Get-AzRoleAssignment, New-AzRoleAssignment…} Script 1.0.0 Az.Security Core,Desk {Get-AzSecurityAlert, Set-AzSecurityAlert, Get-AzSecurityAutoProvisioningSetting, Set-AzSecurityAutoProvisioningSetting…} Script 1.1.0 Az.SecurityInsights Core,Desk {Get-AzSentinelAlertRuleAction, New-AzSentinelAlertRuleAction, Remove-AzSentinelAlertRuleAction, Update-AzSentinelAlertR… Script 1.5.0 Az.ServiceBus Core,Desk {New-AzServiceBusNamespace, Get-AzServiceBusNamespace, Set-AzServiceBusNamespace, Remove-AzServiceBusNamespace…} Script 3.0.1 Az.ServiceFabric Core,Desk {Add-AzServiceFabricClientCertificate, Add-AzServiceFabricNode, Add-AzServiceFabricNodeType, Get-AzServiceFabricCluster…} Script 1.3.0 Az.SignalR Core,Desk {New-AzSignalR, Get-AzSignalR, Get-AzSignalRKey, New-AzSignalRKey…} Script 3.5.0 Az.Sql Core,Desk {Get-AzSqlDatabaseTransparentDataEncryption, Get-AzSqlDatabaseTransparentDataEncryptionActivity, Set-AzSqlDatabaseTransp… Script 1.1.0 Az.SqlVirtualMachine Core,Desk {New-AzSqlVM, Get-AzSqlVM, Update-AzSqlVM, Remove-AzSqlVM…} Script 3.11.0 Az.Storage Core,Desk {Get-AzStorageAccount, Get-AzStorageAccountKey, New-AzStorageAccount, New-AzStorageAccountKey…} Script 1.6.0 Az.StorageSync Core,Desk {Invoke-AzStorageSyncCompatibilityCheck, New-AzStorageSyncService, Get-AzStorageSyncService, Set-AzStorageSyncService…} Script 2.0.0 Az.StreamAnalytics Core,Desk {Get-AzStreamAnalyticsCluster, Get-AzStreamAnalyticsClusterStreamingJob, Get-AzStreamAnalyticsDefaultFunctionDefinition,… Script 1.0.0 Az.Support Core,Desk {Get-AzSupportService, Get-AzSupportProblemClassification, Get-AzSupportTicket, Get-AzSupportTicketCommunication…} Script 1.0.4 Az.TrafficManager Core,Desk {Add-AzTrafficManagerCustomHeaderToEndpoint, Remove-AzTrafficManagerCustomHeaderFromEndpoint, Add-AzTrafficManagerCustom… Script 2.8.2 Az.Websites Core,Desk {Get-AzAppServicePlan, Set-AzAppServicePlan, New-AzAppServicePlan, Remove-AzAppServicePlan…} ``` ## Debug output ``` > New-AzDeployment -Name test -Location 'Central us' -TemplateFile .\TagTest.json -TemplateParameterFile .\TagTest.parameters.json -Debug DEBUG: 11:05:03 AM - NewAzureSubscriptionDeploymentCmdlet begin processing with ParameterSet 'ByTemplateFileAndParameterFile'. DEBUG: 11:05:03 AM - using account id 'user@sample.com'... Confirm Are you sure you want to perform this action? [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Yes"): y DEBUG: [Common.Authentication]: Authenticating using Account: 'user@sample.com', environment: 'AzureCloud', tenant: '11-22-33-44-55' DEBUG: 11:05:09 AM - [SilentAuthenticator] Calling SharedTokenCacheCredential.GetTokenAsync - TenantId:'11-22-33-44-55', Scopes:'https://management.core.windows.net//.default', AuthorityHost:'https://login.microsoftonline.com/', UserId:'user@sample.com' 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.19043 [09/14/2021 16:05:09 - ] 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.19043 [09/14/2021 16:05:09] Found 5 cache accounts and 0 broker accounts DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.19043 [09/14/2021 16:05:09] Returning 5 accounts DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.19043 [09/14/2021 16:05:09 - ] MSAL MSAL.NetCore with assembly version '4.30.1.0'. CorrelationId(37af88f4-4860-4eec-be0a-064a68872a01) DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.19043 [09/14/2021 16:05:09 - ] === AcquireTokenSilent Parameters === DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.19043 [09/14/2021 16:05:09 - ] LoginHint provided: False DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.19043 [09/14/2021 16:05:09 - ] Account provided: True DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.19043 [09/14/2021 16:05:09 - ] ForceRefresh: False DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.19043 [09/14/2021 16:05:09 - ] === 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 - 37af88f4-4860-4eec-be0a-064a68872a01 DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.19043 [09/14/2021 16:05:09 - ] === Token Acquisition (SilentRequest) started: Authority Host: login.microsoftonline.com DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.19043 [09/14/2021 16:05:09 - ] 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.19043 [09/14/2021 16:05:09 - ] Access token is not expired. Returning the found cache entry. [Current time (09/14/2021 16:05:09) - Expiration Time (09/14/2021 16:55:18 +00:00) - Extended Expiration Time (09/14/2021 16:55:18 +00:00)] DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.19043 [09/14/2021 16:05:09 - ] Returning access token found in cache. RefreshOn exists ? False DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.19043 [09/14/2021 16:05:09 - ] Fetched access token from host login.microsoftonline.com. DEBUG: (False) MSAL 4.30.1.0 MSAL.NetCore Microsoft Windows 10.0.19043 [09/14/2021 16:05:09 - ] === Token Acquisition finished successfully. An access token was returned with Expiration Time: 09/14/2021 16:55:18 +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-09-14T16:55:18.0000000+00:00 DEBUG: [Common.Authentication]: Received token with LoginType 'User', Tenant: '11-22-33-44-55', UserId: 'user@sample.com' DEBUG: ============================ HTTP REQUEST ============================ HTTP Method: POST Absolute Uri: https://management.azure.com/subscriptions/11-22-33-44/providers/Microsoft.Resources/deployments/test/validate?api-version=2021-04-01 Headers: x-ms-client-request-id : 11-22-33-44 Accept-Language : en-US Body: { "location": "Central us", "properties": { "template": { "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.4.613.9944", "templateHash": "10140413462284698591" } }, "parameters": { "tags": { "type": "object", "defaultValue": {} } }, "functions": [], "resources": [ { "type": "Microsoft.Resources/resourceGroups", "apiVersion": "2020-06-01", "name": "rgTest", "location": "central us", "tags": "[parameters('tags')]" } ] }, "parameters": { "tags": { "value": { "alL_CAPS": "ALL_CAPS", "all_lower": "all_lower", "mixed_Case": "Mixed_Case" } } }, "mode": "Incremental" } } DEBUG: ============================ HTTP RESPONSE ============================ Status Code: OK Headers: Cache-Control : no-cache Pragma : no-cache x-ms-ratelimit-remaining-subscription-writes: 1199 x-ms-request-id : 0b06d6af-f68e-417e-9ac1-2cd4b5a641bc x-ms-correlation-request-id : 0b06d6af-f68e-417e-9ac1-2cd4b5a641bc x-ms-routing-request-id : NORTHCENTRALUS:20210914T160509Z:0b06d6af-f68e-417e-9ac1-2cd4b5a641bc Strict-Transport-Security : max-age=31536000; includeSubDomains X-Content-Type-Options : nosniff Date : Tue, 14 Sep 2021 16:05:08 GMT Body: { "id": "/subscriptions/11-22-33-44/providers/Microsoft.Resources/deployments/test", "name": "test", "type": "Microsoft.Resources/deployments", "location": "centralus", "properties": { "templateHash": "10140413462284698591", "parameters": { "tags": { "type": "Object", "value": { "alL_CAPS": "ALL_CAPS", "all_lower": "all_lower", "mixed_Case": "Mixed_Case" } } }, "mode": "Incremental", "provisioningState": "Succeeded", "timestamp": "2021-09-14T16:05:09.3690598Z", "duration": "PT0S", "correlationId": "0b06d6af-f68e-417e-9ac1-2cd4b5a641bc", "providers": [ { "namespace": "Microsoft.Resources", "resourceTypes": [ { "resourceType": "resourceGroups", "locations": [ "centralus" ] } ] } ], "dependencies": [], "validatedResources": [ { "id": "/subscriptions/11-22-33-44/resourceGroups/rgTest" } ] } } VERBOSE: 11:05:09 AM - Template is valid. Confirm Continue with this operation? [Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Yes"): y DEBUG: ============================ HTTP REQUEST ============================ HTTP Method: PUT Absolute Uri: https://management.azure.com/subscriptions/11-22-33-44/providers/Microsoft.Resources/deployments/test?api-version=2021-04-01 Headers: x-ms-client-request-id : 11-22-33-44 Accept-Language : en-US Body: { "location": "Central us", "properties": { "template": { "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.4.613.9944", "templateHash": "10140413462284698591" } }, "parameters": { "tags": { "type": "object", "defaultValue": {} } }, "functions": [], "resources": [ { "type": "Microsoft.Resources/resourceGroups", "apiVersion": "2020-06-01", "name": "rgTest", "location": "central us", "tags": "[parameters('tags')]" } ] }, "parameters": { "tags": { "value": { "alL_CAPS": "ALL_CAPS", "all_lower": "all_lower", "mixed_Case": "Mixed_Case" } } }, "mode": "Incremental" } } DEBUG: ============================ HTTP RESPONSE ============================ Status Code: OK Headers: Cache-Control : no-cache Pragma : no-cache Azure-AsyncOperation : https://management.azure.com/subscriptions/11-22-33-44/providers/Microsoft.Resources/deployments/test/operationStatuses/08585699713747816395?api-version=2021-04-01 x-ms-ratelimit-remaining-subscription-writes: 1199 x-ms-request-id : cab678b4-8615-4e3f-9343-b12acd3ef4e6 x-ms-correlation-request-id : cab678b4-8615-4e3f-9343-b12acd3ef4e6 x-ms-routing-request-id : NORTHCENTRALUS:20210914T160511Z:cab678b4-8615-4e3f-9343-b12acd3ef4e6 Strict-Transport-Security : max-age=31536000; includeSubDomains X-Content-Type-Options : nosniff Date : Tue, 14 Sep 2021 16:05:10 GMT Body: { "id": "/subscriptions/11-22-33-44/providers/Microsoft.Resources/deployments/test", "name": "test", "type": "Microsoft.Resources/deployments", "location": "centralus", "properties": { "templateHash": "10140413462284698591", "parameters": { "tags": { "type": "Object", "value": { "alL_CAPS": "ALL_CAPS", "all_lower": "all_lower", "mixed_Case": "Mixed_Case" } } }, "mode": "Incremental", "provisioningState": "Accepted", "timestamp": "2021-09-14T16:05:11.1148573Z", "duration": "PT0.4188776S", "correlationId": "cab678b4-8615-4e3f-9343-b12acd3ef4e6", "providers": [ { "namespace": "Microsoft.Resources", "resourceTypes": [ { "resourceType": "resourceGroups", "locations": [ "centralus" ] } ] } ], "dependencies": [] } } VERBOSE: 11:05:11 AM - Create template deployment 'test' Confirm Continue with this operation? [Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Yes"): y VERBOSE: 11:05:12 AM - Checking deployment status in 5 seconds Confirm Continue with this operation? [Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Yes"): y DEBUG: ============================ HTTP REQUEST ============================ HTTP Method: GET Absolute Uri: https://management.azure.com/subscriptions/11-22-33-44/providers/Microsoft.Resources/deployments/test/operations?api-version=2021-04-01 Headers: x-ms-client-request-id : 11-22-33-44 Accept-Language : en-US Body: DEBUG: ============================ HTTP RESPONSE ============================ Status Code: OK Headers: Cache-Control : no-cache Pragma : no-cache x-ms-ratelimit-remaining-subscription-reads: 11999 x-ms-request-id : daca6d9a-3104-4fe4-8ac0-87a4c98b78db x-ms-correlation-request-id : daca6d9a-3104-4fe4-8ac0-87a4c98b78db x-ms-routing-request-id : NORTHCENTRALUS:20210914T160518Z:daca6d9a-3104-4fe4-8ac0-87a4c98b78db Strict-Transport-Security : max-age=31536000; includeSubDomains X-Content-Type-Options : nosniff Date : Tue, 14 Sep 2021 16:05:18 GMT Body: { "value": [ { "id": "/subscriptions/11-22-33-44/providers/Microsoft.Resources/deployments/test/operations/210D8C630275C413", "operationId": "210D8C630275C413", "properties": { "provisioningOperation": "Create", "provisioningState": "Succeeded", "timestamp": "2021-09-14T16:05:11.9954639Z", "duration": "PT0.6044729S", "trackingId": "2a8d284c-d73e-4e9a-a99a-85eb09f98ee2", "serviceRequestId": "e0505f25-3c80-46c8-a379-f1dc7e43c6ba", "statusCode": "Created", "targetResource": { "id": "/subscriptions/11-22-33-44/resourceGroups/rgTest", "resourceType": "Microsoft.Resources/resourceGroups", "resourceName": "rgTest" } } }, { "id": "/subscriptions/11-22-33-44/providers/Microsoft.Resources/deployments/test/operations/08585699713747816395", "operationId": "08585699713747816395", "properties": { "provisioningOperation": "EvaluateDeploymentOutput", "provisioningState": "Succeeded", "timestamp": "2021-09-14T16:05:12.0754242Z", "duration": "PT0.6844332S", "trackingId": "902a65d4-0e5b-4d60-aed9-b68704e549c0", "statusCode": "OK" } } ] } VERBOSE: 11:05:18 AM - Resource Microsoft.Resources/resourceGroups 'rgTest' provisioning status is succeeded Confirm Continue with this operation? [Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Yes"): y DEBUG: ============================ HTTP REQUEST ============================ HTTP Method: GET Absolute Uri: https://management.azure.com/subscriptions/11-22-33-44/providers/Microsoft.Resources/deployments/test?api-version=2021-04-01 Headers: x-ms-client-request-id : 11-22-33-44 Accept-Language : en-US Body: DEBUG: ============================ HTTP RESPONSE ============================ Status Code: OK Headers: Cache-Control : no-cache Pragma : no-cache x-ms-ratelimit-remaining-subscription-reads: 11998 x-ms-request-id : 0a2a1143-8a1b-4aa7-84ac-1e9903a9c787 x-ms-correlation-request-id : 0a2a1143-8a1b-4aa7-84ac-1e9903a9c787 x-ms-routing-request-id : NORTHCENTRALUS:20210914T160519Z:0a2a1143-8a1b-4aa7-84ac-1e9903a9c787 Strict-Transport-Security : max-age=31536000; includeSubDomains X-Content-Type-Options : nosniff Date : Tue, 14 Sep 2021 16:05:19 GMT Body: { "id": "/subscriptions/11-22-33-44/providers/Microsoft.Resources/deployments/test", "name": "test", "type": "Microsoft.Resources/deployments", "location": "centralus", "properties": { "templateHash": "10140413462284698591", "parameters": { "tags": { "type": "Object", "value": { "alL_CAPS": "ALL_CAPS", "all_lower": "all_lower", "mixed_Case": "Mixed_Case" } } }, "mode": "Incremental", "provisioningState": "Succeeded", "timestamp": "2021-09-14T16:05:12.1033208Z", "duration": "PT1.4073411S", "correlationId": "cab678b4-8615-4e3f-9343-b12acd3ef4e6", "providers": [ { "namespace": "Microsoft.Resources", "resourceTypes": [ { "resourceType": "resourceGroups", "locations": [ "centralus" ] } ] } ], "dependencies": [], "outputResources": [ { "id": "/subscriptions/11-22-33-44/resourceGroups/rgTest" } ] } } Id : /subscriptions/11-22-33-44/providers/Microsoft.Resources/deployments/test DeploymentName : test Location : centralus ProvisioningState : Succeeded Timestamp : 9/14/2021 4:05:12 PM Mode : Incremental TemplateLink : Parameters : Name Type Value =============== ========================= ========== tags Object { "alL_CAPS": "ALL_CAPS", "all_lower": "all_lower", "mixed_Case": "Mixed_Case" } Outputs : DeploymentDebugLogLevel : DEBUG: AzureQoSEvent: Module: Az.Resources:4.3.1; CommandName: New-AzDeployment; PSVersion: 7.1.4; IsSuccess: True; Duration: 00:00:15.8460269 DEBUG: Finish sending metric. DEBUG: 11:05:20 AM - NewAzureSubscriptionDeploymentCmdlet end processing. DEBUG: Setting WindowTitle: vNet-Bicep [main] - PowerShell 7.1 (102208) c:\ > ``` ## Error output ``` No Error ```
Author: ChristopherGLewis
Assignees: -
Labels: `Service Attention`, `question`, `ARM - Core`, `customer-reported`, `needs-triage`
Milestone: -
MietekW commented 3 years ago

I can confirm, also ran in this issue, tag: DeploymentID became : deploymentID

reijoh commented 3 years ago

I can confirm the same behavior. In my case I noticed this when using New-AzResourceGroupDeployment version 4.3.1 to deploy the IaaSAntimalware VM extension. I send in the settings as a parameter. Command I used:

New-AzResourceGroupDeployment `
  -ResourceGroupName vmrg `
  -Name vmextension `
  -TemplateFile ./vmextension.json `
  -TemplateParameterFile ./vmextension.parameters.json

In vmextension.parameters.json I send in:

{
  "AntimalwareEnabled": true,
  "RealtimeProtectionEnabled": true,
  "ScheduledScanSettings": {
    "isEnabled": true,
    "day": 7,
    "time": 120,
    "scanType": "Quick"
  }
}

I received the error: VM has reported a failure when processing extension 'IaaSAntimalware'. Error message: "The configuration file does not specify an AntimalwareEnabled value of true (case sensitive).

Then I see the deployment properties from the command and I clearly see that case has changed to lowercase for first character of all input parameter values:

{
  "antimalwareEnabled": true,
  "realtimeProtectionEnabled": true,
  "scheduledScanSettings": {
    "isEnabled": true,
    "day": 7,
    "time": 120,
    "scanType": "Quick"
  }
}

When I use Azure CLI version 2.24.2 (and version 2.28.0) to deploy the template the deployment is successful:

az deployment group create --resource-group vmrg --name vmextension --template-file ./vmextension.json --parameters ./vmextension.parameters.json
BethanyZhou commented 2 years ago

Hi @ChristopherGLewis , this issue has been fixed in Az.Resources>=4.4.0. I saw you were using Az.Resources 4.3.1. Could you please upgrade your Az.Resources and have a try?

ChristopherGLewis commented 2 years ago

Yes, confirmed to be fixed

On Mon, Dec 13, 2021 at 2:39 AM Beisi Zhou @.***> wrote:

Hi @ChristopherGLewis https://github.com/ChristopherGLewis , this issue has been fixed in Az.Resources>=4.4.0. I saw you were using Az.Resources 4.3.1. Could you please upgrade your Az.Resources and have a try?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Azure/azure-powershell/issues/15876#issuecomment-992229553, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACA4VCSNGHNE323GD2A2HOTUQWWKNANCNFSM5EAQDEUA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

-- Christopher G. Lewis http://www.ChristopherLewis.com http://www.christopherlewis.com/

BethanyZhou commented 2 years ago

Going to close this issue. Please feel free to open if have any further question.