-
Notifications
You must be signed in to change notification settings - Fork 4k
Transit AzureAudit to AzureActivity, plus a small fix on Get-**DataSource #2978
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
Conversation
Hi @haitch, I'm your friendly neighborhood Azure Pull Request Bot (You can call me AZPRBOT). Thanks for your contribution!
TTYL, AZPRBOT; |
@haitch Hey Haitao, would you mind pulling from dev to get the latest changes that fix the on-demand build? |
@haitch This is failing on one of your tests. |
@markcowl Yeah, it is from one of my test, but I don't know why it failed, it was working fine on my box: Microsoft.Azure.Commands.OperationalInsights.Test.DataSourceTests.TestDataSourceCreateUpdateDelete [FAIL] [D:\workspace\powershell\build.proj] |
I see references to Hayak, should this still go into dev branch? |
@shahabhijeet What else should we use other than Hayak? that's going to be a big change. |
}; | ||
|
||
CreatePSDataSourceWithProperties(auditLogProperties); | ||
throw new NotSupportedException("This data source is obsoleted, Please use New-AzureRmOperationalInsightsAzureActivityLogDataSource instead."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@haitch this is a breaking change. Existing scripts using this cmdlet will no longer work. Since you are redirecting users to another cmdlet, why not use an alias?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cormacpayne how do I setup alias? do you have an example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is a link for aliasing your cmdlet
https://msdn.microsoft.com/en-us/library/ms714827(v=vs.85).aspx
@@ -22,6 +22,7 @@ namespace Microsoft.Azure.Commands.OperationalInsights | |||
{ | |||
[Cmdlet(VerbsCommon.New, "AzureRmOperationalInsightsAzureActivityLogDataSource", SupportsShouldProcess = true, | |||
DefaultParameterSetName = ByWorkspaceName), OutputType(typeof(PSDataSource))] | |||
[Alias("New-AzureRmOperationalInsightsAzureAuditDataSource")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also need to add the alias in script, use the IModuleAssemblyInitializer pattern, as in the Profile and Resources cmdlets.
Comments
This checklist is used to make sure that common issues in a pull request are covered by the creator. You can find a more complete discussion of PowerShell cmdlet best practices here.
Below in Overall Changes, check off the boxes that apply to your PR. For the categories that you did not check off, you can remove them from this body. Within each of the categories that you did select, make sure that you can check off all of the boxes.
For information on cleaning up the commits in your pull request, click here.
Overall Changes
General
Tests
Cmdlet Signature
VerbsCommon
,VerbsCommunication
,VerbsLifecycle
,VerbsOther
whenever possibleOutputType
attribute if any output is produced; if the cmdlet produces no output, it should implement aPassThrough
parameterShouldProcess
and haveSupportShouldProcess = true
specified in the cmdlet attribute. See a discussion about correctShouldProcess
implementation hereDefaultParameterSetName
in its cmdlet attributeParameters
object
.ResourceGroup
type string marked as [ValueFromPipelineByPropertyName]ResourceName
type string marked as [ValueFromPipelineByPropertyName]HashTable
Parameters and the Pipeline
object
ResourceGroupName
andName
from the pipeline by property valueGet
andNew
cmdlets to the input ofSet
,Update
,Remove
and other action cmdlets for that resource