U-SQL Script using environment/current Storage Account name RRS feed

  • Question

  • I have a handful of U-SQL scripts that I store in ADLS in a known location (like /code/u-sql/scripts).  I have three or four environments in different regions (Dev, QA, Prod...) in which I have my ADLA resource also using a (blob) Storage Account.

    In my u-sql scripts I have hard-coded the Storage Account resource name (which is DIFFERENT in each environment), like this:

    DECLARE @filename string = "TestDataFile1.csv";
    DECLARE @product = "food";
    DECLARE @domain = "dairy";
    //blob storage format:
    DECLARE @storageType string = "wasb";
    DECLARE @storageAcct string = "mystorageaccountprod";
    DECLARE @storageSuffix string = ".blob.core.windows.net";
    DECLARE @baseURI string = @storageType + "://" + "acme" + "@" + @storageAcct + @storageSuffix ;

    The line that defines and sets the @storageAcct with "mystorageaccountprod" needs to be different for each environment.  I would like a "dynamic" way to do this by obtaining the registered Storage Account instead of using a hard-coded value in each environment.

    Bill Blakey

    Monday, November 26, 2018 11:14 PM

All replies

  • Hi Bill,

    My vote is no, there is no easy way to do this in USQL.  Of course anything is possible with automation, depending on how much work you want to put into it.  

    Tuesday, November 27, 2018 10:15 PM