@@ -206,11 +206,15 @@ internal void PackCloudBlobContainerWithAcl(IEnumerable<Tuple<CloudBlobContainer
206
206
return ;
207
207
}
208
208
209
- // Write warning when user SAS credential since get container ACL will fail
210
- AzureStorageContext storageContext = this . GetCmdletStorageContext ( ) ;
211
- if ( storageContext != null && storageContext . StorageAccount != null && storageContext . StorageAccount . Credentials != null && storageContext . StorageAccount . Credentials . IsSAS )
209
+ // Only write warning for SAS when use cmdlet alias Get-AzureStorageContainerAcl, since the cmdlets alias specified get container ACL
210
+ if ( this . MyInvocation . Line . ToLower ( ) . Contains ( "get-azurestoragecontaineracl" ) )
212
211
{
213
- WriteWarning ( "Get Container ACL will fail with SAS token credentials." ) ;
212
+ // Write warning when user SAS credential since get container ACL will fail
213
+ AzureStorageContext storageContext = this . GetCmdletStorageContext ( ) ;
214
+ if ( storageContext != null && storageContext . StorageAccount != null && storageContext . StorageAccount . Credentials != null && storageContext . StorageAccount . Credentials . IsSAS )
215
+ {
216
+ WriteWarning ( "Get container permission will fail with SAS token credentials, it needs storage Account key credentials." ) ;
217
+ }
214
218
}
215
219
216
220
IStorageBlobManagement localChannel = Channel ;
@@ -238,13 +242,10 @@ internal async Task GetContainerPermission(long taskId, IStorageBlobManagement l
238
242
permissions = await localChannel . GetContainerPermissionsAsync ( container , accessCondition ,
239
243
requestOptions , OperationContext , CmdletCancellationToken ) . ConfigureAwait ( false ) ;
240
244
}
241
- catch ( StorageException e )
245
+ catch ( StorageException e ) when ( e . IsNotFoundException ( ) || e . IsForbiddenException ( ) )
242
246
{
243
- if ( ! e . IsNotFoundException ( ) && ! e . IsFordiddenException ( ) )
244
- {
245
- throw ;
246
- }
247
- //404 Not found, or 403 Forbidden means we don't have permission to query the Permission of the specified container.
247
+ // 404 Not found, or 403 Forbidden means we don't have permission to query the Permission of the specified container.
248
+ // Just skip return container permission in this case.
248
249
}
249
250
WriteCloudContainerObject ( taskId , localChannel , container , permissions , continuationToken ) ;
250
251
}
0 commit comments