Microsoft.Azure.Management.Fluent (1.33.0)
Is there any way to update flow logs for a network security group to version 2 using .net sdk?
IFlowLogSettings.Update().WithLogging();
IFlowLogSettings.Update().WithRetentionPolicyEnabled();
IFlowLogSettings.Update().WithRetentionPolicyDays();
IFlowLogSettings.Update().WithStorageAccount();
I've been able to update using the methods listed above, but i also need to update the flow logs to version 2 , this can be done in powershell, but in this case i need to do this using C#. However i wasn't able to find how to do it, it would be useful to have this option on the IFlowLogSettings
Hello Weidong @weidongxu-microsoft could you share your thoughts, thanks?
@mihymel
You can try this code (cast settings to IFlowLogSettings if necessary), after IFlowLogSettings.Update().WithStorageAccount();
settings.Inner.Format = new FlowLogFormatParameters()
{
Type = FlowLogFormatType.JSON,
Version = 2
};
and before IFlowLogSettings.Update().Apply();
I apologize for the late response , i was able to test this code and it works! thanks a lot.
Most helpful comment
@mihymel
You can try this code (cast settings to
IFlowLogSettingsif necessary), afterIFlowLogSettings.Update().WithStorageAccount();and before
IFlowLogSettings.Update().Apply();