-
Notifications
You must be signed in to change notification settings - Fork 290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support azcliversion
#164
Comments
Yes, I hope this request gets prioritized. I came here from Azure/cli#56 (comment) where builds started to fail one day without any changes on our end. We need to be able to pin the version to guarantee stable builds... |
There's a workaround that invokes - uses: azure/CLI@v1
with:
azcliversion: 2.28.0
inlineScript: |
AZ_PYTHON_PARSE_CODE='import sys, re; s = "".join(sys.stdin.readlines()); data = {a: b for a, b in [x.split(":") for x in re.sub("[\s\"]", "", s)[1:-1].split(",")]}'
AZ_CLIENT_ID="$(python3 -c "$AZ_PYTHON_PARSE_CODE; print(data['clientId'])" <<< "$AZ_CRED")"
AZ_CLIENT_SECRET="$(python3 -c "$AZ_PYTHON_PARSE_CODE; print(data['clientSecret'])" <<< "$AZ_CRED")"
AZ_SUBSCRIPTION_ID="$(python3 -c "$AZ_PYTHON_PARSE_CODE; print(data['subscriptionId'])" <<< "$AZ_CRED")"
AZ_TENANT_ID="$(python3 -c "$AZ_PYTHON_PARSE_CODE; print(data['tenantId'])" <<< "$AZ_CRED")"
az login --service-principal -u "$AZ_CLIENT_ID" -p "$AZ_CLIENT_SECRET" --tenant "$AZ_TENANT_ID"
az account set --subscription "$AZ_SUBSCRIPTION_ID"
env:
AZ_CRED: ${{ secrets.creds }} You can also use it in a composite action like this. Parsing |
This issue is idle because it has been open for 14 days with no activity. |
Also would resolve microsoft/azure-container-apps#28 |
This issue is idle because it has been open for 14 days with no activity. |
Ping |
This issue is idle because it has been open for 14 days with no activity. |
Pong |
Here the issue is when there is a compact issue that arises when a workflow uses both CLI and azure login actions. So if the cli latest is incompatible with the cli from the runner, workflows might fail. In order to avoid this issue, CLI action now implements a new strategy that checks for the runner CLI version and defaults to it unless an explicit version is provided in |
@BALAGA-GAYATRI I'm going to be rather honest in this but i don't understand the solution. Using the Azure CLI GitHub action is a know workaround and something that all of us had to apply when Microsoft did this breaking change without releasing a major version. See: We don't want to use this workaround, the whole point of this GitHub action is to login. I read though the docs in detail that you point to and I can't see any documentation about this magic that you are taking about. If you have some magic in this GitHub action please document it in this action and don't point to the Azure CLI GitHub action. Also please provide a link to the PR where this was implemented. So we have a chance of understanding how this works. |
Hey @NissesSenap Main reason for raising the issue:So when az-cli came up with a new version using MSAL removing ADAL, it basically changed the way credentials are stored in the machine. So at that time users having both these actions (i.e, |
I know, i have spent allot of time working around this issue. To me it makes sense to keep this issue open until the issue is solved. How else will keep track of it? |
Another option could be that you say that it will never be implemented and then we know that at least :) |
Azure CLI Action supports
azcliversion
:https://github.com/Azure/cli/blob/master/src/main.ts#L25
In case of Azure CLI compatibility issue or bug, it is possible to revert to old versions of Azure CLI.
But, Azure Login doesn't have
azcliversion
: https://github.com/Azure/login/blob/master/src/main.tsIn case of
az login
compatibility issue or bug, there is no way for Azure Login to recover.Related issues:
The text was updated successfully, but these errors were encountered: