Skip to content
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

Start and stop VM automatically in CI/CD workflow #48

Closed
3 tasks
Andy-Grigg opened this issue Jan 5, 2022 · 2 comments · Fixed by #65
Closed
3 tasks

Start and stop VM automatically in CI/CD workflow #48

Andy-Grigg opened this issue Jan 5, 2022 · 2 comments · Fixed by #65
Milestone

Comments

@Andy-Grigg
Copy link
Collaborator

Andy-Grigg commented Jan 5, 2022

We should investigate how easy it is to automatically start and stop the VM when we need it. This will reduce the cost of running the machine, since it will only be running when we need it.

  • Have CI/CD workflow wait for machine to respond before running integration tests
  • Have CI/CD workflow start machine if it's not running
  • Have CI/CD workflow stop machine if it started it
@Andy-Grigg Andy-Grigg assigned da1910 and unassigned da1910 Jan 5, 2022
@da1910
Copy link
Collaborator

da1910 commented Jan 5, 2022

We can generate a Service Principal, then optionally federate using OIDC. Those credentials are then stored as a secret and we can use azure cli as normal, we should make sure our principal has the minimum possible permissions, but it should be straightforward to setup.

See this article for the general approach: https://docs.microsoft.com/en-us/azure/app-service/deploy-github-actions?tabs=userlevel

There's some more information about using OIDC which might be a better option for us here: https://docs.microsoft.com/en-us/azure/developer/github/connect-from-azure?tabs=azure-portal%2Clinux#use-the-azure-login-action-with-openid-connect

@akaszynski
Copy link
Contributor

Agree with this approach. Be sure to limit the principal (and the resource group) as much as possible.

@Andy-Grigg Andy-Grigg added this to the Jan2022 milestone Jan 12, 2022
Andy-Grigg pushed a commit that referenced this issue Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants