Repository: Azure/azure-sdk-for-python
Pull request #41018: [Tables] Update dev test files
Author: login: pvaneck
Labels: name: Tables
Created: 2025-05-09T23:38:38Z | Merged: 2025-05-19T19:18:43Z

Can get the pipelines green again:

- Converted test-resources.json to test-resources.bicep.
- Updated dev requirements, removing unnecessary requirements.
- Removed unused environment variables from tests.yaml.
- Removed unused test case file.
- Updated tables copy sample to not use/require a separate storage account. Instead, we'll copy from tables to blob storage within the same storage account. 


Diff:
diff --git a/sdk/tables/azure-data-tables/dev_requirements.txt b/sdk/tables/azure-data-tables/dev_requirements.txt
index 1665efb6369e..3ef18e85846c 100644
--- a/sdk/tables/azure-data-tables/dev_requirements.txt
+++ b/sdk/tables/azure-data-tables/dev_requirements.txt
@@ -1,10 +1,7 @@
 -e ../../../tools/azure-sdk-tools
--e ../../cosmos/azure-mgmt-cosmosdb
--e ../../resources/azure-mgmt-resource
 ../../core/azure-core
-../../nspkg/azure-data-nspkg
+../../identity/azure-identity
 # Aiohttp 3.8.6 triggers https://github.com/aio-libs/aiohttp/issues/4581 on pypy for some reasons
 aiohttp<3.8.6 ; platform_python_implementation == "PyPy"
 aiohttp ; platform_python_implementation != "PyPy"
-azure-identity
-python-dateutil>=2.8.0
\ No newline at end of file
+python-dateutil>=2.8.0
diff --git a/sdk/tables/azure-data-tables/samples/async_samples/sample_copy_table_async.py b/sdk/tables/azure-data-tables/samples/async_samples/sample_copy_table_async.py
index 22f2135b6a63..13e812675435 100644
--- a/sdk/tables/azure-data-tables/samples/async_samples/sample_copy_table_async.py
+++ b/sdk/tables/azure-data-tables/samples/async_samples/sample_copy_table_async.py
@@ -19,8 +19,6 @@
     1) TABLES_STORAGE_ENDPOINT_SUFFIX - the Table storage service account URL suffix
     2) TABLES_STORAGE_ACCOUNT_NAME - the Tables storage account name
     3) TABLES_PRIMARY_STORAGE_ACCOUNT_KEY - the Tables storage account access key
-    4) STORAGE_ACCOUNT_NAME - the blob storage account name
-    5) STORAGE_ACCOUNT_KEY - the blob storage account key
 """
 import asyncio
 import json
@@ -63,13 +61,10 @@ def __init__(self):
         self.access_key = os.getenv("TABLES_PRIMARY_STORAGE_ACCOUNT_KEY")
         self.endpoint_suffix = os.getenv("TABLES_STORAGE_ENDPOINT_SUFFIX")
         self.account_name = os.getenv("TABLES_STORAGE_ACCOUNT_NAME")
-        self.table_connection_string = f"DefaultEndpointsProtocol=https;AccountName={self.account_name};AccountKey={self.access_key};EndpointSuffix={self.endpoint_suffix}"
+        self.storage_account_connection_string = f"DefaultEndpointsProtocol=https;AccountName={self.account_name};AccountKey={self.access_key};EndpointSuffix={self.endpoint_suffix}"
         self.copy_to_blob_table_name = "copytoblobtablename" + uuid4().hex
         self.copy_to_table_table_name = "copytotabletablename" + uuid4().hex
-        self.blob_account_name = os.getenv("STORAGE_ACCOUNT_NAME")
-        self.blob_account_key = os.getenv("STORAGE_ACCOUNT_KEY")
-        self.blob_connection_string = f"DefDefaultEndpointsProtocol=https;AccountName={self.blob_account_name};AccountKey={self.blob_account_key};EndpointSuffix=core.windows.net"
-        self.blob_service_client = BlobServiceClient.from_connection_string(self.blob_connection_string)
+        self.blob_service_client = BlobServiceClient.from_connection_string(self.storage_account_connection_string)
         self.entity: EntityType = {
             "PartitionKey": "color",
             "text": "Marker",
@@ -110,7 +105,7 @@ async def copy_table_from_blob_to_table(self):
             blob_list = self.container_client.list_blobs()
             # Upload entities to a table
             table_service_client = TableServiceClient.from_connection_string(
-                conn_str=self.table_connection_string, table_name=self.copy_to_table_table_name
+                conn_str=self.storage_account_connection_string, table_name=self.copy_to_table_table_name
             )
             self.table_client = table_service_client.get_table_client(self.copy_to_table_table_name)
             await self.table_client.create_table()
@@ -129,7 +124,7 @@ async def copy_table_from_blob_to_table(self):
 
     async def _setup_table(self):
         table_service_client = TableServiceClient.from_connection_string(
-            conn_str=self.table_connection_string, table_name=self.copy_to_blob_table_name
+            conn_str=self.storage_account_connection_string, table_name=self.copy_to_blob_table_name
         )
         self.table_client = table_service_client.get_table_client(self.copy_to_blob_table_name)
         await self.table_client.create_table()
diff --git a/sdk/tables/azure-data-tables/samples/sample_copy_table.py b/sdk/tables/azure-data-tables/samples/sample_copy_table.py
index 6237e0bbf60f..ead1d5790fc9 100644
--- a/sdk/tables/azure-data-tables/samples/sample_copy_table.py
+++ b/sdk/tables/azure-data-tables/samples/sample_copy_table.py
@@ -19,8 +19,6 @@
     1) TABLES_STORAGE_ENDPOINT_SUFFIX - the Table storage service account URL suffix
     2) TABLES_STORAGE_ACCOUNT_NAME - the Tables storage account name
     3) TABLES_PRIMARY_STORAGE_ACCOUNT_KEY - the Tables storage account access key
-    4) STORAGE_ACCOUNT_NAME - the blob storage account name
-    5) STORAGE_ACCOUNT_KEY - the blob storage account key
 """
 import json
 import os
