-
Notifications
You must be signed in to change notification settings - Fork 4k
Netcore + KeyVault #4879
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
Netcore + KeyVault #4879
Conversation
@@ -183,15 +183,15 @@ public AdalSession() | |||
{ | |||
} | |||
|
|||
public override TraceLevel AuthenticationLegacyTraceLevel | |||
public override System.Diagnostics.TraceLevel AuthenticationLegacyTraceLevel |
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.
Is this necessary? Is this class in a different namespace in NetCore or something?
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.
Yes, Newtonsoft.
'TraceLevel' is an ambiguous reference between 'System.Diagnostics.TraceLevel' and 'Newtonsoft.Json.TraceLevel'
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.
Won't fix.
|
||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' "> | ||
<PackageReference Include="Microsoft.Azure.Common" Version="2.1.4" /> | ||
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure.Authentication" Version="2.2.12" /> |
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.
I believe these should come from common dependencies
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.
I just grabbed some of the most common dependencies. Did you want me to shove all of them in there? 😄
</PropertyGroup> | ||
|
||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' "> | ||
<PackageReference Include="Microsoft.Azure.Common" Version="2.1.4" /> |
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.
same comment
</PropertyGroup> | ||
|
||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' "> | ||
<PackageReference Include="Microsoft.Azure.Common" Version="2.1.4" /> |
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.
same comment
</PropertyGroup> | ||
|
||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' "> | ||
<PackageReference Include="Hyak.Common" Version="1.1.3" /> | ||
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.2.0" /> | ||
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.4.0" /> |
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.
same comments about package references
@@ -23,14 +24,13 @@ | |||
</PropertyGroup> | |||
|
|||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' "> | |||
<PackageReference Include="Hyak.Common" Version="1.1.3" /> |
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.
same comment on common dependencies
</PropertyGroup> | ||
|
||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' "> | ||
<PackageReference Include="Hyak.Common" Version="1.1.3" /> |
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.
Same comment on depednencies - assuem that this applies across the board for all modules
|
||
namespace Microsoft.Azure.Commands.Resources.Models | ||
{ | ||
public static class ResourceExtensions | ||
{ | ||
#if !NETSTANDARD | ||
public static DeploymentExtended Deployment(this DeploymentGetResult deployment) |
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.
these aren't used anywhere in the desktop code?
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.
Not since I moved us away from Microsoft.Azure.Management.Resources to Microsoft.Azure.Management.ResourceManager.
@@ -47,55 +42,6 @@ public partial class ResourcesClient | |||
/// </summary> | |||
/// <param name="parameters">The get parameters</param> | |||
/// <returns>List of resources</returns> | |||
#if !NETSTANDARD | |||
public virtual List<PSResource> FilterPSResources(BasePSResourceParameters parameters) |
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.
This isn't used anywhere?
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.
Same comment as above: this was based on the old ResourceManager SDK.
@@ -24,12 +24,14 @@ function Test-PolicyDefinitionCRUD | |||
|
|||
# Test | |||
$actual = New-AzureRMPolicyDefinition -Name $policyName -Policy SamplePolicyDefinition.json | |||
Start-Sleep 5 |
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.
We shopuld actually have a test/retry loop here, as it may take more than 5 seconds.
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.
I'm hedging for xUnit support mid November. :)
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.
Good luck with that. Meanwhile, there is an actual common function that does retries. Please use it here
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.
325d741
to
20e7f83
Compare
<PackageReference Include="System.Security.SecureString" Version="4.3.0" /> | ||
<PackageReference Include="System.Xml.XmlDocument" Version="4.3.0" /> | ||
<PackageReference Include="System.Xml.XmlSerializer" Version="4.3.0" /> | ||
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" /> |
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.
Newtonsoft.Json is part of common dependencies, right? This applies to all usages
<PackageReference Include="Microsoft.Azure.Common" Version="2.1.4" /> | ||
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure.Authentication" Version="2.2.12" /> | ||
<PackageReference Include="System.Collections.Specialized" Version="4.3.0" /> | ||
<PackageReference Include="System.Reflection" Version="4.3.0" /> | ||
<PackageReference Include="System.Security.SecureString" Version="4.3.0" /> | ||
<PackageReference Include="System.Xml.XmlDocument" Version="4.3.0" /> | ||
<PackageReference Include="System.Xml.XmlSerializer" Version="4.3.0" /> | ||
<PackageReference Include="Newtonsoft.Json" Version="10.0.1" /> | ||
<PackageReference Include="Microsoft.PowerShell.SDK" Version="6.0.0-beta.3" /> | ||
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" /> |
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.
Newtonsoft.Json should come form Common.NetCore, right?
RequiredModules = @(@{ModuleName = 'AzureRM.Profile.Netcore'; ModuleVersion = '0.9.6'; }) | ||
|
||
# Assemblies that must be loaded prior to importing this module | ||
# RequiredAssemblies = @() |
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.
All dependencies not included in AzureRM.Profile.NetCore.psd1 will need to be listed here in RequiredAssemblies (as I obtusely noted below). This generally includes the management client assembly
@@ -54,13 +54,13 @@ PowerShellVersion = '5.1' | |||
# RequiredModules = @() | |||
|
|||
# Assemblies that must be loaded prior to importing this module | |||
# RequiredAssemblies = @() | |||
RequiredAssemblies = 'netcoreapp2.0\Microsoft.Azure.Commands.Common.Authentication.ResourceManager.dll' |
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.
See the desktop version of thsi file - you will need to include the dependencies mentioned there (basically everything in your common targets file)
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | ||
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Resources.2.20.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> |
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.
This module needs to get these assemblies form the common dependencies target
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.
Still not getting these assembl;ies form common
<package id="Microsoft.Azure.Management.Resources" version="2.20.0-preview" targetFramework="net45" /> | ||
</packages> | ||
<package id="Microsoft.Rest.ClientRuntime" version="2.3.6" targetFramework="net452" /> |
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.
Remove - these are retrieved by the dependency on ResourceManager common
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.
Same comment.
@@ -360,7 +360,7 @@ Gets valid resource name | |||
#> | |||
function Get-ResourceName | |||
{ | |||
return "some-unique-rg-name" | |||
return "some-unique-res-name" |
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.
why not the same?
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.
rs$(Get-RandomLetters)
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.
There were some problems with making this random because some of the tests were not exactly "unit". We are throwing all of these away once xUnit is ready, correct?
@@ -24,12 +24,14 @@ function Test-PolicyDefinitionCRUD | |||
|
|||
# Test | |||
$actual = New-AzureRMPolicyDefinition -Name $policyName -Policy SamplePolicyDefinition.json | |||
Start-Sleep 5 |
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.
Good luck with that. Meanwhile, there is an actual common function that does retries. Please use it here
@@ -12,13 +12,18 @@ | |||
# limitations under the License. | |||
# ---------------------------------------------------------------------------------- | |||
|
|||
function Get-RandomLetters | |||
{ | |||
return -join ((97..122) | Get-Random -Count 5 | % {[char]$_}) |
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.
🎉
@azuresdkci retest this please |
1 similar comment
@azuresdkci retest this please |
@maddieclayton, it looks like the LocationCompleter/ResourceGroupCompleter tests can intermittently fail due to timeout. There is a 5 second timeout, which is probably good for live usage; however, we might want to make it configurable for tests. |
Yikes I'm on it |
Hey @markcowl, can you take a look when you get a chance? :D |
@markcowl, ping. 😺 Sorry to bother you. |
Looking forward to this getting merged |
# RequiredAssemblies = @() | ||
RequiredAssemblies = 'netcoreapp2.0\AutoMapper.dll', | ||
'netcoreapp2.0\Microsoft.Azure.Management.Compute.dll', | ||
'netcoreapp2.0\Microsoft.Azure.Management.KeyVault.dll', |
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.
We will need to look at removing these in a future release
@@ -23,23 +27,20 @@ | |||
</PropertyGroup> | |||
|
|||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' "> | |||
<PackageReference Include="Hyak.Common" Version="1.1.3" /> | |||
<PackageReference Include="Microsoft.Azure.Common" Version="2.1.4" /> | |||
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure.Authentication" Version="2.2.12" /> | |||
<PackageReference Include="Microsoft.Azure.Management.ResourceManager" Version="1.6.0-preview" /> |
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.
We will need to repl;ace these with common code references fairly soon, but this needs to happen for the deskop version as well
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | ||
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Resources.2.20.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> |
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.
Still not getting these assembl;ies form common
<package id="Microsoft.Azure.Management.Resources" version="2.20.0-preview" targetFramework="net45" /> | ||
</packages> | ||
<package id="Microsoft.Rest.ClientRuntime" version="2.3.6" targetFramework="net452" /> |
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.
Same comment.
@@ -24,12 +24,14 @@ function Test-PolicyDefinitionCRUD | |||
|
|||
# Test | |||
$actual = New-AzureRMPolicyDefinition -Name $policyName -Policy SamplePolicyDefinition.json | |||
Start-Sleep 5 |
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.
@twitchax You will need to fix the resource manager module dependencies as you did for the other modules (as noted), since this will impact backward compatibility. I would really like you to use the retry function in the tests, but will not block the PR for it. |
@azuresdkci test this please. |
@markcowl, take a look? :) |
@markcowl...green! 🚀 |
Description
This checklist is used to make sure that common guidelines for a pull request are followed. You can find a more complete discussion of PowerShell cmdlet best practices here.
General Guidelines
Testing Guidelines
Cmdlet Signature Guidelines
ShouldProcess
and haveSupportShouldProcess=true
specified in the cmdlet attribute. You can find more information onShouldProcess
here.OutputType
attribute if any output is produced - if the cmdlet produces no output, it should implement aPassThru
parameter.Cmdlet Parameter Guidelines