Skip to content

Conversation

@blueww
Copy link
Member

@blueww blueww commented Apr 16, 2018

Description

Support create Storage Context with OAuth.
The PR pending change:

  1. change to signed package
  2. Use AuthenticationFactory in Powershell to replace ADAL reference. (done)

The design is in: https://github.com/Azure/azure-powershell-cmdlet-review-pr/issues/37

Checklist

Copy link
Member

Choose a reason for hiding this comment

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

@blueww it looks like this line is causing build errors -- would you mind taking a look?

Copy link
Member

Choose a reason for hiding this comment

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

@blueww please remove all instances of app.config that were added in this PR and not used

@blueww
Copy link
Member Author

blueww commented Apr 18, 2018

@cormacpayne
I have resolved you comments. Let's see if the build can pass.

Besides that, there's only 1 commit in the PR is from me: "[Storage] Support Oauth in Storage Context "
How could we make the branch sync with the preview branch, to make the PR only contains my change?

@markcowl
Copy link
Member

@blueww Can you make a separate PR to update the branch?

@markcowl markcowl self-assigned this Apr 18, 2018
@blueww
Copy link
Member Author

blueww commented Apr 19, 2018

@markcowl
Thanks for the remind! I have filed a PR to do that: #5988

Copy link
Member

Choose a reason for hiding this comment

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

As discussed, we should not make this change, instead we should add this into the ExtendedProperties for AzureEnvironemnt, as we did for DataLake OAuth support

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

Copy link
Member

Choose a reason for hiding this comment

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

Again, this should not be here

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed.

Copy link
Member

Choose a reason for hiding this comment

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

You will need to make the identical change in Commands.Storage.Netcore.csproj in this directory

Copy link
Member Author

Choose a reason for hiding this comment

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

It seems "Commands.Management.Storage.Netcore.csproj" don't reference the changed dll (XSCL) currently. Should I add it?

Copy link
Member

Choose a reason for hiding this comment

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

I am not sure you cna remove these

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't see any negative impact by removing it.

Copy link
Member

Choose a reason for hiding this comment

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

You will need to add these dependencies to Commands.Storage.Netcore, in the same directory

Copy link
Member Author

Choose a reason for hiding this comment

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

"Commands.Storage.Netcore.csproj" only has DMlib and XSCL as reference, I will change these 2.

Copy link
Member

Choose a reason for hiding this comment

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

does this belong on the cmdlet? seems like you should have this in the StorageContext, or use a closure to capture the value

Copy link
Member Author

Choose a reason for hiding this comment

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

removed, use a closure.

Copy link
Member

Choose a reason for hiding this comment

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

I don't think this method needs to be async. Also, the 'accessToken' variable in this should not come from the cmdlet - it should probably be stored in the context, or be a closure (for example, you could have a method on this cmdlet that returned a renewer).

Copy link
Member Author

Choose a reason for hiding this comment

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

The XSCL define the renew function is async as below, so we must use async.

public TokenCredential(string initialToken, RenewTokenFuncAsync periodicTokenRenewer, object state, TimeSpan renewFrequency);

I will change the access token as closure.

@blueww
Copy link
Member Author

blueww commented Apr 25, 2018

@markcowl

I have resolved you comments, and rebased the commit on latest preview code.
I have sent another PR to update the Oauth branch, #6048. After the update branch PR merge, this PR will look clean.

@blueww
Copy link
Member Author

blueww commented Apr 25, 2018

@markcowl

Besides that, could we see the static analysis failure in the PR build check log? It's very inconvenience to find the static analysis failure.

@markcowl
Copy link
Member

markcowl commented May 3, 2018

@blueww The current issue is a nuget restore issue, noit a static analysis issue. It looks liek the new storage management package is actually invalid, It shows two files that resolve to the same name:

%5BContentTypes%5D.xml and
[ContentTypes].xml

How did you create this package? If you used a very old version of Nuget, you may need to upgrade.

@blueww blueww force-pushed the oauth branch 5 times, most recently from 1d1deae to 2a6c4b2 Compare May 4, 2018 09:31
@blueww blueww force-pushed the oauth branch 2 times, most recently from dfa41d9 to 6788195 Compare May 9, 2018 05:32
@praries880
Copy link
Contributor

@blueww
Copy link
Member Author

blueww commented May 10, 2018

@praries880
The netcore build failure is caused by the private XSCL don't have netcore dll updated to support oauth. I have contact the XSCL team. And will update the PR when get an updated XSCL with the issue resolved.

I have get the latest nuget for XSCL, and updated the PR.

@blueww
Copy link
Member Author

blueww commented May 10, 2018

@praries880

Now the travis build fail since following error. It seems not caused by my code change but some environment issue. Please help to look at it.

I have re-start the test, and it seems pass now.

/usr/share/dotnet/sdk/2.1.2/Microsoft.Common.CurrentVersion.targets(2041,5): error MSB3248: Parameter "AssemblyFiles" has invalid value "/home/travis/build/Azure/azure-powershell/src/Common/Commands.Common.Authentication.Abstractions/bin/Debug/netcoreapp2.0/Microsoft.Azure.Commands.Common.Authentication.Abstractions.dll". The process cannot access the file '/home/travis/build/Azure/azure-powershell/src/Common/Commands.Common.Authentication.Abstractions/bin/Debug/netcoreapp2.0/Microsoft.Azure.Commands.Common.Authentication.Abstractions.dll' because it is being used by another process. [/home/travis/build/Azure/azure-powershell/src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/Common.ResourceManager.ScenarioTests.Netcore.csproj]

@praries880
Copy link
Contributor

@praries880 praries880 merged commit b1e363e into Azure:Azure.Storage.OAuth May 11, 2018
@praries880
Copy link
Contributor

@praries880
Copy link
Contributor

@blueww signed package to test here
Do validate that it works as expected and has all your changes as per the expecation.

@blueww
Copy link
Member Author

blueww commented May 14, 2018

@praries880
Thanks very much for the help to merge it!

praries880 pushed a commit to praries880/azure-powershell that referenced this pull request May 14, 2018
This commit moves PR Azure#5960 from the branch Azure.Storage.Oauth to
Azure.Storage.Location which is the branch we will be releasing all the
preview releases off of.
@praries880
Copy link
Contributor

@blueww @markcowl created PR #6210 to get these changes form "Azure.Storage.OAuth" to "AzureRM.Storage.Location"... Need you @blueww to validate that the changes look good
and you @markcowl to validate that I didn't bring in any unexpected changes on the new PR (#6210)

@blueww
Copy link
Member Author

blueww commented May 15, 2018

I have reviewed #6210. Looks good to me.

praries880 added a commit that referenced this pull request May 15, 2018
[Storage] Support OAuth (moves PR #5960) to AzureRM.Storage.Location
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants