Closed tej-walker closed 5 years ago
Are you setting AZURE_BATCH_ENDPOINT? The error states that https://docs.microsoft.com/en-us/java/api/com.microsoft.azure.batch.auth.batchsharedkeycredentials?view=azure-java-stable is failing to be created due to https://github.com/Azure-Samples/azure-batch-samples/blob/4bc4fc74d38b1cece15f5c2e84809cf2842f8db4/Java/PoolAndResourceFile/src/main/java/PoolAndResourceFile.java#L305 being null
I did set all the batch and storage account information. below are the "sample" keys how I did:
String batchAccount = System.getenv("batchaccountname");
String batchKey = System.getenv("PrimaryAccessKey");
String batchUri = System.getenv("https://xxxx.yyyy.batch.azure.com");
String storageAccountName = System.getenv("storageaccountname");
String storageAccountKey = System.getenv("Key1");
Note: All the above info I have taken from the batch account--> Keys section
This section of code gets environment variables for the keys provided in System.getenv(). Unless you are setting the environment variables in your system to be value=value it appears this is a misunderstanding of what environment variables are?
I figured it out (the env variables were already set). I restarted the machine and tried, it worked. Probably I should have opened a new command prompt and try it. Thank you so much for investing your time to debug this issue.
I am new to Azure Batch Service, I have followed the README of Java Samples and included the batch and storage details. everything is doubled checked and correct. But when I run, it fails with below error: I baseUrl is returning as null when I did a syso, is it something todo with batchUri vs baseUrl? need help: