Comments (6)
Hi thanks for reporting! I'll loop in the developers of the module but it seems New-AzEventGridAdvancedFilterObject is the way to go. Pass its returned value to -FilterAdvancedFilter
from azure-powershell.
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @jfggdl.
from azure-powershell.
Hi thanks for reporting! I'll loop in the developers of the module but it seems New-AzEventGridAdvancedFilterObject is the way to go. Pass its returned value to -FilterAdvancedFilter
Thanks for the reply, indeed, I thought that I can use New-AzEventGridAdvancedFilterObject to define the filter, but its output is of type AdvancedFilter, which has only Key and OperatorType properties, see AdvancedFilter Class
In the previous version (1.6.1) the filter definition was a hashtable array, the keys from a hashtable element being Operator, Key and Value(s) Learn Link
So the problem with the 2.0.0 version for me is the missing "value" or "values" property from the AdvancedFilter class.
I think it needs to be there, in my understanding the purpose of the advanced filter is to look for values in the Key using the operator specified with the OperationType property.
Or maybe there's an alternative method to do this, but I didn't find one in the documentation.
Thanks!
from azure-powershell.
Hi @catalingurgu after checking with team member we believe this was a code defect. There should have been cmdlets for you to create filter objects and pass them to Update-AzEventGridSubscription
.
Use this as a workaround - create the filter objects with .NET APIs
$filter = New-Object -TypeName "Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.StringBeginsWithAdvancedFilter" -Property @{Key = "KEY"; Value = @("VALUE1", "VALUE2")}
For a complete list of filter types please refer to the "Derived" part of IAdvancedFilter Interface
from azure-powershell.
@jfggdl please note that the root cause was polymorphism wasn't handled correctly. According to the development guide, model classes should be created from the child classes, i.e. the concrete Filter classes instead of AdvancedFilter.
from azure-powershell.
@isra-fel, Thanks for the solution!
For anyone trying to implement the .NET API workaround in an Azure Automation Account PowerShell Runbook: I had to explicitly import the Az.EventGrid module in the runbook (Import-Module -Name Az.EventGrid), without this the .NET assembly doesn't seem to be available and the type is not recognized.
from azure-powershell.
Related Issues (20)
- Azure Gov: Get-AzPolicyAssignment not working HOT 1
- ERROR: Failed to connect to MSI. Please make sure MSI is configured correctly.
- Test-AzPostgreSqlFlexibleServerConnect kill PowerShell host with version 2 of SimplySQL Module HOT 1
- [Feature]: Allow New-AzPolicySetDefinition to read a template from github and deploy it
- The "Get-AzKeyVault" but not returning as expected on Azure CLI even on the latest version of az HOT 1
- [Feature]: Add Cmdlet(s) for creating and updating Runbook drafts HOT 4
- cmdlets misdocumented and not enough examples
- Unable to connect to tenants via GDAP & Az or MG modules in AzAccounts 3.0.0 or later HOT 1
- Get-AzADApplication Does Not Return Results in USGov
- Issue with Invoke-AzOperationalInsightsQuery Returning Incorrect Data Types
- New-AzVM installs BGInfo extension automatically
- Which version of Az.ApplicationInsights supports IngestionMode
- [Feature]: Host Azure modules in public ACR in addition to PowerShell Gallery
- https://learn.microsoft.com/en-us/powershell/module/az.recoveryservices/update-azrecoveryservicesasrprotectiondirection?view=azps-12.1.0&viewFallbackFrom=azps-6.3.0[Doc]: HOT 2
- [Doc] Get-AzSqlServerDisasterRecoveryConfiguration doc no example HOT 2
- Breaking changes with Get-AzAccessToken Token property changed from String to SecureString HOT 3
- [Doc] Set-AzStorageAccountManagementPolicy - Examples not formatted properly in PowerShell HOT 3
- New SharingScope property on Subnets breaks Set-AzVirtualNetwork in older Az.Network versions
- [Feature]: Update all
- Unable to acquire token for tenant when using AuthScope AzureKeyVaultServiceEndpointResourceId
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-powershell.