Home
%3CLINGO-SUB%20id%3D%22lingo-sub-369098%22%20slang%3D%22en-US%22%3EExtended%20Events%3A%20Azure%20Storage%20Account%20Types%20Matter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-369098%22%20slang%3D%22en-US%22%3E%0A%20%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CSTRONG%3EFirst%20published%20on%20MSDN%20on%20Nov%2002%2C%202018%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%20I%20recently%20had%20a%20client%20approach%20me%20on%20an%20error%20that%20they%20persistently%20encountered%20when%20attempting%20to%20start%20an%20extended%20event%20session%20in%20the%20%3CEM%3E%20Azure%20SQL%20Database%20%3C%2FEM%3E%20service.%26nbsp%3B%20The%20SqlException%20error%20message%20consisted%20of%20the%20following%3A%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3EMsg%2025602%2C%20Level%2016%2C%20State%201%2C%20Line%20178%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThe%20target%2C%20%220DCF1903-7977-40A7-B7A8-339AA9D8D7F0.package0.event_file%22%2C%20encountered%20a%20configuration%20error%20during%20initialization.%20Object%20cannot%20be%20added%20to%20the%20event%20session.%20The%20operating%20system%20returned%20error%2013%3A%20'The%20data%20is%20invalid.'%20while%20creating%20the%20file%20'https%3A%2F%2F%3CSTORAGE%20account%3D%22%22%3E.blob.core.windows.net%2F%3CCONTAINER%3E%2Feevent_3_0_131856532944580000.xel'.%3C%2FCONTAINER%3E%3C%2FSTORAGE%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20The%20error%20message%20tells%20us%20that%20there%20was%20a%20problem%20encountered%20when%20attempting%20to%20write%20to%20the%20blob%20container%20specified.%26nbsp%3B%20We%20reviewed%20the%20associated%20storage%20account%E2%80%99s%20configuration%20to%20verify%20that%20SQL%20Database%20had%20permission%20to%20perform%20%3CEM%3E%20read%20%3C%2FEM%3E%20%2C%20%3CEM%3E%20write%20%3C%2FEM%3E%20%2C%20and%20%3CEM%3E%20list%20%3C%2FEM%3E%20operations%3B%20and%20re-created%20the%20%3CEM%3E%20DATABASE%20SCOPED%20CREDENTIAL%20%3C%2FEM%3E%20defined%20to%20ensure%20the%20%3CEM%3E%20SECRET%20%3C%2FEM%3E%20value%20was%20the%20full%20%3CEM%3E%20Shared%20Access%20Signature%20%3C%2FEM%3E%20query%20string%20(minus%20the%20character%2C%20%E2%80%98%3F%E2%80%99%2C%20of%20course).%26nbsp%3B%20We%20also%20confirmed%20that%20extended%20event%20sessions%20had%20targeted%20the%20correct%20storage%20account%20container%20endpoint.%26nbsp%3B%20Still%2C%20despite%20the%20aforementioned%2C%20the%20issue%20had%20persist.%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20Curious%20about%20this%2C%20the%20client%20was%20asked%20to%20identify%20the%20storage%20account%20type%20being%20used.%26nbsp%3B%20The%20client%20confirmed%20that%20they%20were%20using%20the%20%3CEM%3E%20blob%20storage%20account%20type%20%3C%2FEM%3E%20.%26nbsp%3B%20When%20attempting%20to%20use%20a%20%3CEM%3E%20general-purpose%20v2%20account%20type%20%3C%2FEM%3E%20%2C%20however%2C%20the%20issue%20does%20not%20occur.%26nbsp%3B%20I%20then%20reviewed%20Azure%20storage%20documentation%20at%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fstorage%2Fcommon%2Fstorage-account-overview%23types-of-storage-accounts%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fstorage%2Fcommon%2Fstorage-account-overview%23types-of-storage-accounts%20%3C%2FA%3E%20to%20compare%20the%20differences%20between%20the%20storage%20account%20types%20we%20offer.%26nbsp%3B%20It%20turns%20out%2C%20the%20%3CEM%3E%20blob%20storage%20account%20type%20%3C%2FEM%3E%20only%20supports%20%3CEM%3E%20block%20%3C%2FEM%3E%20and%20%3CEM%3E%20append%20%3C%2FEM%3E%20blobs%3B%20%3CEM%3E%20page%20%3C%2FEM%3E%20blobs%20are%20not%20supported.%26nbsp%3B%20Extended%20events%20are%20written%20as%20%3CEM%3E%20page%20%3C%2FEM%3E%20blobs%2C%20as%20they%20are%20written%20to%20storage%20as%20random-accessible%20pages.%26nbsp%3B%20This%20was%20why%20an%20error%20occurred%20when%20attempting%20to%20write%20extended%20event%20data%20to%20an%20Azure%20%3CEM%3E%20blob%20storage%20account%20type%20%3C%2FEM%3E%20.%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20Unfortunately%2C%20%E2%80%9C%20%3CEM%3E%20Azure%20storage%20%3C%2FEM%3E%20%2C%E2%80%9D%20and%2C%20%E2%80%9C%20%3CEM%3E%20blob%20storage%20%3C%2FEM%3E%20%2C%E2%80%9D%20are%20referenced%20interchangeably%20as%20service%20concepts%20throughout%20many%20of%20our%20documents%2C%20which%20can%20inadvertently%20give%20the%20illusion%20that%2C%20%E2%80%9C%20%3CEM%3E%20blob%20storage%20%3C%2FEM%3E%20%2C%E2%80%9D%20supports%20all%20blob%20types%20(%20%3CEM%3E%20block%20%3C%2FEM%3E%20%2C%20%3CEM%3E%20append%20%3C%2FEM%3E%20%2C%20and%20%3CEM%3E%20page%20%3C%2FEM%3E%20)%20when%2C%20in%20reality%2C%20the%20%3CEM%3E%20blob%20storage%20account%20type%20%3C%2FEM%3E%20specifically%20does%20not.%26nbsp%3B%20I%20thus%20wanted%20to%20take%20a%20moment%20to%20share%20this%20experience%20in%20case%20someone%20should%20run%20into%20this%20scenario%20in%20the%20future.%26nbsp%3B%20As%20for%20a%20solution%20to%20the%20matter%2C%20options%20are%20limited%20to%20upgrading%20the%20%3CEM%3E%20blob%20storage%20account%20type%20%3C%2FEM%3E%20to%20a%20%3CEM%3E%20general-purpose%20v2%20%3C%2FEM%3E%20%3B%20or%2C%20to%20use%20another%20storage%20account%20that%20is%20of%20type%20%3CEM%3E%20general-purpose%20%3C%2FEM%3E%20(v2%20preferably%2C%20since%20v2%20uses%20Azure%20Resource%20Manager).%26nbsp%3B%20Instructions%20on%20the%20former%20can%20be%20found%20here%3A%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fstorage%2Fcommon%2Fstorage-account-upgrade%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fstorage%2Fcommon%2Fstorage-account-upgrade%20%3C%2FA%3E%20.%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20If%20anyone%20is%20looking%20for%20direction%20on%20how%20to%20set%20up%20extended%20events%20with%20general-purpose%20storage%20account%20types%2C%20please%20refer%20to%20my%20colleague%E2%80%99s%20blog%20at%20%3CA%20href%3D%22https%3A%2F%2Fblogs.msdn.microsoft.com%2Fazuresqldbsupport%2F2018%2F03%2F13%2Fextended-events-capture-step-by-step-walkthgrough%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20https%3A%2F%2Fblogs.msdn.microsoft.com%2Fazuresqldbsupport%2F2018%2F03%2F13%2Fextended-events-capture-step-by-step-walkthgrough%2F%20%3C%2FA%3E%20.%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-369098%22%20slang%3D%22en-US%22%3EFirst%20published%20on%20MSDN%20on%20Nov%2002%2C%202018%20I%20recently%20had%20a%20client%20approach%20me%20on%20an%20error%20that%20they%20persistently%20encountered%20when%20attempting%20to%20start%20an%20extended%20event%20session%20in%20the%20Azure%20SQL%20Database%20service.%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-369098%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20SQL%20Database%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Eblob%20storage%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Eextended%20events%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Egeneral%20purpose%20storage%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Epage%20blob%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Ethe%20data%20is%20invalid%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Not applicable
First published on MSDN on Nov 02, 2018
I recently had a client approach me on an error that they persistently encountered when attempting to start an extended event session in the Azure SQL Database service.  The SqlException error message consisted of the following:


Msg 25602, Level 16, State 1, Line 178


The target, "0DCF1903-7977-40A7-B7A8-339AA9D8D7F0.package0.event_file", encountered a configuration error during initialization. Object cannot be added to the event session. The operating system returned error 13: 'The data is invalid.' while creating the file 'https://<storage account>.blob.core.windows.net/<container>/eevent_3_0_131856532944580000.xel'.




The error message tells us that there was a problem encountered when attempting to write to the blob container specified.  We reviewed the associated storage account’s configuration to verify that SQL Database had permission to perform read , write , and list operations; and re-created the DATABASE SCOPED CREDENTIAL defined to ensure the SECRET value was the full Shared Access Signature query string (minus the character, ‘?’, of course).  We also confirmed that extended event sessions had targeted the correct storage account container endpoint.  Still, despite the aforementioned, the issue had persist.



Curious about this, the client was asked to identify the storage account type being used.  The client confirmed that they were using the blob storage account type .  When attempting to use a general-purpose v2 account type , however, the issue does not occur.  I then reviewed Azure storage documentation at https://docs.microsoft.com/en-us/azure/storage/common/storage-account-overview#types-of-storage-... to compare the differences between the storage account types we offer.  It turns out, the blob storage account type only supports block and append blobs; page blobs are not supported.  Extended events are written as page blobs, as they are written to storage as random-accessible pages.  This was why an error occurred when attempting to write extended event data to an Azure blob storage account type .



Unfortunately, “ Azure storage ,” and, “ blob storage ,” are referenced interchangeably as service concepts throughout many of our documents, which can inadvertently give the illusion that, “ blob storage ,” supports all blob types ( block , append , and page ) when, in reality, the blob storage account type specifically does not.  I thus wanted to take a moment to share this experience in case someone should run into this scenario in the future.  As for a solution to the matter, options are limited to upgrading the blob storage account type to a general-purpose v2 ; or, to use another storage account that is of type general-purpose (v2 preferably, since v2 uses Azure Resource Manager).  Instructions on the former can be found here: https://docs.microsoft.com/en-us/azure/storage/common/storage-account-upgrade .



If anyone is looking for direction on how to set up extended events with general-purpose storage account types, please refer to my colleague’s blog at https://blogs.msdn.microsoft.com/azuresqldbsupport/2018/03/13/extended-events-capture-step-by-st... .