Skip to content
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

[Azure.Identity] Add e2e testing instructions for Arc MI #15095

Merged
merged 4 commits into from
Nov 10, 2020

Conversation

mccoyp
Copy link
Member

@mccoyp mccoyp commented Nov 7, 2020

Closes #14371.

Comment on lines 48 to 49
pytest test_managed_identity_live.py
pytest test_managed_identity_live_async.py
Copy link
Member

Choose a reason for hiding this comment

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

You can run both with a single command:

Suggested change
pytest test_managed_identity_live.py
pytest test_managed_identity_live_async.py
pytest -k test_managed_identity_live

And this should be done twice, once each for Python 2.7 and 3.x.

1. A non-Azure Windows or Linux VM.
2. Administrator privileges on the VM.
3. An Azure Key Vault.
4. Python 3.5+
Copy link
Member

Choose a reason for hiding this comment

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

We also need to test 2.7.

@catalinaperalta
Copy link
Member

Once this is approved and merged, can you please also copy and paste these instructions in this issue (Azure/azure-sdk#1908) for the vendor team?

@mccoyp mccoyp requested a review from chlowell November 9, 2020 20:38
> **Note:** You must be in your VM to install Azure Arc.

1. Create an Azure Arc server resource on the [Azure Portal](https://portal.azure.com).
2. Choose to add an existing server using an interactive script.
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if a user who isn't familiar with the Arc section of the portal will know where to find the add server section. Maybe add something saying that it comes after selecting "Add to your existing infrastructure"?

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 actually haven't seen a prompt like that from creating new "Servers - Azure Arc" resources. I only see a choice between "Add servers using interactive script" and "Add servers at scale" -- I'll be more specific about how to create the resource to reflect this

Comment on lines +25 to +29
```
sudo usermod -a -G himds <user>
sudo setfacl -m "g:himds:r-x" /var/opt/azcmagent/tokens/
sudo setfacl -m "g::r-x" /var/opt/azcmagent/tokens/
```
Copy link
Member

Choose a reason for hiding this comment

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

I had to restart after applying these changes, did you also have to do that? If so, I'd mention that a restart might be necessary after this.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a good point; I do remember having to restart. I'll add that 👍

catalinaperalta
catalinaperalta previously approved these changes Nov 9, 2020
Copy link
Member

@catalinaperalta catalinaperalta left a comment

Choose a reason for hiding this comment

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

LGTM

```
Run the managed identity tests, using the below command once with Python 2.7 and once with Python 3.5+:
```
pytest -k managed_identity_live
Copy link
Member

Choose a reason for hiding this comment

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

Don't you need to add a Key Vault access policy for the identity first?

```
7. Arc setup should now be complete. Restart your VM to finalize your environment setup.
8. After restarting, check your environment by searching for environment variables named `IDENTITY_ENDPOINT` and
`IMDS_ENDPOINT`. If they are not present, or don't resemble `http://localhost:40342/metadata/identity/oauth2/token` and
Copy link
Member

Choose a reason for hiding this comment

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

Just curious--this suggests Arc may set unusable values for the variables. Have we seen that happen?

Copy link
Member Author

Choose a reason for hiding this comment

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

We haven't to my knowledge but I just wanted to make sure our bases are covered. I would imagine they would either show up correctly or not at all, assuming an Arc environment can't also be configured as another environment where IDENTITY_ENDPOINT would get set

@mccoyp mccoyp merged commit 0b1564c into Azure:master Nov 10, 2020
@mccoyp mccoyp deleted the arc-e2e branch November 10, 2020 00:48
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.

Create Identity e2e tests for running in Azure Arc
3 participants