question

DeanNicholson-1780 avatar image
0 Votes"
DeanNicholson-1780 asked DeanNicholson-1780 answered

Elastic job deployed by ARM Template fails with error 'Bad Length.'

I have an Elastic Job deployed via ARM Template that fails on step 1 with error 'Bad Length.' Google error and there are no hits. Job has 6 steps. Troubleshooting steps: Delete job and recreate via SQL and it runs fine. Deploy again by SDP and it fails on step 1 with same error. Execute sql code in Step 1 deployed by SDP from SSMS and it executes successfully. Retrieved sql code from jobs.jobsteps. Deleted step 1then started job and it failed on Step 1 (old step 2) with 'Bad Length.' re-added Step 1 as Step 1 via TSQL. Started the job and the Step 1 succeeded. Step 2 failed with 'Bad Length.' No entries in log analytics Not sure what to try next.

azure-sql-database
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @DeanNicholson-1780, welcome to Microsoft Q&A forum and sorry for the trouble you have been facing.

Would you be able to share the ARM template by masking out the sensitive data? That would help us in understanding the exact root cause.

0 Votes 0 ·
DeanNicholson-1780 avatar image
0 Votes"
DeanNicholson-1780 answered AnuragSharma-MSFT commented

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @DeanNicholson-1780, thanks for providing the templates. I am checking this and will get back at the earliest.

1 Vote 1 ·
AnuragSharma-MSFT avatar image
0 Votes"
AnuragSharma-MSFT answered

hi @DeanNicholson-1780, I was trying to run the templates but there were few configuration I was not able to sort out. Could you help me with below parameters?

  1. credentials_ElasticDbJob_SqlUsername

  2. credentials_CentralDataLoad_Sqlusername

Are these scoped credentials? If yes, please tell me which databases are these created on and have we added any permissions here?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DeanNicholson-1780 avatar image
0 Votes"
DeanNicholson-1780 answered

Hi @AnuragSharma-MSFT Sorry for not responding sooner

1) Is the sql login/user that runs the elastic job
2) is the same sql login that the target server job 'outputs' back to the CentralLoad database which happens to be the same db that holds the elastic job. I expect this to change in the future but is how it is currently set up. 1 sql account runs it all.

in the elasticJobDB
CREATE DATABASE SCOPED CREDENTIAL GroupEnumCred WITH IDENTITY = 'SqlAccount',
SECRET = '';
GO

  • Create a database scoped credential for for Job execution
    CREATE DATABASE SCOPED CREDENTIAL JobExeccred WITH IDENTITY = 'SqlAccount',
    SECRET = '';
    GO
    --On ElasticJobDB Server
    CREATE LOGIN [SqlAccount]
    WITH
    PASSWORD = '';
    CREATE USER [SqlAccount]
    FOR LOGIN [SqlAccount];
    GO
    --on ElasticJobDB
    CREATE USER [SqlAccount]
    FOR LOGIN [SqlAccount];
    GO
    Create ROLE ElasticJobUser AUTHORIZATION dbo
    ALTER ROLE ElasticJobUser ADD MEMBER [SqlAccount]
    ALTER ROLE db_owner ADD MEMBER ElasticJobUser

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.