Creating Your First Application Service
This guide will walk you through the process of creating and configuring a new application service on the Microsoft Developer Network (MSDN) platform. Application services are the backbone of modern cloud-native applications, providing scalable and resilient infrastructure for your code.
Prerequisites
Before you begin, ensure you have the following:
- An active MSDN developer account.
- Your application code ready for deployment.
- Basic understanding of containerization (Docker is recommended).
Step-by-Step Creation
1. Access the Service Dashboard
Log in to your MSDN portal and navigate to the "Application Services" section. You'll see a dashboard displaying your existing services. Click on the "Create New Service" button.
2. Configure Service Basics
A form will appear asking for basic information:
- Service Name: A unique, descriptive name for your service (e.g.,
user-api,auth-service). - Region: Choose the geographical region closest to your users for optimal performance.
- Runtime Environment: Select the language and version your application uses (e.g., Node.js 18, Python 3.10, .NET 7).
- Deployment Method: You can choose to deploy from a container image (Docker Hub, Azure Container Registry) or directly from source code.
3. Define Resources and Scaling
In this section, you specify the resources your application will need and how it should scale:
- CPU and Memory: Allocate CPU cores and RAM for each instance of your service.
- Initial Instance Count: The number of service instances to start with.
- Auto-Scaling Rules: Configure rules to automatically increase or decrease the number of instances based on metrics like CPU utilization, memory usage, or request latency.
4. Configure Networking and Access
Define how your service will be accessed:
- Port: The port your application listens on (e.g., 80, 8080).
- Public Access: Enable or disable direct public access to your service. It's recommended to use API gateways or load balancers for production environments.
- Environment Variables: Set any necessary environment variables for your application (e.g., database connection strings, API keys).
5. Advanced Options (Optional)
Depending on your needs, you can configure:
- Health Checks: Define endpoints that the platform can query to determine if your service is healthy.
- Logging and Monitoring: Integrate with centralized logging and monitoring tools.
- Custom Domains: Map your own domain names to the service.
Example Configuration (YAML)
Here's a simplified example of how your service configuration might look in a YAML format:
apiVersion: v1
kind: AppService
metadata:
name: my-web-app
region: eastus
spec:
runtime:
language: nodejs
version: "18"
deployment:
method: container
image: "docker.io/myorg/my-web-app:latest"
resources:
cpu: 500m # 0.5 CPU core
memory: 1024Mi # 1GB RAM
scaling:
minInstances: 2
maxInstances: 10
rules:
- metric: cpu
target: 70 # Scale up when CPU exceeds 70%
- metric: memory
target: 80 # Scale up when memory exceeds 80%
networking:
port: 3000
publicAccess: true
environment:
NODE_ENV: production
DATABASE_URL: &secret_db_url "secrets://my-db/connection_string"
healthChecks:
livenessProbe:
path: "/healthz"
intervalSeconds: 30
Next Steps
Once your service is created, you can:
- Monitor its performance and logs.
- Update its configuration or deploy new versions.
- Connect it with other services using environment variables or service discovery.