Azure / Azure/azure-powershell
Update-AzEventGridSystemTopicEventSubscription fails when setting -DeliveryWithResourceIdentityType 'None'
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 4.3k
- Avg merge
- 3d 14h
- Merged PRs (30d)
- 54
Description
### Description
I am encountering an issue where Update-AzEventGridSystemTopicEventSubscription fails to remove the Managed Identity from an Event Subscription.
According to the [Update-AzEventGridSystemTopicEventSubscription (Az.EventGrid) | Microsoft Learn](https://learn.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgridsystemtopiceventsubscription?view=azps-15.3.0#-deliverywithresourceidentitytype), the parameter -DeliveryWithResourceIdentityType accepts 'None' to remove any identity. However, executing this command results in a type conversion error.
It appears that the underlying Enum EventSubscriptionIdentityType does not accept None, despite the cmdlet documentation stating otherwise.
### Issue script & Debug output
```PowerShell
PS C:\Windows\system32> $DebugPreference='Continue'
PS C:\Windows\system32> Update-AzEventGridSystemTopicEventSubscription `
>> -ResourceGroupName $resourceGroupName `
>> -SystemTopicName $eventGridSysTopicName `
>> -EventSubscriptionName $eventSubscriptionName `
>> -DeliveryWithResourceIdentityDestination $destination `
>> -DeliveryWithResourceIdentityType 'None' `
>> -ErrorAction Stop
Debug: 13:29:23 - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True].
Debug: 13:29:23 - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True].
Debug: 13:29:23 - GetAzureRMContextCommand begin processing with ParameterSet 'GetSingleContext'.
Debug: 13:29:23 - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [Az.Accounts], Cmdlet = [Get-AzContext]. Returning default value [True].
Debug: 13:29:23 - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True].
Debug: 13:29:23 - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning default value [True].
Debug: 13:29:23 - [ConfigManager] Got nothing from [CheckForUpgrade], Module = [], Cmdlet = []. Returning default value [True].
Debug: 13:29:23 - GetAzureRMContextCommand end processing.
Debug: [CmdletBeginProcessing]: Starting command
Debug: CmdletBeginProcessing:
Debug: CmdletProcessRecordStart:
Debug: CmdletGetPipeline:
Debug: CmdletBeforeAPICall:
Debug: URLCreated:
/subscriptions/***/resourceGroups/test-east/providers/Microsoft.EventGrid/systemTopics/narantestaccount-2b04123a-9355-4263-85a8-e8f8727a35c2/eventSubscript
ions/StorageAntimalwareSubscription?api-version=2023-06-01-preview
Debug: RequestCreated:
/subscriptions/***/resourceGroups/test-east/providers/Microsoft.EventGrid/systemTopics/narantestaccount-2b04123a-9355-4263-85a8-e8f8727a35c2/eventSubscript
ions/StorageAntimalwareSubscription?api-version=2023-06-01-preview
Debug: HeaderParametersAdded:
Debug: BodyContentSet:
Debug: 13:29:23 - [ConfigManager] Got nothing from [DisableInstanceDiscovery], Module = [], Cmdlet = []. Returning default value [False].
Debug: 13:29:23 - [ConfigManager] Got nothing from [EnableLoginByWam], Module = [], Cmdlet = []. Returning default value [True].
Debug: ============================ HTTP REQUEST ============================
HTTP Method:
PATCH
Absolute Uri:
https://management.azure.com/subscriptions/***/resourceGroups/test-east/providers/Microsoft.EventGrid/systemTopics/narantestaccount-2b04123a-9355-4263-85a8 -e8f8727a35c2/eventSubscriptions/StorageAntimalwareSubscription?api-version=2023-06-01-preview Headers: x-ms-unique-id : 5 x-ms-client-request-id : 7738d1cc-1f17-47c3-a7ca-8b996c883ebf CommandName : Update-AzEventGridSystemTopicEventSubscription FullCommandName : Update-AzEventGridSystemTopicEventSubscription_UpdateExpanded
ParameterSetName : __AllParameterSets
User-Agent : AzurePowershell/v0.0.0,PSVersion/v5.1.26100.7824,Az.EventGrid/2.1.0
Body:
{
"deliveryWithResourceIdentity": {
"identity": {
"type": "None"
},
"destination": {
"endpointType": "StorageQueue",
"properties": {
"resourceId": "/subscriptions/***/resourceGroups/test-east/providers/microsoft.storage/storageaccounts/narantestaccount",
"queueName": "myqueue"
}
}
}
}
Debug: BeforeCall:
Debug: ============================ HTTP RESPONSE ============================
Status Code:
BadRequest
Headers:
Pragma : no-cache
Strict-Transport-Security : max-age=31536000; includeSubDomains
x-ms-operation-identifier : tenantId=***,objectId=a7e22cff-3860-4622-b344-52db901d3644/japaneast/28227b51-97a6-488a-b83c-2db05132f116
x-ms-ratelimit-remaining-subscription-writes: 199
x-ms-ratelimit-remaining-subscription-global-writes: 2999
x-ms-request-id : 426aeda7-2fa3-4a46-81a8-c1fe3a85e46c
x-ms-correlation-request-id : 426aeda7-2fa3-4a46-81a8-c1fe3a85e46c
x-ms-routing-request-id : JAPANEAST:20260224T042928Z:426aeda7-2fa3-4a46-81a8-c1fe3a85e46c
X-Content-Type-Options : nosniff
X-Cache : CONFIG_NOCACHE
X-MSEdge-Ref : Ref A: 76940B9A29D04A3DBD552E83AF195A4F Ref B: SG2AA1070303036 Ref C: 2026-02-24T04:29:28Z
Cache-Control : no-cache
Date : Tue, 24 Feb 2026 04:29:28 GMT
Body:
{
"error": {
"code": "InvalidRequest",
"message": "Error converting value \"None\" to type 'Microsoft.Azure.Events.ResourceProvider.Common.Contracts.EventSubscriptionIdentityType'. Path
'deliveryWithResourceIdentity.identity.type', line 1, position 58."
}
}
Debug: ResponseCreated:
Debug: BeforeResponseDispatch:
Debug: CmdletProcessRecordEnd:
Update-AzEventGridSystemTopicEventSubscription : Error converting value "None" to type 'Microsoft.Azure.Events.ResourceProvider.Common.Contracts.EventSubscriptionIdentityType'. Path 'deliv
eryWithResourceIdentity.identity.type', line 1, position 58.
発生場所 行:1 文字:1
+ Update-AzEventGridSystemTopicEventSubscription `
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: ({ }:<>f__AnonymousType1) [Update-AzEventG..._UpdateExpanded]、RestException
+ FullyQualifiedErrorId : InvalidRequest,Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.UpdateAzEventGridSystemTopicEventSubscription_UpdateExpanded
```
### Environment data
```PowerShell
PS C:\Windows\system32> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.26100.7824
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.26100.7824
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
```
### Module versions
```PowerShell
PS C:\Windows\system32> Get-Module Az*
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 5.3.0 Az.Accounts {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault...}
Script 2.2.0 Az.EventGrid {Disable-AzEventGridPartnerTopic, Enable-AzEventGridPartnerDestination, Enable-AzEventGridPartnerTopic, Get-AzEventGridCaCertif...
```
### Error output
```PowerShell
```
Contributor guide
Research direction
Use the reported Update-AzEventGridSystemTopicEventSubscription command as the entry point; inspect how -DeliveryWithResourceIdentityType 'None' is handled and compare it with the documented accepted values. Reproduce the PATCH request from the issue; done means the command removes the managed identity without the EventSubscriptionIdentityType conversion error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, powershell
- Domain
- api, cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100