File tree Expand file tree Collapse file tree
sdk/storage/Azure.Storage.Files.Shares Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22 "AssetsRepo" : " Azure/azure-sdk-assets" ,
33 "AssetsRepoPrefixPath" : " net" ,
44 "TagPrefix" : " net/storage/Azure.Storage.Files.Shares" ,
5- "Tag" : " net/storage/Azure.Storage.Files.Shares_a938f2e083 "
5+ "Tag" : " net/storage/Azure.Storage.Files.Shares_3a253f1460 "
66}
Original file line number Diff line number Diff line change @@ -368,6 +368,30 @@ await TestHelper.AssertExpectedExceptionAsync<RequestFailedException>(
368368 await share . DeleteAsync ( false ) ;
369369 }
370370
371+ /// <summary>
372+ /// This test exists to ensure AuthenticationErrorDetail is being properly communicated to the customer.
373+ /// </summary>
374+ [ RecordedTest ]
375+ [ ServiceVersion ( Min = ShareClientOptions . ServiceVersion . V2024_08_04 ) ]
376+ public async Task CreateAsync_SasError ( )
377+ {
378+ // Arrange
379+ var shareName = GetNewShareName ( ) ;
380+ ShareServiceClient service = SharesClientBuilder . GetServiceClient_SharedKey ( ) ;
381+ Uri sasUri = service . GenerateAccountSasUri ( AccountSasPermissions . All , GetUtcNow ( ) . AddDays ( - 1 ) , AccountSasResourceTypes . All ) ;
382+ ShareServiceClient unauthorizedServiceClient = InstrumentClient ( new ShareServiceClient ( sasUri ) ) ;
383+ ShareClient share = InstrumentClient ( unauthorizedServiceClient . GetShareClient ( shareName ) ) ;
384+
385+ // Act
386+ await TestHelper . AssertExpectedExceptionAsync < RequestFailedException > (
387+ share . CreateAsync ( ) ,
388+ e =>
389+ {
390+ Assert . AreEqual ( "AuthenticationFailed" , e . ErrorCode ) ;
391+ Assert . IsTrue ( e . Message . Contains ( "AuthenticationErrorDetail" ) ) ;
392+ } ) ;
393+ }
394+
371395 [ RecordedTest ]
372396 public async Task CreateAsync_WithAccountSas ( )
373397 {
You can’t perform that action at this time.
0 commit comments