jongio / azureclicredentialcontainer Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
To get this working, I had to downgrade to Azure CLI v2.29 or earlier on both the host and in the container. In the Container this meant changing this line to the following:
RUN apt-get update \
&& apt-get install ca-certificates curl apt-transport-https lsb-release gnupg -y
RUN curl -sL https://packages.microsoft.com/keys/microsoft.asc | \
gpg --dearmor | \
tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null
RUN AZ_REPO=$(lsb_release -cs) \
&& echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | \
tee /etc/apt/sources.list.d/azure-cli.list
RUN apt-get update && \
apt-get install azure-cli=2.29.2-1~buster
and then installing the same version on the host machine from the Azure CLI Releases page
Just a heads up that fetching tokens using this trick in Node JS is very slow -- on the order of 5 minutes to fetch a single token. Here's a minimal reproducible example
Awesome and easy solution, however I run in to issues while following the instructions. I realized that we also need to ensure that curl is installed on the container before we try installing the azure CLI, I have update the docker images as -
FROM mcr.microsoft.com/dotnet/core/runtime:3.1 AS base
WORKDIR /app
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /src
COPY ["AzureCliCredentialContainer.csproj", "./"]
RUN dotnet restore "./AzureCliCredentialContainer.csproj"
COPY . .
WORKDIR "/src/."
RUN dotnet build "AzureCliCredentialContainer.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "AzureCliCredentialContainer.csproj" -c Release -o /app/publish
FROM base AS final
RUN apt-get clean && apt-get update
RUN apt install curl -y
RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "AzureCliCredentialContainer.dll"]
Hi,
I am getting Azure CLI not installed error when running docker-compose even if I put the RUN commands in docker files.
The docker-compose loads 3 separate docker files which all contain this last step:
FROM base AS final
RUN apt-get clean && apt-get update
RUN apt install curl -y
RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash
WORKDIR /app
COPY --from=publish /app/publish .
ENV ASPNETCORE_FORWARDEDHEADERS_ENABLED=true
ENTRYPOINT ["dotnet", "IdentityServer.dll"]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.