-
Notifications
You must be signed in to change notification settings - Fork 302
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
Automate Azure Arc testing #1908
Comments
Testing Azure Identity in Azure Arc EnvironmentsPrerequisites
Installing Azure Arc on the VMPlease note, you must be in your VM to install Azure Arc.
Run the Azure Identity Test on the Azure Arc VMThe following steps are specific to Go Install Go
Download the repo and run the test
|
Testing azure-identity in Azure Arc (in Python)Prerequisite tools
Install Azure Arc on the VM
Give the Azure Arc VM access to the key vaultFor the tests to pass, the VM will need secret management permissions in your key vault.
Run the azure-identity Tests on the Azure Arc VM
In a terminal window, run:
Set the environment variable Install
Run the managed identity tests, using the below command once with Python 2.7 and once with Python 3.5+:
Expected output for each: |
Hi @catalinaperalta ,the branch addAzureArcAuthentication cannot be found in the repo 'azure-sdk-for-go'. |
@JosueJoshua I fixed the instructions, you can simply clone the repo and use the content that's in master now. Thanks! |
Testing azure-identity in Azure Arc (in JavaScript)Prerequisite tools
Install Azure Arc on the VM
Give the Azure Arc VM access to the key vaultFor the tests to pass, the VM will need key management permissions in your key vault.
Run the azure-identity Tests on the Azure Arc VM
Create a new folder for the identity test:
Change directory to that folder with {
"name": "identity-test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node index.js"
},
"keywords": [],
"author": "",
"license": "MIT",
"dependencies": {
"@azure/identity": "1.2.0",
"@azure/keyvault-keys": "4.1.0",
}
} Then, copy the following code in a file named const { ManagedIdentityCredential } = require("@azure/identity");
const { KeyClient } = require("@azure/keyvault-keys");
async function main() {
const credential = new ManagedIdentityCredential();
const keyVaultUrl = `https://key-vault-name.vault.azure.net`;
const client = new KeyClient(keyVaultUrl, credential);
// Retrieving the properties of the existing keys in that specific Key Vault.
// This might log empty if no keys have been created in the given Key Vault.
console.log(await client.listPropertiesOfKeys().next());
console.log("Test succeeded!");
}
main().then(console.log).catch((e) => console.error(e)); With the |
Hi @sadasant , it's using secret management template to add access policy in the third step, perhaps it should use key management template. |
@JosueJoshua that is true! thank you! |
I updated it! |
Testing Identity in Azure Arc (Latest JavaScript instructions)
Prerequisites
Install Azure Arc on the VM
Give the Azure Arc VM access to the key vaultFor the tests to pass, the VM will need secret management permissions in your key vault.
Run the azure-identity Tests on the Azure Arc VM
In a terminal window, run: git clone https://github.com/Azure/azure-sdk-for-js --single-branch --depth 1
cd azure-sdk-for-js/sdk/identity/identity/test/manual-integration/AzureArc Set the environment variable Install dependencies: npm install Compile the test file using TypeScript: npm run build Run the test file: node dist/index.js Expected output: |
Testing ManagedIdentityCredential in Azure Arc (in C++)Set up a VM, Azure Resources, and Azure Arc just as you would for Go, Python, or JavaScript. run Visual Studio Installer Open x64 Native Tools Commond Prompt cd /D %USERPROFILE%
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
bootstrap-vcpkg.bat
vcpkg install curl:x86-windows openssl:x86-windows libxml2:x86-windows curl:x64-windows openssl:x64-windows libxml2:x64-windows curl:x64-windows-static openssl:x64-windows-static libxml2:x64-windows-static Wait for the installation to finish (about 20 minutes) cd ..
git clone https://github.com/Azure/azure-sdk-for-cpp.git
cd azure-sdk-for-cpp
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=%USERPROFILE%\vcpkg\scripts\buildsystems\vcpkg.cmake -DBUILD_TESTING=ON
cmake --build build The build usually takes up to 5 minutes. build\sdk\identity\azure-identity\test\e2e\Debug\azure-identity-e2e-test.exe Watch the output. It will either print "OK" + print "SUCCESS" in large letters, or it will print error details + the relevant environment. Successful executions are usually instant, in case of failures the test may wait for up to a minute before printing the error details. This is caused by the credential going through retries before finally giving up. |
Hi, @mccoyp Through the investigation , the token cannot be obtained. I tried to delete the 'tenant_id' parameter of the code |
Hi @AFengKK, sorry for the late reply! You're absolutely right about this, thank you for finding this bug. The latest preview versions of Key Vault packages include a We're working on a fix for this now, but in the meantime, using the latest stable version of |
Hi,@joshfree Through the investigation , I tried to use internal v0.8.2, it works normally. But use internal v0.8.3 and later version, it can't work. Can you provide some help on this issue? |
Hi, @mccoyp, Thank you for your help. The test can pass with the stable version of azure-keyvault-secrets (4.3.0). In addition, if the bug is fixed, please let me know. |
@zzkaii I filed Azure/azure-sdk-for-go#17143 in the Go repo to track the issue / question. |
Hi @AFengKK, the latest stable release of |
Testing azidentity on Azure Arc (latest Go instructions)Prerequisites
Install Azure Arc on the VM
Run the test on the Azure Arc VMIn a terminal window, run:
Expected output: |
Hi, @mccoyp. We have two problems when test the Testing azure-identity in Azure Arc (in Python). 1.When test the Testing azure-identity in Azure Arc (in Python) and run the Through the investigation, we need to install tools
Maybe we can create a PR to fix this issue. 2.Rerun Through the investigation, we need to configure the test-proxy to pass the test. So, it is suggested to add relevant descriptions in the test process. |
Hi @v-jiaodi, thank you for the summary! I'm sorry about the delayed response. Getting the test proxy set up in the test environment may be possible, but it would likely be more difficult than is worth attempting. I created a tracking issue (Azure/azure-sdk-for-python#26237) to address this and can update this thread when it's completed. |
Hi @antkmsft. Following the steps above, while testing ManagedIdentityCredential in Azure Arc (in C++), we encountered an error after executing the command:
The detailed error information is as follows: |
Hi @joshfree, we deeply appreciate your input into this project. Regrettably, this issue has remained inactive for over 2 years, leading us to the decision to close it. We've implemented this policy to maintain the relevance of our issue queue and facilitate easier navigation for new contributors. If you still believe this topic requires attention, please feel free to create a new issue, referencing this one. Thank you for your understanding and ongoing support. |
@joshfree This issue has been closed. Do we need to continue testing this |
Tracking issue for step-by-step instructions for how to manually run e2d tests for Azure Arc hosted environments for each of the azure-sdk-for-* languages. This issue will be used by our Vendor team for manually running tests in this scenario, and will eventually be referenced by Central-EngSys for adding this environment to our automated test runs.
Assigning to @catalinaperalta who will create the initial instructions specific to Azure SDK for Go. Other SDK languages will be appended to this issue as comments.
The text was updated successfully, but these errors were encountered: