Repository: microsoft/AzureTRE

Issue:
[Task] Change location to azure_location for porter parameters from API
**Description**
 
Change location to azure_location for porter parameters from API - as location appears to be a reserved word for porter




Discussion:

Resolving patch:
diff --git a/management_api_app/db/repositories/workspaces.py b/management_api_app/db/repositories/workspaces.py
--- a/management_api_app/db/repositories/workspaces.py
+++ b/management_api_app/db/repositories/workspaces.py
@@ -46,7 +46,7 @@ def create_workspace_item(self, workspace_create: WorkspaceInCreate) -> Workspac
             raise ValueError(f"The workspace type '{workspace_create.workspaceType}' does not exist")
 
         resource_spec_parameters = {
-            "location": config.RESOURCE_LOCATION,
+            "azure_location": config.RESOURCE_LOCATION,
             "workspace_id": full_workspace_id[-4:],
             "tre_id": config.TRE_ID,
             "address_space": "10.2.1.0/24"  # TODO: Calculate this value - Issue #52
diff --git a/management_api_app/models/schemas/workspace_template.py b/management_api_app/models/schemas/workspace_template.py
--- a/management_api_app/models/schemas/workspace_template.py
+++ b/management_api_app/models/schemas/workspace_template.py
@@ -12,7 +12,7 @@ def get_sample_workspace_template_object(template_name: str = "tre-workspace-van
         description="vanilla workspace bundle",
         version="0.1.0",
         parameters=[
-            Parameter(name="location", type="string"),
+            Parameter(name="azure_location", type="string"),
             Parameter(name="tre_id", type="string"),
             Parameter(name="workspace_id", type="string"),
             Parameter(name="address_space", type="string", default="10.2.1.0/24", description="VNet address space for the workspace services")


Test patch:
diff --git a/management_api_app/tests/test_db/test_repositories/test_workpaces_repository.py b/management_api_app/tests/test_db/test_repositories/test_workpaces_repository.py
--- a/management_api_app/tests/test_db/test_repositories/test_workpaces_repository.py
+++ b/management_api_app/tests/test_db/test_repositories/test_workpaces_repository.py
@@ -61,7 +61,7 @@ def test_create_workspace_item_creates_a_workspace_with_the_right_values(cosmos_
     assert workspace.resourceTemplateName == workspace_type
     assert workspace.resourceType == ResourceType.Workspace
     assert workspace.status == Status.NotDeployed
-    assert "location" in workspace.resourceTemplateParameters
+    assert "azure_location" in workspace.resourceTemplateParameters
     assert "workspace_id" in workspace.resourceTemplateParameters
     assert "tre_id" in workspace.resourceTemplateParameters
     assert "address_space" in workspace.resourceTemplateParameters
diff --git a/scripts/bootstrap_db_for_local_tests.py b/scripts/bootstrap_db_for_local_tests.py
--- a/scripts/bootstrap_db_for_local_tests.py
+++ b/scripts/bootstrap_db_for_local_tests.py
@@ -18,16 +18,20 @@
 def create_workspace_resource(resource_id: str):
     return {
         "id": resource_id,
-        "resourceSpec": {
-            "name": "tre-workspace-vanilla",
-            "version": "0.1.0"
+        "displayName": "My workspace",
+        "description": "workspace for team X",
+        "resourceTemplateName": "tre-workspace-vanilla",
+        "resourceTemplateVersion": "0.1.0",
+        "resourceTemplateParameters": {
+            "azure_location": "westeurope",
+            "workspace_id": "f4a6",
+            "tre_id": "mytre-dev-3142",
+            "address_space": "10.2.1.0/24"
         },
-        "parameters": {
-            "location": "europe"
-        },
-        "resourceType": "workspace",
         "status": "not_deployed",
-        "isDeleted": False
+        "isDeleted": False,
+        "workspaceURL": "",
+        "resourceType": "workspace"
     }