I am trying to enable Defender for Cloud features using the PowerShell commands.
Set-AzSecurityPricing -Name "AppServices" -PricingTier "Standard" throws an error "Set-AzSecurityPricing: Internal server error has occurred". It used to work on previous versions of Az PowerShell. Issue started appearing after I upgraded to Az 11.0.0.
Issue script & Debug output
Exception :
Type : Microsoft.Rest.Azure.CloudException
Request :
Method : PUT
RequestUri : https://management.azure.com/subscriptions/7f01d09b-26a9-4720-a879-5a0ac68c787b/providers/Microsoft.Security/pricings/AppServices?api-version=2023-01-01
Content : {}
Headers :
Accept-Language : REDACTED
Authorization : …
User-Agent : FxVersion/7.0.323.6910 OSName/MacOs OSVersion/Darwin.23.1.0.Darwin.Kernel.Version.23.1.0.Mon.Oct.9.21.27.27.PDT.2023.root.xnu.10002.41.9.6RELEASE.X86.64 Microsoft.Azure.Management.Security.SecurityCenterClient/4.0.0.0
PSVersion/v7.3.3 AzurePowershell/v11.0.0 Az.Security/1.5.0
CommandName : REDACTED
ParameterSetName : REDACTED
x-ms-client-request-id : 2032bdb6-38bb-48fc-add8-6266ee9d3e31
Content-Type : application/json; charset=utf-8
Content-Length : 2
Response :
StatusCode : InternalServerError
ReasonPhrase : Internal Server Error
Content : {"error":{"code":"GeneralError","message":"Internal server error has occurred"}}
Headers :
Cache-Control : no-cache
Pragma : no-cache
x-ms-ratelimit-remaining-subscription-resource-requests : 249
Strict-Transport-Security : max-age=31536000; includeSubDomains
api-supported-versions : 1.0
Server : Kestrel
x-ms-failure-cause : service
x-ms-request-id : 1c3ff37d-746f-42f9-9381-ea21ce49f1cf
x-ms-correlation-request-id : 1c3ff37d-746f-42f9-9381-ea21ce49f1cf
x-ms-routing-request-id : SOUTHCENTRALUS:20231117T000504Z:1c3ff37d-746f-42f9-9381-ea21ce49f1cf
X-Content-Type-Options : nosniff
Date : Fri, 17 Nov 2023 00:05:04 GMT
Connection : close
Content-Length : 80
Content-Type : application/json; charset=utf-8
Expires : -1
Body : Microsoft.Rest.Azure.CloudError
RequestId : 1c3ff37d-746f-42f9-9381-ea21ce49f1cf
TargetSite :
Name : MoveNext
DeclaringType : Microsoft.Azure.Management.Security.PricingsOperations+<UpdateWithHttpMessagesAsync>d__7, Microsoft.Azure.PowerShell.Security.Management.Sdk, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
MemberType : Method
Module : Microsoft.Azure.PowerShell.Security.Management.Sdk.dll
Message : Internal server error has occurred
Data : System.Collections.ListDictionaryInternal
Source : Microsoft.Azure.PowerShell.Security.Management.Sdk
HResult : -2146233088
StackTrace :
at Microsoft.Azure.Management.Security.PricingsOperations.UpdateWithHttpMessagesAsync(String pricingName, Pricing pricing, Dictionary`2 customHeaders, CancellationToken cancellationToken)
at Microsoft.Azure.Commands.Security.Cmdlets.Pricings.SetPricings.ExecuteCmdlet()
at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.<>c__3`1.<ExecuteSynchronouslyOrAsJob>b__3_0(T c)
at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet, Action`1 executor)
at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet)
at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
CategoryInfo : CloseError: (:) [Set-AzSecurityPricing], CloudException
FullyQualifiedErrorId : Microsoft.Azure.Commands.Security.Cmdlets.Pricings.SetPricings
InvocationInfo :
MyCommand : Set-AzSecurityPricing
ScriptLineNumber : 1
OffsetInLine : 1
HistoryId : 11
Line : Set-AzSecurityPricing -Name "AppServices" -PricingTier "Standard"
PositionMessage : At line:1 char:1
+ Set-AzSecurityPricing -Name "AppServices" -PricingTier "Standard"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
InvocationName : Set-AzSecurityPricing
CommandOrigin : Internal
ScriptStackTrace : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo :
Environment data
Name Value
---- -----
PSVersion 7.3.3
PSEdition Core
GitCommitId 7.3.3
OS Darwin 23.1.0 Darwin Kernel Version 23.1.0: Mon Oct 9 21:27:27 PDT 2023; root:xnu-10002.41.9~6/RELEASE_X86_64
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Description
I am trying to enable Defender for Cloud features using the PowerShell commands. Set-AzSecurityPricing -Name "AppServices" -PricingTier "Standard" throws an error "Set-AzSecurityPricing: Internal server error has occurred". It used to work on previous versions of Az PowerShell. Issue started appearing after I upgraded to Az 11.0.0.
Issue script & Debug output
Environment data
Module versions
Error output
No response