https://github.com/mechdeveloper/windows-containers
A repository for windows containers
https://github.com/mechdeveloper/windows-containers
Last synced: about 1 month ago
JSON representation
A repository for windows containers
- Host: GitHub
- URL: https://github.com/mechdeveloper/windows-containers
- Owner: mechdeveloper
- License: mit
- Created: 2022-09-17T18:28:37.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-18T16:28:42.000Z (over 3 years ago)
- Last Synced: 2025-06-14T03:37:58.779Z (12 months ago)
- Language: Shell
- Size: 28.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Windows Contianers
## Setup Azure
```bash
# login to Azure CLI
az login
# list subscriptions
az account list
# Specify subscription to use
az account set --subscription="SUBSCRIPTION_ID"
# Create service principle
az ad sp create-for-rbac --role="Contributor" --scopes="/subscriptions/SUBSCRIPTION_ID"
# {
# "appId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # cient_id
# "displayName": "azure-cli-2022-09-18-09-36-29",
# "password": "prN8Q~XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", # client_secret
# "tenant": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # tennant_id
# }
# login with service principle
az login --service-principal -u CLIENT_ID -p CLIENT_SECRET --tenant TENANT_ID
# we should be able to list the VM sizes
az vm list-sizes --location westus
# logout
az logout
```
## Configuring the Service Principal in Terraform by storing the credentials as Environment Variables
```bash
export ARM_CLIENT_ID=""
export ARM_CLIENT_SECRET=""
export ARM_SUBSCRIPTION_ID=""
export ARM_TENANT_ID=""
```
## Terraform commands
```bash
# initialize terraform
terraform init
# format configuration
terraform fmt
# validate the configuration
terraform validate
# apply configuration
terraform apply
# inspect current state
terraform show
# review state file using state commands
terraform state
# list resources in the state
terraform state list
# destroy resources managed by your project
terraform destroy
```
# Terraform Cloud
```bash
# login to terraform cloud
terraform login
# generate a token and add it to CLI
```
We could also add CLI token as environment variable, to use terraform CLI directly without using `terraform login` flow
```bash
export TF_TOKEN_app_terraform_io=TOKEN_FOR_APP_TERRAFORM_IO
```