-
Notifications
You must be signed in to change notification settings - Fork 741
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
[Python] LRO and AAD updates and fixes #1078
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
rather than having a bool for China why not make the Crendentials class accept an AzureEnvironment object (Default is public azure).
From the environment object the credentials object will take the authentication endpoint. This will make it scalable as Azure keeps on adding more environments (USGovernment, BlackForest (German cloud), etc.). This also makes it easy for service teams to add a test environment like DogFood, etc. when they want to record tests against an internal envt. before going GA.
We did the same thing in node.js
We also added wrapper methods (interactive, withUsernamePassword, withServicePrincipalSecret) with defaults to provide a similar experience like CLI.
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.
Later, the python CLI can just call these wrapper methods. So the grunt work remains in one central place and users of python sdk and CLI both benefit from this.
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.
Plus @lmazuel,
Sure I can look into that.
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.
@amarzavery I like the AzureEnvironment, this is something we clearly need.
One question, how do you spread the various Url into your clients? Example, how do you put managementEndpointUrl as the baseUrl of all Swagger ARM generated client? This is a manual operation?
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.
Actually, everybody will have to write this all the time.
If you change the env in creds, this change your client automatically, so it's the best code to be "generic"
Because I don't see a way to relate ResourceClient and managementEndpointUrl automatically.
Could the Swagger have a new annotation or something to tag the host, to be replaced on runtime by the correct cloud Host?
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.
Instead of taking the baseUri as a parameter in the constructor, it would be nice, if the user can provide the name of the environment. Default should be public azure. The generated code should have the base uri like this:
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.
@amarzavery How Autorest can generate this:
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.
For instance for Datalake, you want this:
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.
It should be an extension. 90% scenario is management clients. 10 % data plane.If the extension is not there then we should default to baseuri.
Anyways, @annatisch would kill me by now ;). We have already digressed from the main point of this PR.
I will catch all the conversation we had over here and file a github issue.
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.
@lmazuel @annatisch - Here is the github issue for the above discussion #1082. We can discuss this in the upcoming bi weekly meeting :).