-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Add auto-registration for resource providers. #1330
Conversation
state = providers.get(resource_provider_namespace=namespace) | ||
if state.registration_state != 'Registered': | ||
logger.info('registering {}', namespace) | ||
providers.register(resource_provider_namespace=namespace) |
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.
Please note, this will only flag the state to 'registering', but it is unknown when it will become "registered". So what is being done here is not reliable, though it is useful
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.
The issue mentioned at #1309 might not be addressed by this change, because that issue surfaced during deployment, when arm did try to register the provider for you, but failed after 1 minute wait.
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.
well, in this case the user mentioned that it repeatedly occurred. I figure this can't hurt, might help?
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.
let us do this, since you will need to re-record http traffic for the acs end to end tests.
- Manually un-register the compute, network, storage
- Delete the .yaml of the test
- Run the test
If the test passes, I will merge once the CI is green
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.
Let 2 comments for clarification
/cc: @ravbhatnagar
d8acca2
to
1da7050
Compare
255dd14
to
3f1cb27
Compare
@yugangw-msft I think this is ready to go. After consulting w/ ARM folks, I think that this is a good solution to help resolve this issue. Thanks! |
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.
Please back out an unrelated file change. And I will then merge
@@ -56,8 +56,7 @@ | |||
_COMMON_TENANT = 'common' | |||
|
|||
_AUTH_CTX_FACTORY = lambda authority, cache: adal.AuthenticationContext(authority, | |||
cache=cache, | |||
api_version=None) | |||
cache=cache) |
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.
Please back out this change.
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.
Without this change, re-generating the unit test recording fails.
I'm happy to split it out as a separate fix, but I think it should be fixed...
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.
What error did you see? Regenerating recording should not use anything related with this class, or it is a bug i can take a look.
FYI, we do need to set api-version
to none, so adal will switch to newer api-version at 1.1+
; otherwise tokens issued for webapi associated resource might be invalid. please refer to the issue AzureAD/azure-activedirectory-library-for-python#54
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.
@brendandburns Run python scripts/dev_setup.py
in your environment so that you have the latest dependencies as our adal version was recently updated and that's why you see an error.
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's likely you have the older version of adal in your environment which directly affected 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.
done.
3f1cb27
to
c58bb43
Compare
Ok, removed the extraneous change. This is ready to go. Thanks! |
* Azure/master: (39 commits) User should use no-cache so we build a fresh image (Azure#1455) Bump all modules to version 0.1.0b10 (Azure#1454) [Docs] Move around the order of install instructions. (Azure#1439) acs: *_install_cli mark cli as executable (Azure#1449) Fix resource list table. (Azure#1452) [Compute] VM NIC updates (Azure#1421) Introduce batch upload and download for blob (Azure#1428) Add auto-registration for resource providers. (Azure#1330) interpret the '@' syntax if something higher hasn't already done that. (Azure#1423) Aliasing plan argument with shorthand (Azure#1433) ad:fix one more place which still uses localtime for secret starttime (Azure#1429) Add table formatting for deployments and sort by timestmap. (Azure#1427) Add table formatting for resource group list (and add 'status') (Azure#1425) [Docs] Add shields specifying latest version and supported python versions (Azure#1420) Add new az storage blob copy start-batch command (Azure#1250) Component Discovery (Azure#1409) Add poison logic to prevent re-recording tests that need updating. (Azure#1412) [Storage] Fix storage table outputs and help text. (Azure#1402) [mention-bot] Attempt to fix config (Azure#1410) ad:use utc time on setting app's creds (Azure#1408) ...
* Add auto-registration for resource providers. * update unit test recording.
Fixes #1309