Skip to content

Powershell changes to onboard additional traffic analytics parameters with existing networkwatcher flowlog parameters #6253

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

Merged
merged 18 commits into from
May 24, 2018

Conversation

sayghosh
Copy link
Contributor

@sayghosh sayghosh commented May 18, 2018

Description

Checklist

@MikhailTryakhov
Copy link
Contributor

+@EvgenyAgafonchikov to review

@sayghosh sayghosh force-pushed the preview branch 2 times, most recently from 9f31554 to a61494d Compare May 19, 2018 12:58
@sayghosh
Copy link
Contributor Author

sayghosh commented May 19, 2018

The build failed to to 2 test failures (1 failure unrelated to my changes). But my local build of the repo is working fine.Please advise what to do here. Below are the errors:

image

PS: I have ran few validation tests on my changes and the tests are successful.

@sayghosh sayghosh force-pushed the preview branch 2 times, most recently from c95e351 to ebc8abb Compare May 20, 2018 05:13
@sayghosh
Copy link
Contributor Author

sayghosh commented May 20, 2018

I have made fixes and after that also I see build issues but the traces do not show any error. In the build artifacts msbuild.err is 0B.

https://azuresdkci.westus2.cloudapp.azure.com/job/powershell/4632/artifact/

I see this in console output:
image

Is this an intermittent issue?

PS: In local I have ran the FlowLog test and its functional.

@sayghosh
Copy link
Contributor Author

Looks like the above build fail was intermittent :)

@maddieclayton
Copy link
Contributor

@sayghosh Have you filled out a cmdlet design review? If so, please link in the description. If not, please fill one out here: https://github.com/Azure/azure-powershell-cmdlet-review-pr/issues

@sayghosh
Copy link
Contributor Author

@maddieclayton Here is the PR: https://github.com/Azure/azure-powershell-cmdlet-review-pr/issues/60#issuecomment-387464726

@@ -503,24 +503,21 @@ function Test-FlowLog
# Setup
$resourceGroupName = Get-ResourceGroupName
$nwName = Get-ResourceName
$location = "eastus"
$location = "eastus2euap"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did not update as the same location field is used to create many resources and no all of them are available in new france regions. Let me know your thoughts here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should use a different location variable for each resource type and use Get-Location. This guarentees that you will be able to rerecord even when permissions to different regions change, or when you are in a different cloud (China, Fairfax).

Copy link
Contributor Author

@sayghosh sayghosh May 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually the NSG, NetworkWatcher and Storage Account has to be in same azure region while the workspace can be in any indepedent region, that is why there are 2 location variables used here. And to enable Traffic analytics, both the networkwatcher and WS has to be in a Traffic Analytics supported region. But currently Traffic Analytics is availble only on 14 azure regions. FOr now I can add a comment to it with reason why I could not use Get-Location there. Does this make sense? PLease adivse.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, adding the comment should be fine.


