@pytest.mark.live_test_only
@GlobalStorageAccountPreparer()
@AsyncStorageTestCase.await_prepared_test
async def test_sas_signed_identifier(self, resource_group, location, storage_account, storage_account_key):
    (await self._setup(storage_account.name, storage_account_key))
    blob_name = (await self._create_block_blob())
    container = self.bsc.get_container_client(self.container_name)
    blob = self.bsc.get_blob_client(self.container_name, blob_name)
    access_policy = AccessPolicy()
    access_policy.start = (datetime.utcnow() - timedelta(hours=1))
    access_policy.expiry = (datetime.utcnow() + timedelta(hours=1))
    access_policy.permission = BlobSasPermissions(read=True)
    identifiers = {'testid': access_policy}
    resp = (await container.set_container_access_policy(identifiers))
    token = generate_blob_sas(blob.account_name, blob.container_name, blob.blob_name, snapshot=blob.snapshot, account_key=blob.credential.account_key, policy_id='testid')
    service = BlobClient.from_blob_url(blob.url, credential=token)
    result = (await (await service.download_blob()).readall())
    self.assertEqual(self.byte_data, result)
@pytest.mark.live_test_only
@GlobalStorageAccountPreparer()
@AsyncStorageTestCase.await_prepared_test
async def test_sas_signed_identifier(self, resource_group, location, storage_account, storage_account_key):
    (await self._setup(storage_account.name, storage_account_key))
    blob_name = (await self._create_block_blob())
    container = self.bsc.get_container_client(self.container_name)
    blob = self.bsc.get_blob_client(self.container_name, blob_name)
    access_policy = AccessPolicy()
    access_policy.start = (datetime.utcnow() - timedelta(hours=1))
    access_policy.expiry = (datetime.utcnow() + timedelta(hours=1))
    access_policy.permission = BlobSasPermissions(read=True)
    identifiers = {'testid': access_policy}
    resp = (await container.set_container_access_policy(identifiers))
    token = generate_blob_sas(blob.account_name, blob.container_name, blob.blob_name, snapshot=blob.snapshot, account_key=blob.credential.account_key, policy_id='testid')
    service = BlobClient.from_blob_url(blob.url, credential=token)
    result = (await (await service.download_blob()).readall())
    self.assertEqual(self.byte_data, result)