@@ -62,13 +60,10 @@ def __init__(self):
         self.access_key = os.getenv("TABLES_PRIMARY_STORAGE_ACCOUNT_KEY")
         self.endpoint_suffix = os.getenv("TABLES_STORAGE_ENDPOINT_SUFFIX")
         self.account_name = os.getenv("TABLES_STORAGE_ACCOUNT_NAME")
-        self.table_connection_string = f"DefaultEndpointsProtocol=https;AccountName={self.account_name};AccountKey={self.access_key};EndpointSuffix={self.endpoint_suffix}"
+        self.storage_account_connection_string = f"DefaultEndpointsProtocol=https;AccountName={self.account_name};AccountKey={self.access_key};EndpointSuffix={self.endpoint_suffix}"
         self.copy_to_blob_table_name = "copytoblobtablename" + uuid4().hex
         self.copy_to_table_table_name = "copytotabletablename" + uuid4().hex
-        self.blob_account_name = os.getenv("STORAGE_ACCOUNT_NAME")
-        self.blob_account_key = os.getenv("STORAGE_ACCOUNT_KEY")
-        self.blob_connection_string = f"DefDefaultEndpointsProtocol=https;AccountName={self.blob_account_name};AccountKey={self.blob_account_key};EndpointSuffix=core.windows.net"
-        self.blob_service_client = BlobServiceClient.from_connection_string(self.blob_connection_string)
+        self.blob_service_client = BlobServiceClient.from_connection_string(self.storage_account_connection_string)
         self.entity: EntityType = {
             "PartitionKey": "color",
             "text": "Marker",
@@ -109,7 +104,7 @@ def copy_table_from_blob_to_table(self):
             blob_list = self.container_client.list_blobs()
             # Upload entities to a table
             table_service_client = TableServiceClient.from_connection_string(
-                conn_str=self.table_connection_string, table_name=self.copy_to_table_table_name
+                conn_str=self.storage_account_connection_string, table_name=self.copy_to_table_table_name
             )
             self.table_client = table_service_client.get_table_client(self.copy_to_table_table_name)
             self.table_client.create_table()
@@ -128,7 +123,7 @@ def copy_table_from_blob_to_table(self):
 
     def _setup_table(self):
         table_service_client = TableServiceClient.from_connection_string(
-            conn_str=self.table_connection_string, table_name=self.copy_to_blob_table_name
+            conn_str=self.storage_account_connection_string, table_name=self.copy_to_blob_table_name
         )
         self.table_client = table_service_client.get_table_client(self.copy_to_blob_table_name)
         self.table_client.create_table()
diff --git a/sdk/tables/azure-data-tables/tests/_shared/cosmos_testcase.py b/sdk/tables/azure-data-tables/tests/_shared/cosmos_testcase.py
deleted file mode 100644
index 454ead45117f..000000000000
--- a/sdk/tables/azure-data-tables/tests/_shared/cosmos_testcase.py
+++ /dev/null
@@ -1,115 +0,0 @@
-# --------------------------------------------------------------------------
-# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-# --------------------------------------------------------------------------
-import functools
-
-from azure.mgmt.cosmosdb import CosmosDBManagementClient
-from azure.mgmt.storage.models import StorageAccount
-from azure.mgmt.cosmosdb.models import (
-    DatabaseAccountCreateUpdateParameters,
-    Capability,
-)
-
-from devtools_testutils import AzureMgmtPreparer, AzureTestError, ResourceGroupPreparer, FakeResource
-
-FakeCosmosAccount = FakeResource
-RESOURCE_GROUP_PARAM = "resource_group"
-
-# Cosmos Account Preparer and its shorthand decorator
-
-
-class CosmosAccountPreparer(AzureMgmtPreparer):
-    def __init__(
-        self,
-        name_prefix="",
-        sku="Standard_LRS",
-        location="westus",
-        kind="StorageV2",
-        parameter_name="cosmos_account",
-        resource_group_parameter_name=RESOURCE_GROUP_PARAM,
-        disable_recording=True,
-        playback_fake_resource=None,
-        client_kwargs=None,
-        random_name_enabled=True,
-        use_cache=False,
-    ):
-        super(CosmosAccountPreparer, self).__init__(
-            name_prefix,
-            24,
-            disable_recording=disable_recording,
-            playback_fake_resource=playback_fake_resource,
-            client_kwargs=client_kwargs,
-            random_name_enabled=random_name_enabled,
-        )
-        self.location = location
-        self.sku = sku
-        self.kind = kind
-        self.resource_group_parameter_name = resource_group_parameter_name
-        self.parameter_name = parameter_name
-        self.cosmos_key = ""
-        self.cosmos_account_name = ""
-        self.primary_endpoint = ""
-        self.resource_moniker = self.name_prefix
-        self.set_cache(use_cache, sku, location, name_prefix)
-        if random_name_enabled:
-            self.resource_moniker += "cosmosname"
-
-    def create_resource(self, name, **kwargs):
-        if self.is_live:
-            capabilities = Capability(name="EnableTable")
-            db_params = DatabaseAccountCreateUpdateParameters(
-                capabilities=[capabilities],
-                locations=[{"location_name": self.location}],
-                location=self.location,
-            )
-
-            self.client = self.create_mgmt_client(CosmosDBManagementClient)
-            group = self._get_resource_group(**kwargs)
-            cosmos_async_operation = self.client.database_accounts.begin_create_or_update(group.name, name, db_params)
-            self.resource = cosmos_async_operation.result()
-
-            cosmos_keys = self.client.database_accounts.list_keys(group.name, name)
-            self.cosmos_key = cosmos_keys.primary_master_key
-            self.cosmos_account_name = name
-
-            self.test_class_instance.scrubber.register_name_pair(name, self.resource_moniker)
-            self.primary_endpoint = "https://{}.table.cosmos.azure.com:443/".format(name)
-        else:
-            self.resource = StorageAccount(location=self.location)
-            self.resource.name = name
-            self.resource.id = name
-            self.primary_endpoint = "https://{}.table.cosmos.azure.com:443/".format(name)
-            self.cosmos_key = "ZmFrZV9hY29jdW50X2tleQ=="
-            self.cosmos_account_name = name
-        return {
-            self.parameter_name: self.resource,
-            "{}_key".format(self.parameter_name): self.cosmos_key,
-            "{}_cs".format(self.parameter_name): ";".join(
-                [
-                    "DefaultEndpointsProtocol=https",
-                    "AccountName={}".format(self.cosmos_account_name),
-                    "AccountKey={}".format(self.cosmos_key),
-                    "TableEndpoint={}".format(self.primary_endpoint),
-                ]
-            ),
-        }
-
-    def remove_resource(self, name, **kwargs):
-        if self.is_live:
-            group = self._get_resource_group(**kwargs)
-            self.client.database_accounts.delete(group.name, name, polling=False)
-
-    def _get_resource_group(self, **kwargs):
-        try:
-            return kwargs.get(self.resource_group_parameter_name)
-        except KeyError:
-            template = (
-                "To create a cosmos instance a resource group is required. Please add "
-                "decorator @{} in front of this cosmos account preparer."
-            )
-            raise AzureTestError(template.format(ResourceGroupPreparer.__name__))
-
-
-CachedCosmosAccountPreparer = functools.partial(CosmosAccountPreparer, use_cache=True, random_name_enabled=True)
diff --git a/sdk/tables/test-resources.bicep b/sdk/tables/test-resources.bicep
new file mode 100644
index 000000000000..dac9bd32cc31
--- /dev/null
+++ b/sdk/tables/test-resources.bicep
@@ -0,0 +1,132 @@
+@description('The base resource name.')
+param baseName string
+
+@description('The principal to assign the role to. This is application object id.')
+param testApplicationOid string
+
+@description('The url suffix to use when accessing the storage data plane.')
+param storageEndpointSuffix string = 'core.windows.net'
+
+@description('The url suffix to use when accessing the cosmos data plane.')
+param cosmosEndpointSuffix string = 'cosmos.azure.com'
+
+var location = resourceGroup().location
+var primaryAccountName = '${replace(replace(baseName, '-', ''), '_', '')}prim'
+
+var customCosmosRoleName = 'Azure Cosmos DB SDK role for Table Data Plane'
+
+resource roleAssignment 'Microsoft.Authorization/roleAssignments@2018-09-01-preview' = {
+  name: guid('tableDataContributorRoleId', resourceGroup().id)
+  properties: {
+    roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '0a9a7e1f-b9d0-4cc4-a60d-0319b160aaa3')
+    principalId: testApplicationOid
+  }
+}
+
+resource storageAccount 'Microsoft.Storage/storageAccounts@2023-05-01' = {
+  name: primaryAccountName
+  location: location
+  sku: {
+    name: 'Standard_RAGRS'
+  }
+  kind: 'StorageV2'
+  properties: {
+    networkAcls: {
+      bypass: 'AzureServices'
+      virtualNetworkRules: []
+      ipRules: []
+      defaultAction: 'Allow'
+    }
+    supportsHttpsTrafficOnly: true
+    encryption: {
+      services: {
+        file: {
+          enabled: true
+        }
+        blob: {
+          enabled: true
+        }
+      }
+      keySource: 'Microsoft.Storage'
+    }
+    accessTier: 'Cool'
+    minimumTlsVersion: 'TLS1_2'
+  }
+}
+
+resource cosmosAccount 'Microsoft.DocumentDB/databaseAccounts@2020-04-01' = {
+  name: primaryAccountName
+  location: location
+  tags: {
+    defaultExperience: 'Azure Table'
+    CosmosAccountType: 'Non-Production'
+  }
+  kind: 'GlobalDocumentDB'
+  properties: {
+    enableAutomaticFailover: false
+    enableMultipleWriteLocations: false
+    isVirtualNetworkFilterEnabled: false
+    virtualNetworkRules: []
+    disableKeyBasedMetadataWriteAccess: false
+    enableFreeTier: false
+    enableAnalyticalStorage: false
+    databaseAccountOfferType: 'Standard'
+    consistencyPolicy: {
+      defaultConsistencyLevel: 'BoundedStaleness'
+      maxIntervalInSeconds: 86400
+      maxStalenessPrefix: 1000000
+    }
+    locations: [
+      {
+        locationName: location
+        failoverPriority: 0
+        isZoneRedundant: false
+      }
+    ]
+    capabilities: [
+      {
+        name: 'EnableTable'
+      }
+    ]
+    ipRules: []
+  }
+}
+
+resource cosmosRoleDef 'Microsoft.DocumentDB/databaseAccounts/tableRoleDefinitions@2024-12-01-preview' = {
+  name: guid(customCosmosRoleName, 'roleDefinitionId')
+  parent: cosmosAccount
+  properties: {
+    roleName: customCosmosRoleName
+    permissions: [
+      {
+        dataActions: [
+          'Microsoft.DocumentDB/databaseAccounts/readMetadata'
+          'Microsoft.DocumentDB/databaseAccounts/tables/*'
+          'Microsoft.DocumentDB/databaseAccounts/tables/containers/*'
+          'Microsoft.DocumentDB/databaseAccounts/tables/containers/entities/*'
+          'Microsoft.DocumentDB/databaseAccounts/throughputSettings/read'
+        ]
+      }
+    ]
+    assignableScopes: [
+      cosmosAccount.id
+    ]
+  }
+}
+
+resource cosmosRoleAssignment 'Microsoft.DocumentDB/databaseAccounts/tableRoleAssignments@2024-12-01-preview' = {
+  name: guid(customCosmosRoleName, 'roleAssignmentId')
+  parent: cosmosAccount
+  properties: {
+    scope: cosmosAccount.id
+    roleDefinitionId: cosmosRoleDef.id
+    principalId: testApplicationOid
+  }
+}
+
+output TABLES_STORAGE_ENDPOINT_SUFFIX string = storageEndpointSuffix
+output TABLES_STORAGE_ACCOUNT_NAME string = primaryAccountName
+output TABLES_PRIMARY_STORAGE_ACCOUNT_KEY string = storageAccount.listKeys().keys[0].value
+output TABLES_COSMOS_ENDPOINT_SUFFIX string = cosmosEndpointSuffix
+output TABLES_COSMOS_ACCOUNT_NAME string = primaryAccountName
+output TABLES_PRIMARY_COSMOS_ACCOUNT_KEY string = cosmosAccount.listKeys().primaryMasterKey
diff --git a/sdk/tables/test-resources.json b/sdk/tables/test-resources.json
deleted file mode 100644
index 84e88fb22dc4..000000000000
--- a/sdk/tables/test-resources.json
+++ /dev/null
@@ -1,192 +0,0 @@
-{
-    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
-    "contentVersion": "1.0.0.0",
-    "parameters": {
-        "baseName": {
-            "type": "String"
-        },
-        "testApplicationOid": {
-            "type": "string",
-            "metadata": {
-                "description": "The principal to assign the role to. This is application object id."
-            }
-        },
-        "storageEndpointSuffix": {
-          "type": "string",
-          "defaultValue": "core.windows.net",
-          "metadata": {
-              "description": "The url suffix to use when accessing the storage data plane."
-          }
-        },
-        "cosmosEndpointSuffix": {
-          "type": "string",
-          "defaultValue": "cosmos.azure.com",
-          "metadata": {
-              "description": "The url suffix to use when accessing the cosmos data plane."
-          }
-        }
-    },
-    "variables": {
-        "mgmtApiVersion": "2019-04-01",
-        "authorizationApiVersion": "2018-09-01-preview",
-        "blobDataContributorRoleId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/0a9a7e1f-b9d0-4cc4-a60d-0319b160aaa3')]",
-        "location": "[resourceGroup().location]",
-        "primaryAccountName": "[concat(parameters('baseName'), 'prim')]",
-        "encryption": {
-            "services": {
-                "file": {
-                    "enabled": true
-                },
-                "blob": {
-                    "enabled": true
-                }
-            },
-            "keySource": "Microsoft.Storage"
-        },
-        "networkAcls": {
-            "bypass": "AzureServices",
-            "virtualNetworkRules": [],
-            "ipRules": [],
-            "defaultAction": "Allow"
-        },
-        "customCosmosRoleName": "Azure Cosmos DB SDK role for Table Data Plane",
-        "customCosmosRoleDescription": "Azure Cosmos DB SDK role for Table Data Plane",
-        "customCosmosRoleActions": [
-            "Microsoft.DocumentDB/databaseAccounts/readMetadata",
-            "Microsoft.DocumentDB/databaseAccounts/tables/*",
-            "Microsoft.DocumentDB/databaseAccounts/tables/containers/*",
-            "Microsoft.DocumentDB/databaseAccounts/tables/containers/entities/*",
-            "Microsoft.DocumentDB/databaseAccounts/throughputSettings/read"
-        ]
-    },
-    "resources": [
-        {
-            "type": "Microsoft.Authorization/roleAssignments",
-            "apiVersion": "[variables('authorizationApiVersion')]",
-            "name": "[guid(concat('tableDataContributorRoleId', resourceGroup().id))]",
-            "properties": {
-                "roleDefinitionId": "[variables('blobDataContributorRoleId')]",
-                "principalId": "[parameters('testApplicationOid')]"
-            }
-        },
-        {
-            "type": "Microsoft.Storage/storageAccounts",
-            "apiVersion": "[variables('mgmtApiVersion')]",
-            "name": "[variables('primaryAccountName')]",
-            "location": "[variables('location')]",
-            "sku": {
-                "name": "Standard_RAGRS",
-                "tier": "Standard"
-            },
-            "kind": "StorageV2",
-            "properties": {
-                "networkAcls": "[variables('networkAcls')]",
-                "supportsHttpsTrafficOnly": true,
-                "encryption": "[variables('encryption')]",
-                "accessTier": "Cool",
-                "minimumTlsVersion": "TLS1_2"
-            }
-        },
-        {
-            "type": "Microsoft.DocumentDB/databaseAccounts",
-            "apiVersion": "2020-04-01",
-            "name": "[variables('primaryAccountName')]",
-            "location": "[variables('location')]",
-            "tags": {
-                "defaultExperience": "Azure Table",
-                "hidden-cosmos-mmspecial": "",
-                "CosmosAccountType": "Non-Production"
-            },
-            "kind": "GlobalDocumentDB",
-            "properties": {
-                "publicNetworkAccess": "Enabled",
-                "enableAutomaticFailover": false,
-                "enableMultipleWriteLocations": false,
-                "isVirtualNetworkFilterEnabled": false,
-                "virtualNetworkRules": [],
-                "disableKeyBasedMetadataWriteAccess": false,
-                "enableFreeTier": false,
-                "enableAnalyticalStorage": false,
-                "databaseAccountOfferType": "Standard",
-                "consistencyPolicy": {
-                    "defaultConsistencyLevel": "BoundedStaleness",
-                    "maxIntervalInSeconds": 86400,
-                    "maxStalenessPrefix": 1000000
-                },
-                "locations": [
-                    {
-                        "locationName": "[variables('location')]",
-                        "provisioningState": "Succeeded",
-                        "failoverPriority": 0,
-                        "isZoneRedundant": false
-                    }
-                ],
-                "capabilities": [
-                    {
-                        "name": "EnableTable"
-                    }
-                ],
-                "ipRules": []
-            }
-        },
-        {
-            "dependsOn": [
-                "[resourceId('Microsoft.DocumentDB/databaseAccounts', variables('primaryAccountName'))]"
-            ],
-            "type": "Microsoft.DocumentDB/databaseAccounts/tableRoleDefinitions",
-            "apiVersion": "2024-05-15",
-            "name": "[concat(variables('primaryAccountName'), '/', guid(variables('customCosmosRoleName')))]",
-            "properties": {
-                "roleName": "[variables('customCosmosRoleName')]",
-                "description": "[variables('customCosmosRoleDescription')]",
-                "permissions": [
-                    {
-                        "dataActions": "[variables('customCosmosRoleActions')]"
-                    }
-                ],
-                "assignableScopes": [
-                    "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', resourceGroup().name, '/providers/Microsoft.DocumentDB/databaseAccounts/', variables('primaryAccountName'))]"
-                ]
-            }
-        },
-        {
-            "dependsOn": [
-                "[resourceId('Microsoft.DocumentDB/databaseAccounts/tableRoleDefinitions', variables('primaryAccountName'), guid(variables('customCosmosRoleName')))]"
-            ],
-            "type": "Microsoft.DocumentDB/databaseAccounts/tableRoleAssignments",
-            "apiVersion": "2024-05-15",
-            "name": "[concat(variables('primaryAccountName'), '/', guid(variables('customCosmosRoleName')))]",
-            "properties": {
-                "scope": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', resourceGroup().name, '/providers/Microsoft.DocumentDB/databaseAccounts/', variables('primaryAccountName'))]",
-                "roleDefinitionId": "[resourceId('Microsoft.DocumentDB/databaseAccounts/tableRoleDefinitions', variables('primaryAccountName'), guid(variables('customCosmosRoleName')))]",
-                "principalId": "[parameters('testApplicationOid')]"
-            }
-        }
-    ],
-    "outputs": {
-        "TABLES_STORAGE_ENDPOINT_SUFFIX": {
-            "type": "string",
-            "value": "[parameters('storageEndpointSuffix')]"
-        },
-        "TABLES_STORAGE_ACCOUNT_NAME": {
-            "type": "string",
-            "value": "[variables('primaryAccountName')]"
-        },
-        "TABLES_PRIMARY_STORAGE_ACCOUNT_KEY": {
-            "type": "string",
-            "value": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('primaryAccountName')), variables('mgmtApiVersion')).keys[0].value]"
-        },
-        "TABLES_COSMOS_ENDPOINT_SUFFIX": {
-            "type": "string",
-            "value": "[parameters('cosmosEndpointSuffix')]"
-        },
-        "TABLES_COSMOS_ACCOUNT_NAME": {
-            "type": "string",
-            "value": "[variables('primaryAccountName')]"
-        },
-        "TABLES_PRIMARY_COSMOS_ACCOUNT_KEY": {
-            "type": "string",
-            "value": "[listKeys(resourceId('Microsoft.DocumentDB/databaseAccounts', variables('primaryAccountName')), '2020-04-01').primaryMasterKey]"
-        }
-    }
-}
diff --git a/sdk/tables/tests.yml b/sdk/tables/tests.yml
index 9b8d3e605f6d..828889a10551 100644
--- a/sdk/tables/tests.yml
+++ b/sdk/tables/tests.yml
@@ -9,13 +9,6 @@ extends:
       MatrixReplace:
         - TestSamples=.*/true
       EnvVars:
-        STORAGE_ACCOUNT_NAME: $(python-storage-storage-account-name)
-        STORAGE_ACCOUNT_KEY: $(python-storage-storage-account-key)
-        BLOB_STORAGE_ACCOUNT_NAME: $(python-storage-blob-storage-account-name)
-        BLOB_STORAGE_ACCOUNT_KEY: $(python-storage-blob-storage-account-key)
-        OAUTH_STORAGE_ACCOUNT_NAME: $(python-storage-oauth-storage-account-name)
-        OAUTH_STORAGE_ACCOUNT_KEY: $(python-storage-oauth-storage-account-key)
-        BLOB_CONNECTION_STRING: $(python-storage-blob-connection-string)
         TEST_MODE: 'RunLiveNoRecord'
         AZURE_SKIP_LIVE_RECORDING: 'True'
         AZURE_TEST_RUN_LIVE: 'true'


Reviews:
user: login: copilot-pull-request-reviewer[bot]
body: ## Pull Request Overview

This PR updates the Tables dev test files in an effort to get the pipelines working again by cleaning up configuration, deprecating legacy resource definitions, and aligning sample code with the new connection string approach.
- Removed several environment variable definitions from tests.yml.
- Deleted the legacy test-resources.json and added a new Bicep-based test resource file.
- Updated samples (synchronous and asynchronous) to use a unified storage account connection string and removed obsolete blob-specific configurations.

### Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

<details>
<summary>Show a summary per file</summary>

| File                                                        | Description                                                                                |
|-------------------------------------------------------------|--------------------------------------------------------------------------------------------|
| sdk/tables/tests.yml                                        | Removed extraneous storage and OAuth environment variables from the test configuration.    |
| sdk/tables/test-resources.json                              | Removed legacy JSON test resource file.                                                    |
| sdk/tables/test-resources.bicep                              | Added a new Bicep template for test resource deployment using updated API versions.          |
| sdk/tables/azure-data-tables/tests/_shared/cosmos_testcase.py | Deleted deprecated Cosmos DB test case; review test coverage for Cosmos scenarios.         |
| sdk/tables/azure-data-tables/samples/sample_copy_table.py     | Renamed connection string variable and updated usage to remove blob-specific configuration.  |
| sdk/tables/azure-data-tables/samples/async_samples/sample_copy_table_async.py | Updated asynchronous sample to use the unified storage account connection string. |
| sdk/tables/azure-data-tables/dev_requirements.txt            | Updated the azure-identity dependency path for local dependency resolution.                |
</details>



<details>
<summary>Comments suppressed due to low confidence (5)</summary>

**sdk/tables/tests.yml:10**
* Removed sensitive storage configuration settings; please ensure that any tests relying on these environment variables are updated accordingly.
```
STORAGE_ACCOUNT_NAME: $(python-storage-storage-account-name)
```
**sdk/tables/test-resources.json:1**
* test-resources.json has been removed. Confirm that all functionalities provided by this file have been fully migrated to test-resources.bicep.
```
Entire file removed
```
**sdk/tables/azure-data-tables/tests/_shared/cosmos_testcase.py:1**
* The removal of cosmos_testcase.py may impact Cosmos DB test coverage; please confirm that equivalent tests exist elsewhere.
```
Entire file removed
```
**sdk/tables/test-resources.bicep:95**
* The use of a preview API version for table role definitions should be validated against production requirements or replaced with a stable API version if available.
```
resource cosmosRoleDef 'Microsoft.DocumentDB/databaseAccounts/tableRoleDefinitions@2024-12-01-preview' = {
```
**sdk/tables/azure-data-tables/dev_requirements.txt:3**
* The dependency path for azure-identity has been updated; verify that local dependency resolution is configured correctly in all development environments.
```
../../identity/azure-identity
```
</details>


