hi Viral Soni,
looks like u hit a snag with that 'endpointtype' parameter, mon ami )) no worries, alright, so the issue here is that the 'new-azeventgridsystemtopiceventsubscription' cmdlet has evolved a bit )) the 'endpointtype' parameter got a makeover in newer versions of the azure powershell module. instead of specifying it directly, u now need to define the endpoint configuration differently. here's how u can fix it )) u gotta use the 'storagequeue' object to define the endpoint now. here's the updated snippet for u ))
# create system topic subscription with storage queue endpoint
$storageQueueEndpoint = @{
queueName = $queueName
resourceId = $storageAccountId
}
new-azeventgridsystemtopiceventsubscription `
-resourcegroupname $resourcegroup `
-systemtopicname $systemtopicname `
-eventsubscriptionname $eventsubscriptionname `
-storagequeuemessagettlinseconds 300 `
-includedeventtype $eventtypes `
-storagequeueendpoint $storageQueueEndpoint
check the official docs for more deets https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridsystemtopiceventsubscription. they explain the new way to set up endpoints ))
this kinda change happens sometimes when apis get updated. worth keeping an eye on the module version u're using. run 'get-installedmodule -name az' to see if u're on the latest. if not, 'update-module -name az' might save u some headaches later ))
also, if u're automating a lot of azure stuff, consider using az cli or bicep for some tasks. they sometimes handle these transitions smoother ))
if u ever get stuck with parameter names, 'get-command -syntax new-azeventgridsystemtopiceventsubscription' will show u how the cmdlet expects things. lifesaver, i tell u ) hope this sorts it out for u )) if not, hit me back
Best regards,
Alex
and "yes" if you would follow me at Q&A - personaly thx.
P.S. If my answer help to you, please Accept my answer