azure-sdk-for-net
azure-sdk-for-net copied to clipboard
Dotnet SDK Upgrade for azure stack hci 2022-12-01 release
Contributing to the Azure SDK
Please see our CONTRIBUTING.md if you are not familiar with contributing to this repository or have questions.
For specific information about pull request etiquette and best practices, see this section.
API change check
APIView has identified API level changes in this PR and created following API reviews.
For the one check is failing (net-azurestackhci-mgmt-ci) it gives out a list of steps to run and how to reproduce locally. Even after executing the below steps, I still see the same error locally and, in the PR. I am unsure of what I am missing.
Steps I performed: You may need to rebase on the latest main, run 'eng\scripts\Update-Snippets.ps1' run 'eng\scripts\Export-API.ps1' run 'dotnet build /t:GenerateCode' run 'dotnet build /t:GenerateTest'
@lsweeney24 Some sample codes are not updated. Please run dotnet build /t:GenerateTest
. Thanks.
@lsweeney24 Some sample codes are not updated. Please run
dotnet build /t:GenerateTest
. Thanks.
I ran this earlier, but just reran it and pushed the commit.
@lsweeney24 Could you please check the test recording? It looks like one of them is obsolete and requires re-recording: https://dev.azure.com/azure-sdk/public/_build/results?buildId=2136994&view=logs&j=ef1bf84e-5df0-5e03-d5b9-25aebe74528c&t=5524be56-929a-5516-d55b-c8d3dcbefa11&l=4987
Do you have any docs that explain how to do this?
@lsweeney24 Could you please check the test recording? It looks like one of them is obsolete and requires re-recording: dev.azure.com/azure-sdk/public/_build/results?buildId=2136994&view=logs&j=ef1bf84e-5df0-5e03-d5b9-25aebe74528c&t=5524be56-929a-5516-d55b-c8d3dcbefa11&l=4987
Do you have any docs that explain how to do this?
@lsweeney24 See https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core.TestFramework/README.md#recorded-tests
@lsweeney24 Could you please check the test recording? It looks like one of them is obsolete and requires re-recording: dev.azure.com/azure-sdk/public/_build/results?buildId=2136994&view=logs&j=ef1bf84e-5df0-5e03-d5b9-25aebe74528c&t=5524be56-929a-5516-d55b-c8d3dcbefa11&l=4987
Do you have any docs that explain how to do this?
@lsweeney24 See https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core.TestFramework/README.md#recorded-tests
Following the instructions provided I am getting back this error, that "azurestackhci" doesn't exist in the project internal. Is there some onboarding I should have done before hand?
[D:\dev\azure-sdk-for-net-forked\sdk\azurestackhci\Azure.ResourceManager.Hci] 09:27:19 $ echo 'PAT' | az devops login --organization https://dev.azure.com/azure-sdk
[D:\dev\azure-sdk-for-net-forked\sdk\azurestackhci\Azure.ResourceManager.Hci] 09:29:30
$ ......\eng\scripts\Start-DevOpsRecordings.ps1 33589 azurestackhci Starting pipeline 'net - azurestackhci - tests' for PR 33589 ERROR: There were no build definitions matching name "net - azurestackhci - tests" in project "internal". ERROR: argument --run-id: expected one argument
Examples from AI knowledge base: https://aka.ms/cli_ref Read more about the command in reference docs Started https://dev.azure.com/azure-sdk/internal/_build/results?buildId=
@lsweeney24 Could you please check the test recording? It looks like one of them is obsolete and requires re-recording: dev.azure.com/azure-sdk/public/_build/results?buildId=2136994&view=logs&j=ef1bf84e-5df0-5e03-d5b9-25aebe74528c&t=5524be56-929a-5516-d55b-c8d3dcbefa11&l=4987
Do you have any docs that explain how to do this?
@lsweeney24 See
main
/sdk/core/Azure.Core.TestFramework/README.md#recorded-testsFollowing the instructions provided I am getting back this error, that "azurestackhci" doesn't exist in the project internal. Is there some onboarding I should have done before hand?
[D:\dev\azure-sdk-for-net-forked\sdk\azurestackhci\Azure.ResourceManager.Hci] 09:27:19 $ echo 'PAT' | az devops login --organization dev.azure.com/azure-sdk
[D:\dev\azure-sdk-for-net-forked\sdk\azurestackhci\Azure.ResourceManager.Hci] 09:29:30
$ ......\eng\scripts\Start-DevOpsRecordings.ps1 33589 azurestackhci Starting pipeline 'net - azurestackhci - tests' for PR 33589 ERROR: There were no build definitions matching name "net - azurestackhci - tests" in project "internal". ERROR: argument --run-id: expected one argument
Examples from AI knowledge base: aka.ms/cli_ref Read more about the command in reference docs Started dev.azure.com/azure-sdk/internal/_build/results?buildId=
@lsweeney24 Looks like you don't have access privilege to internal
project, as mentioned in the guide:
NOTE: these scripts require being signed in with Azure CLI (https://docs.microsoft.com/cli/azure/authenticate-azure-cli?view=azure-cli-latest) and access to the internal DevOps project (https://dev.azure.com/azure-sdk/internal/)
You can update the recording by running tests in record mode, e.g. set the environment variable AZURE_TEST_MODE
to Record
, and then run the failed test cases, like dotnet run --filter xxx
@lsweeney24 Could you please check the test recording? It looks like one of them is obsolete and requires re-recording: dev.azure.com/azure-sdk/public/_build/results?buildId=2136994&view=logs&j=ef1bf84e-5df0-5e03-d5b9-25aebe74528c&t=5524be56-929a-5516-d55b-c8d3dcbefa11&l=4987
Do you have any docs that explain how to do this?
@lsweeney24 See
main
/sdk/core/Azure.Core.TestFramework/README.md#recorded-testsFollowing the instructions provided I am getting back this error, that "azurestackhci" doesn't exist in the project internal. Is there some onboarding I should have done before hand? [D:\dev\azure-sdk-for-net-forked\sdk\azurestackhci\Azure.ResourceManager.Hci] 09:27:19 $ echo 'PAT' | az devops login --organization dev.azure.com/azure-sdk [D:\dev\azure-sdk-for-net-forked\sdk\azurestackhci\Azure.ResourceManager.Hci] 09:29:30 $ ......\eng\scripts\Start-DevOpsRecordings.ps1 33589 azurestackhci Starting pipeline 'net - azurestackhci - tests' for PR 33589 ERROR: There were no build definitions matching name "net - azurestackhci - tests" in project "internal". ERROR: argument --run-id: expected one argument Examples from AI knowledge base: aka.ms/cli_ref Read more about the command in reference docs Started dev.azure.com/azure-sdk/internal/_build/results?buildId=
@lsweeney24 Looks like you don't have access privilege to
internal
project, as mentioned in the guide:NOTE: these scripts require being signed in with Azure CLI (https://docs.microsoft.com/cli/azure/authenticate-azure-cli?view=azure-cli-latest) and access to the internal DevOps project (https://dev.azure.com/azure-sdk/internal/)
You can update the recording by running tests in record mode, e.g. set the environment variable
AZURE_TEST_MODE
toRecord
, and then run the failed test cases, likedotnet run --filter xxx
Sorry for my confusion here, but I am not understanding what needs done. I tried to follow the above and not getting the results expected. I can see that 'internal' project in ado and click around the repo, so I didn't think permissions was an issue. If that is the easiest way to get the tests generated, how do I get access to it?
Sorry for my confusion here, but I am not understanding what needs done. I tried to follow the above and not getting the results expected. I can see that 'internal' project in ado and click around the repo, so I didn't think permissions was an issue. If that is the easiest way to get the tests generated, how do I get access to it?
@lsweeney24 I think I found the root cause. The section you mentioned is for data plane only. So there is no build definition under internal
project for HCI mgmt SDK.
The doc is not clear and needs fixing. Meanwhile, you can refer to this doc on how to record the tests for mgmt sdk.
I have followed the directions, but I am still unable to get the tests to record. As the instructions have shown I need to set my environment variables:
I created a service principal with enough access on the sub, but upon running them I get back an error, this client Id is not the one I am using, so I am not sure where it's pulling it from. I even noticed there is a "variables" section in the recorded JSON that I updated to point to the correct sub and client id.
The [RecordedTest] attribute attempted to re-record, but failed:
Azure.RequestFailedException : The client 'c84acdb1-c1a3-.....' with object id 'c84acdb1-c1a3-.....' does not have authorization to perform action 'Microsoft.Resources/subscriptions/read' over scope '/subscriptions/a9280d5f-f9ab-436e-90cb-b6b9863c5551' or the scope is invalid. If access was recently granted, please refresh your credentials. Status: 403 (Forbidden) ErrorCode: AuthorizationFailed
Content: { "error": { "code": "AuthorizationFailed", "message": "The client 'c84acdb1-c1a3-....' with object id 'c84acdb1-c1a3-....' does not have authorization to perform action 'Microsoft.Resources/subscriptions/read' over scope '/subscriptions/a9280d5f-f9ab-436e-90cb-b6b9863c5551' or the scope is invalid. If access was recently granted, please refresh your credentials." } }
Hi @lsweeney24, could you please debug the test to see if the correct environment variables could be gotten here?