state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-14T18:32:19Z
user: login: kristapratico
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-05-19T18:09:20Z

Review comments:
diff_hunk: @@ -62,13 +60,10 @@ def __init__(self):
         self.access_key = os.getenv("TABLES_PRIMARY_STORAGE_ACCOUNT_KEY")
         self.endpoint_suffix = os.getenv("TABLES_STORAGE_ENDPOINT_SUFFIX")
         self.account_name = os.getenv("TABLES_STORAGE_ACCOUNT_NAME")
-        self.table_connection_string = f"DefaultEndpointsProtocol=https;AccountName={self.account_name};AccountKey={self.access_key};EndpointSuffix={self.endpoint_suffix}"
+        self.storage_account_connection_string = f"DefaultEndpointsProtocol=https;AccountName={self.account_name};AccountKey={self.access_key};EndpointSuffix={self.endpoint_suffix}"
path: sdk/tables/azure-data-tables/samples/sample_copy_table.py
user: login: Copilot
body: [nitpick] Renaming the connection string variable improves clarity; please update any related documentation or comments to reflect this change consistently.
created_at: 2025-05-14T18:32:18Z
author_association: CONTRIBUTOR
diff_hunk: @@ -63,13 +61,10 @@ def __init__(self):
         self.access_key = os.getenv("TABLES_PRIMARY_STORAGE_ACCOUNT_KEY")
         self.endpoint_suffix = os.getenv("TABLES_STORAGE_ENDPOINT_SUFFIX")
         self.account_name = os.getenv("TABLES_STORAGE_ACCOUNT_NAME")
