From 2f2b7943d89c803f96acdd6a0229132dc6b53545 Mon Sep 17 00:00:00 2001 From: yifanz7 <131133995+yifanz7@users.noreply.github.com> Date: Tue, 8 Oct 2024 14:52:25 +0800 Subject: [PATCH] remove anonymous access (#26187) --- src/Storage/LiveTests/Storage.Management/BlobTests.ps1 | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/Storage/LiveTests/Storage.Management/BlobTests.ps1 b/src/Storage/LiveTests/Storage.Management/BlobTests.ps1 index d3aefd44d19b..ad87ab7782ce 100644 --- a/src/Storage/LiveTests/Storage.Management/BlobTests.ps1 +++ b/src/Storage/LiveTests/Storage.Management/BlobTests.ps1 @@ -10,7 +10,7 @@ Invoke-LiveTestScenario -Name "Blob basics" -Description "Test blob basic operat $ContentMD5 = "i727sP7HigloQDsqadNLHw==" $testfile512path = "$PSScriptRoot\TestFiles\testfile512" - $account = New-AzStorageAccount -ResourceGroupName $rgName -Name $storageAccountName -Location $location -SkuName Standard_GRS -AllowBlobPublicAccess $true -AllowSharedKeyAccess $true -Tag @{"Az.Sec.DisableAllowSharedKeyAccess::Skip" = "For Powershell test."} + $account = New-AzStorageAccount -ResourceGroupName $rgName -Name $storageAccountName -Location $location -SkuName Standard_GRS -AllowSharedKeyAccess $true -Tag @{"Az.Sec.DisableAllowSharedKeyAccess::Skip" = "For Powershell test."} $ctx = $account.Context $ctx1 = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey (Get-AzStorageAccountKey -ResourceGroupName $rgName -Name $storageAccountName)[0].Value @@ -24,9 +24,6 @@ Invoke-LiveTestScenario -Name "Blob basics" -Description "Test blob basic operat $accessPolicy = Get-AzStorageContainerStoredAccessPolicy -Container $containerName -Context $ctx Assert-AreNotEqual $null $accessPolicy Assert-AreEqual $accessPolicyName $accessPolicy.Policy - Set-AzStorageContainerAcl -Name $containerName -Permission Blob -Context $ctx - $container = Get-AzStorageContainer -Name $containerName -Context $ctx - Assert-AreEqual "Blob" $container.Permission.PublicAccess # upload $blobName = New-LiveTestResourceName @@ -90,11 +87,6 @@ Invoke-LiveTestScenario -Name "Blob basics" -Description "Test blob basic operat $container = Get-AzStorageContainer -Name $containerName -Context $ctx1 $containerProperties = $container.BlobContainerClient.GetProperties().Value Assert-AreEqual $container.BlobContainerProperties.ETag $containerProperties.ETag - Set-AzStorageContainerAcl -Name $containerName -Permission Blob -Context $ctx1 - $containerProperties = $container.BlobContainerClient.GetProperties().Value - Assert-AreNotEqual $container.BlobContainerProperties.ETag $containerProperties.ETag - $container.FetchAttributes() - Assert-AreEqual $container.BlobContainerProperties.ETag $containerProperties.ETag # sync copy $copyBlobName1 = New-LiveTestResourceName