You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/testing-docs/using-azure-test-framework.md
+14-21Lines changed: 14 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,24 +103,19 @@ For an existing service principal, this command will respect your current settin
103
103
104
104
#### Record Tests
105
105
106
-
After creating the service principal, you will need to grant it access to Azure resources. This can be achieved using the following PowerShell command. The argument for this command is the application ID (See [Service Principal Application ID](https://learn.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal#get-application-id-and-authentication-key))
106
+
You can use either a user account (Recommended) or a Service Principal to record test cases with appropriate permissions.
To use this option, set the following environment variables before starting Visual Studio. The following values are substituted into the below environment variables:
113
-
114
-
`ClientId`
108
+
With user account, you may set the following environment variables:
115
109
116
-
* The [Service Principal Application ID](https://learn.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal#get-application-id-and-authentication-key)
* The [Service Principal Authentication Key](https://learn.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal#get-application-id-and-authentication-key)
115
+
For service principal, you may set the following environment variables:
@@ -140,8 +135,8 @@ The recommended approach for building the connection string is using a config fi
140
135
- If JSON config file exists
141
136
- The Test Framework will use it to build the connection string, ignoring any settings from environment variables.
142
137
- If JSON config file does not exist
143
-
- The Test Framework will first check the TEST_CSM_ORGID_AUTHENTICATION environment variable and use its value to build the connection string.
144
-
-If `HttpRecorderMode` is not set, then the Test Framework will check the `AZURE_TEST_MODE` environment variable.
138
+
- The Test Framework will check the `TEST_CSM_ORGID_AUTHENTICATION` environment variable and use its value to build the connection string.
139
+
-The Test Framework will check the `AZURE_TEST_MODE` environment variable and use its value to build the test mode.
145
140
- If `AZURE_TEST_MODE` is set, its value will be used as the test mode.
146
141
- If `AZURE_TEST_MODE` is not set, the default test mode will be `Playback`.
147
142
@@ -151,10 +146,8 @@ If you are unsure about the settings on your machine, you can run the command `G
151
146
152
147
-[Run the tests](https://github.com/Azure/azure-powershell/blob/main/documentation/development-docs/azure-powershell-developer-guide.md#recordingrunning-tests) and make sure that you have a generated `.json` file that corresponds to the test name, and it should be located under the `SessionRecords` folder within the test project.
153
148
- If you want to switch from Record to Playback or from Playback to Record, consider below steps.
154
-
- If you choose to use a JSON config file, update the value of the property `HttpRecorderMode` in the JSON file.
155
-
- If you prefer environment variables
156
-
- If you have `HttpRecorderMode` defined in the environment variable `TEST_CSM_ORGID_AUTHENTICATION`, update its value accordingly.
157
-
- Otherwise, update the value of `AZURE_TEST_MODE`.
149
+
- If you choose to use a JSON config file, update the value of the property `HttpRecorderMode` in the JSON file directly.
150
+
- If you prefer environment variables, update the value of environment variable `AZURE_TEST_MODE`.
158
151
159
152
## Change Test Environment settings at run-time
160
153
@@ -179,7 +172,7 @@ Changing the above properties at run-time has the potential to hard code few thi
179
172
180
173
#### Issue: exceptions in Microsoft.Azure.Test.HttpRecorder
181
174
182
-
Ensure that the `HttpRecorderMode` in the `TEST_CSM_ORGID_AUTHENTICATION` environment variable is consistent with the value in `AZURE_TEST_MODE`environment variable.
175
+
The `HttpRecorderMode`key in the `TEST_CSM_ORGID_AUTHENTICATION` environment variable has been deprecated. Please remove this key/value pair and use `AZURE_TEST_MODE`instead for recording mode.
0 commit comments