diff --git a/tools/azure-devtools/src/azure_devtools/scenario_tests/recording_processors.py b/tools/azure-devtools/src/azure_devtools/scenario_tests/recording_processors.py index b098b4f2c229..cd2c306692c1 100644 --- a/tools/azure-devtools/src/azure_devtools/scenario_tests/recording_processors.py +++ b/tools/azure-devtools/src/azure_devtools/scenario_tests/recording_processors.py @@ -49,6 +49,11 @@ def process_response(self, response): self.replace_header_fn(response, 'location', self._replace_subscription_id) self.replace_header_fn(response, 'azure-asyncoperation', self._replace_subscription_id) + try: + response["url"] = self._replace_subscription_id(response["url"]) + except KeyError: + pass + return response def _replace_subscription_id(self, val): @@ -221,6 +226,11 @@ def process_response(self, response): self.replace_header(response, 'operation-location', old, new) self.replace_header(response, 'azure-asyncoperation', old, new) + try: + response["url"] = response["url"].replace(old, new) + except KeyError: + pass + return response