microsoft / AL-Go

The plug-and-play DevOps solution for Business Central app development on GitHub
MIT License
270 stars 113 forks source link

Release to Environment - 0 Environments #425

Open tscottjendev opened 1 year ago

tscottjendev commented 1 year ago

My Release to Environment it does not seem to be pushing apps to the environment specified. What am I missing?

settings.json contains:

  "environments": [
    "QA",
    "DEVTEST"
  ]

Log output shows no environments.

Trying to get environments from GitHub API main main EnvironmentsJson={"matrix":{"include":[]},"fail-fast":false} EnvironmentCount=0

GitHub Environments defined image

Secrets defined in Repo image

logs_33.zip

jonaswre commented 1 year ago

Im not sure if it makes a diffrence but I always configure my enviroments this way image

And I never mention them in any settings file.

tscottjendev commented 1 year ago

I have setup my Environments and Secrets per your suggestions and l have removed the environments from the settings.json. Still the same results. What am I missing?

Logs: logs_46.zip

tscottjendev commented 1 year ago

I have a different error today related to the deployment from the CICD action. Does it shed any additional light? Ignore the DEV error it should updated at the moment. logs_66.zip

freddydk commented 1 year ago

image Looks like your refreshtoken expired or like

tscottjendev commented 1 year ago

I have create the token per the PowerShell in this article: https://freddysblog.com/2022/05/06/deployment-strategies-and-al-go-for-github/

$AuthContext = New-BcAuthContext -includeDeviceLogin
Get-ALGoAuthContext -bcAuthContext $AuthContext | Set-Clipboard

I get a token that looks like this: {"TenantID":"<tenantID>","Scopes":"https://api.businesscentral.dynamics.com/","RefreshToken":"0.AUgAgIe9q6...oZM"}

Which looks a little different than the token in your article. Your example does not start with {"TenantID":...

Does this look correct?

freddydk commented 1 year ago

Yes, that is correct - the order of properties in the compressed json is random - in my sample, the tenantId and scopes is later (i.e. not visible)

The refreshtoken is only valid for 90 days though - it has to be renewed.

tscottjendev commented 1 year ago

I have refreshed the token and now it does not error out but it doesn't deploy to any environments either.

Logs: logs_73.zip

freddydk commented 1 year ago

It cannot find any environments

tscottjendev commented 1 year ago

Per @jonaswre I have set up my environments image and they match my environments. image

What else do I need to do?

freddydk commented 1 year ago

Looks correct - the pipeline just doesn't find them, cannot see why from here. You can add me to the repo, then I can see if I can see why

tscottjendev commented 1 year ago

@freddydk I am just back from annual leave. Let me get organised and I will add you to the repo.

freddydk commented 1 year ago

Did you manage to make this work - or are you still having issues with this?

tscottjendev commented 1 year ago

I still have this problem and need assistance. Could we arrange some one on one time to work through this?

freddydk commented 1 year ago

Did you upgrade to the latest version of AL-Go for GitHub and try on that one? If you have, and that fails, we can schedule a Teams call tomorrow 11:00 (CET timezone) if you like, then we can have a look at what's wrong. Please send and invite to freddyk at microsoft dot com, thanks

tscottjendev commented 1 year ago

@freddydk any progress on getting this resolved?

tscottjendev commented 1 year ago

Still need to get this resolved.

freddydk commented 6 months ago

Going through old issues - was this one resolved?