try
{
# Create Resource group
New-AzureRmResourceGroup -Name $resourceGroupName -Location "$location"

# Create the Virtual Network
$subnet = New-AzureRmVirtualNetworkSubnetConfig -Name $subnetName -AddressPrefix 10.0.1.0/24
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this just never used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this was never used

<package id="Microsoft.Azure.Management.Redis" version="3.1.1-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.ResourceManager" version="1.6.0-preview" targetFramework="net452" />
<package id="Microsoft.Azure.Management.Resources" version="2.20.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Storage" version="6.1.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.OperationalInsights" version="0.9.0.1-preview" targetFramework="net452" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think you need this package.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

@@ -47,6 +47,9 @@
<Reference Include="Hyak.Common">
<HintPath>..\..\..\packages\Hyak.Common.1.0.3\lib\portable-net403+win+wpa81\Hyak.Common.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Commands.OperationalInsights">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

@@ -87,6 +93,9 @@
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Redis.3.1.1-preview\lib\net45\Microsoft.Azure.Management.Redis.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.OperationalInsights, Version=0.9.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need this package - if it does not work without this package let me know.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed


if (ParameterSetName.Contains(TAByDetails))
{
if (this.WorkspaceResourceId == null || this.WorkspaceGUId == null || this.WorkspaceLocation == null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to have this check - powershell will not allow the user to not enter mandatory parameters for a parameter set.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

throw new System.ArgumentException("Either the Workspace parameter or all of WorkspaceResourceId,WorkspaceGUId,WorkspaceLocation must be provided");
}

string[] workspaceDetailsComponents = this.WorkspaceResourceId.Split('/');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of these APIs validate check of exact 8 components (They check >= 8). Is it advisabel to use that check still?

}
else
{
if (this.Workspace == null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this check.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

@@ -118,7 +118,7 @@ public void TestRemoveAzureRmServiceFabricNode()
TestController.NewInstance.RunPsTest("Test-RemoveAzureRmServiceFabricNode");
}

[Fact]
[Fact(Skip = "Test is failing and needs a fix from the owning team")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is happening here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

The first error.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you work with @juhacket to get this test passing? I don't want to submit a PR that could possibly be breaking a cmdlet.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I have sent a note. But since the test does not use the cmdlets I touched, this PR should not add any new breaking change and I guess the test might already be failing in the merged changes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am more worried about the bump to the network version breaking the cmdlet than any changes you made. As I would likely gate the release of the new Network module on this change (and because code complete is not until Monday), I'd like to get this test rerecorded before merging this PR.

@@ -6,7 +6,7 @@
<package id="Microsoft.Azure.Gallery" version="2.6.2-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Graph.RBAC" version="3.2.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Authorization" version="2.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Network" version="19.0.0-preview" targetFramework="net452" />
<package id="Microsoft.Azure.Management.Network" version="19.0.1-preview" targetFramework="net452" />
<package id="Microsoft.Azure.Management.Resources" version="2.20.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Sql" version="1.13.0-preview" targetFramework="net452" />
<package id="Microsoft.Azure.Management.Storage" version="2.4.0-preview" targetFramework="net45" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove/revert changes to the files after this:
src/StackAdmin/AzureRM/AzureRM.psm1
src/StackAdmin/AzureStack/AzureStack.psm1
tools/AzureRM/AzureRM.psm1
tools/LocalFeed/Microsoft.Azure.Management.Network.19.0.1-preview.nupkg
tools/LocalFeed/Microsoft.Azure.Management.Network.19.0.1-preview.symbols.nupkg

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ping - these files need to be reverted or deleted before the PR is accepted.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I shall do these after all changes are accepted. As doing these will cause the build to break.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will not cause the build to break - they are created during the msbuild, but reverting them will not cause the build to break.

@sayghosh sayghosh force-pushed the preview branch 2 times, most recently from 98c6948 to 54ebe15 Compare May 22, 2018 18:25
@maddieclayton
Copy link
Contributor

All changes are approved - this will be merged once the ServiceFabric changes have been merged.

maddieclayton
maddieclayton previously approved these changes May 22, 2018
@maddieclayton
Copy link
Contributor

@sayghosh If you get a moment today, can you resolve the merge conflicts above? If you don't have time, I'll do it tomorrow, but would like to get that done ASAP so we can run final tests and merge.

@sayghosh
Copy link
Contributor Author

@maddieclayton I am working on them and updating the PR after a quick validation on my side.

@maddieclayton
Copy link
Contributor

@sayghosh
Copy link
Contributor Author

@azuresdkci test this please

@sayghosh
Copy link
Contributor Author

sayghosh commented May 24, 2018

@maddieclayton Again some test falied which is unrelated:

image

Retriggered the build anyhow.

@sayghosh
Copy link
Contributor Author

@maddieclayton maddieclayton merged commit c1a2b35 into Azure:Network-2018-05-01 May 24, 2018
EvgenyAgafonchikov pushed a commit to EvgenyAgafonchikov/azure-powershell that referenced this pull request May 28, 2018
… with existing networkwatcher flowlog parameters (Azure#6253)

* Powershell changes satge 1

* Some small changes in required assembly list

* Basic commandlets working

* Basic implementations done

* Implementatioan and test file changes

* Workspace object usage coded

* Changes done

* Optional and mandatory variables sorted

* Version updates

* Updating test

* Reverting changes in service fabric test and squashing all commits into one

* Reverting service fabric changes

* Adding help generation text

* Cleaning the signatureIssues.csv file

* Pushing minor string update to retrigger build

* Revising the service fabric changes
EvgenyAgafonchikov pushed a commit to EvgenyAgafonchikov/azure-powershell that referenced this pull request May 30, 2018
… with existing networkwatcher flowlog parameters (Azure#6253)

* Powershell changes satge 1

* Some small changes in required assembly list

* Basic commandlets working

* Basic implementations done

* Implementatioan and test file changes

* Workspace object usage coded

* Changes done

* Optional and mandatory variables sorted

* Version updates

* Updating test

* Reverting changes in service fabric test and squashing all commits into one

* Reverting service fabric changes

* Adding help generation text

* Cleaning the signatureIssues.csv file

* Pushing minor string update to retrigger build

* Revising the service fabric changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants