none
Hide Environment Variables in the Azure Portal RRS feed

  • Question

  • My application uses environment variables to pass a connection string to a container task running on Azure batch. I'd prefer these to be not visible on the Azure Portal when looking at the list of jobs and tasks. Right now these show up in the "Environment Settings" page of a task and are also retained after task completion.

    Azure container instances seems to have a way of handling this problem through secure values as explained at this link.

    https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/container-instances/container-instances-environment-variables.md#secure-values

     I couldn't find a similar facility in the batch API.

    https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.batch.environmentsetting?view=azure-dotnet

    Is this a feature that might be added at some point of time, is there any other way to accomplish this with the current API ?

    Saturday, June 29, 2019 3:28 PM

All replies

  • Hi,

    I think that's not possible now. Like you said the rest apis also had name and value keys only for environment variables.

    But there is another way where you can use certificates to encrypt an decrypt the data.

    In this method, You can specify the certificates to be added to the node pool.

    Those certificates will be installed on the batch nodes.

    Then you can take the encrypted values in the environment variables. In the task, You can refer to the environment variables and certificates decrypt the values.

    Though this method needs some additional logic to be added to your tasks, Users will be seeing the encypted values in the portal.

    Note:

    If a user logs into the Azure batch VM, That user wont be able to see those environment variables. ENV variables are available only to the Azure batch user. 

    I dont know if we have any plans to add this secure env values feature in Azure batch. I will check with the team and let you know.


    Monday, July 1, 2019 6:52 AM
    Moderator
  • Hi,

    Is there any update

    Tuesday, July 23, 2019 6:02 AM
    Moderator