Core Azure Package
The core Azure hosting library provides foundational capabilities for working with Azure resources:- Azure provisioning infrastructure
- Bicep template support
- Azure authentication and credential management
- Common Azure resource patterns
Azure Provisioning
Azure hosting integrations support automatic development-time provisioning, eliminating manual resource configuration.Configuration
Set up Azure provisioning by configuring these values in user secrets:Setting User Secrets
In your AppHost project directory:Developers must have Owner access to the target subscription so that role assignments can be configured for the provisioned resources.
Available Azure Integrations
Azure Cosmos DB
Globally distributed, multi-model database service.Azure Storage
Blob, queue, table, and data lake storage services.Azure Service Bus
Enterprise messaging service with queues and publish-subscribe topics.Other Azure Services
Additional Azure hosting integrations are available:- Azure Key Vault - Secrets and certificate management
- Azure Event Hubs - Big data streaming and event ingestion
- Azure SQL Database - Managed SQL Server database
- Azure PostgreSQL - Managed PostgreSQL database
- Azure Redis Cache - Managed Redis cache
- Azure App Configuration - Application configuration service
- Azure Application Insights - Application performance monitoring
- Azure SignalR Service - Real-time messaging service
- Azure Web PubSub - Publish-subscribe messaging for web apps
Using Bicep Templates
The core Azure hosting library supports custom Bicep templates for resources not covered by specific integrations:Bicep Template Example
Create atemplate.bicep file:
Authentication
Azure hosting integrations use Azure Identity for authentication:- Local Development: Uses your Azure CLI credentials or Visual Studio/VS Code authentication
- Production: Uses managed identities when deployed to Azure
Local Development Setup
Ensure you’re authenticated with Azure:Deployment Modes
Local Development
Run Azure resources locally using emulators when available:Cloud Development
Provision real Azure resources for development:Production Deployment
Deploy to Azure using:azd) handles resource provisioning and application deployment.
Connection String Management
Azure integrations automatically manage connection strings using:- Managed Identity: Preferred for production (no secrets in configuration)
- Access Keys: Used for emulators and when explicitly configured
- Connection Strings: Generated automatically for compatible services
Common Patterns
Multi-Service Application
Environment-Specific Configuration
Resource Naming
Azure resources are named automatically using:- Resource name from
AddXxxmethod - Environment name
- Unique suffix for global uniqueness
Next Steps
Azure Cosmos DB
Add globally distributed NoSQL database
Azure Storage
Add blob, queue, and table storage
Azure Service Bus
Add enterprise messaging
Azure Developer CLI
Learn about azd for deployment