[.Net] Cannot install .NET agent via a dockerfile on Azure cloud MSFT hosted agent

Upon using the RUN commands posted in docs(Install .NET agent on Docker container | New Relic Documentation) I get a repository is not signed error on the repos ‘http://deb.debian.org/debian buster InRelease’, ‘http://deb.debian.org/debian buster-updates InRelease’ and ‘http://security.debian.org/debian-security buster/updates InRelease’.

On trying the --allow-insecure-repositories flag alongside the apt-get update command, the above error turns into:
W: The repository ‘http://deb.debian.org/debian buster Release’ does not have a Release file.
W: The repository ‘http://deb.debian.org/debian buster-updates Release’ does not have a Release file.
W: The repository ‘http://security.debian.org/debian-security buster/updates Release’ does not have a Release file.

which culminates in status code 470 and “E: Some index files failed to download. They have been ignored, or old ones used instead.”

I am unable to install the agent on containers due to this issue. Kindly advise.

An extra line allows apt-get update to work.

# Install the agent

RUN sed -i '/buster-updates/d' /etc/apt/sources.list  # THIS EXTRA LINE IS NEEDED\

&& apt-get update && apt-get install -y wget ca-certificates gnupg \

&& echo 'deb http://apt.newrelic.com/debian/ newrelic non-free' | tee /etc/apt/sources.list.d/newrelic.list \

&& wget http://download.newrelic.com/548C16BF.gpg \

&& apt-key add 548C16BF.gpg \

&& apt-get update \

&& apt-get install -y newrelic-netcore20-agent

Would be great if anyone could shine on a light on why this works. Probably need to add to the docs as well.