-        self.table_connection_string = f"DefaultEndpointsProtocol=https;AccountName={self.account_name};AccountKey={self.access_key};EndpointSuffix={self.endpoint_suffix}"
+        self.storage_account_connection_string = f"DefaultEndpointsProtocol=https;AccountName={self.account_name};AccountKey={self.access_key};EndpointSuffix={self.endpoint_suffix}"
path: sdk/tables/azure-data-tables/samples/async_samples/sample_copy_table_async.py
user: login: Copilot
body: [nitpick] Ensure that the updated connection string usage in the asynchronous sample is documented consistently with the synchronous sample.
created_at: 2025-05-14T18:32:18Z
author_association: CONTRIBUTOR

PR comments:
user: login: pvaneck
created_at: 2025-05-09T23:39:52Z
body: /azp run python - tables - tests
author_association: MEMBER
user: login: azure-pipelines[bot]
created_at: 2025-05-09T23:40:10Z
body: <samp>
Azure Pipelines successfully started running 1 pipeline(s).<br>

</samp>
author_association: NONE
user: login: pvaneck
created_at: 2025-05-12T21:30:47Z
body: /azp run python - tables - tests
author_association: MEMBER
user: login: azure-pipelines[bot]
created_at: 2025-05-12T21:31:07Z
body: <samp>
Azure Pipelines successfully started running 1 pipeline(s).<br>

</samp>
author_association: NONE
user: login: pvaneck
created_at: 2025-05-12T23:23:27Z
body: /azp run python - tables - tests
author_association: MEMBER
user: login: azure-pipelines[bot]
created_at: 2025-05-12T23:23:44Z
body: <samp>
Azure Pipelines successfully started running 1 pipeline(s).<br>

</samp>
author_association: NONE
user: login: pvaneck
created_at: 2025-05-13T23:11:19Z
body: /azp run python - tables - tests
author_association: MEMBER
user: login: azure-pipelines[bot]
created_at: 2025-05-13T23:11:36Z
body: <samp>
Azure Pipelines successfully started running 1 pipeline(s).<br>

</samp>
author_association: NONE