Azure, Kafka, Docker, Kubernetes, and AWS.
Tags: azure, kafka, docker, kubernetes
Published: 2024-02-28 20:26:59

Full-stack developer working with technologies like Azure, Kafka, Docker, Kubernetes, and AWS. Keep in mind that this is a basic guide, and you might need to refer to official documentation and resources for more in-depth understanding.

### Azure

**Azure CLI:**
```bash
# Login to Azure
az login

# List available subscriptions
az account list --output table

# Set default subscription
az account set --subscription <subscription_id>

# Create a resource group
az group create --name <resource_group_name> --location <region>
```

**Azure App Service:**
```bash
# Create a web app
az webapp create --resource-group <resource_group_name> --plan <app_service_plan_name> --name <app_name> --runtime <runtime>

# Deploy to Azure App Service
az webapp deployment source config --name <app_name> --resource-group <resource_group_name> --repo-url <repo_url> --branch <branch_name>
```

### Kafka

**Kafka Commands:**
```bash
# Start Zookeeper
bin/zookeeper-server-start.sh config/zookeeper.properties

# Start Kafka broker
bin/kafka-server-start.sh config/server.properties

# Create a topic
bin/kafka-topics.sh --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic <topic_name>

# Produce a message
bin/kafka-console-producer.sh --bootstrap-server localhost:9092 --topic <topic_name>

# Consume messages
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic <topic_name> --from-beginning
```

### Docker

**Docker Basics:**
```bash
# Build a Docker image
docker build -t <image_name> .

# Run a Docker container
docker run -p <host_port>:<container_port> <image_name>

# List running containers
docker ps

# Stop a running container
docker stop <container_id>

# Remove a container
docker rm <container_id>

# Remove an image
docker rmi <image_name>
```

### Kubernetes

**Kubernetes Basics:**
```bash
# Create a deployment
kubectl create deployment <deployment_name> --image=<image_name>

# Expose a deployment as a service
kubectl expose deployment <deployment_name> --port <service_port>

# Scale a deployment
kubectl scale deployment <deployment_name> --replicas=<num_replicas>

# Get pod information
kubectl get pods

# Get service information
kubectl get services
```

### AWS

**AWS CLI:**
```bash
# Configure AWS CLI
aws configure

# List AWS regions
aws ec2 describe-regions --output table

# Create an EC2 instance
aws ec2 run-instances --image-id <ami_id> --instance-type <instance_type> --key-name <key_pair_name> --region <region>

# List S3 buckets
aws s3 ls
```

**AWS Lambda:**
```bash
# Create a Lambda function
aws lambda create-function --function-name <function_name> --runtime <runtime> --role <role_arn> --handler <handler> --code S3Bucket=<bucket>,S3Key=<key>

# Invoke a Lambda function
aws lambda invoke --function-name <function_name> --payload '{"key1":"value1", "key2":"value2"}' <output_file>
```

These commands cover some basic operations with each technology. Remember to replace placeholders like `<...>` with your actual values. For more detailed and specific information, refer to the official documentation for each technology and service.