Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Can't create metric alert which is disabled on creation #1294

Open
jon-swain-autocab opened this issue Feb 8, 2022 · 1 comment
Open

Comments

@jon-swain-autocab
Copy link

jon-swain-autocab commented Feb 8, 2022

v1.38.0

On attempting to create a metric alert using IAzure.AlertRules.MetricAlerts you cannot create the alert as disabled on creation due to the fact that Microsoft.Azure.Management.Monitor.Fluent.MetricAlert.Definition.WithRuleDisabled() returns an IWithActionGroup not an IWithCreate interface.

Example - Create() doesn't exist on IWithActionGroup interface returned from WithRuleDisabled()

azure.AlertRules.MetricAlerts.Define( "HIGH CPU" )
.WithExistingResourceGroup( resourceGroup )
.WithTargetResource( virtualMachine )
.WithPeriod( TimeSpan.FromMinutes( 15 ) )
.WithFrequency( TimeSpan.FromMinutes( 1 ) )
.WithAlertDetails( 1, "" )
.WithActionGroups( actionGroup.Id )
.DefineAlertCriteria( "High CPU" )
.WithMetricName( "Percentage CPU" )
.WithCondition( MetricAlertRuleTimeAggregation.Average, MetricAlertRuleCondition.GreaterThan, 85 )
.Attach()
.WithRuleDisabled()
.Create();

@weidongxu-microsoft
Copy link
Member

For .NET, the development focus has shifted to the next generation of Azure SDKs which follows the new SDK guideline and introduces a set of important new features. Those new packages are currently in preview state and we are actively working on making it production ready. You can visit this link here to see the latest .NET packages:
https://devblogs.microsoft.com/azure-sdk/october-2020-management-ga/

We have also published a few blog posts on why we are doing this:
https://devblogs.microsoft.com/azure-sdk/introducing-new-previews-for-azure-management-libraries/

With this background, .NET Fluent is currently in a low maintenance mode, and we mostly do security and bug fixes. It is subject to deprecation in the future when the new set of .NET packages become Generally Available (GA). Please let us know if there are further questions, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants