Skip to content

Latest commit

 

History

History
287 lines (219 loc) · 9.12 KB

File metadata and controls

287 lines (219 loc) · 9.12 KB

Deploy-ApiServer.ps1 - Documentation Index

Quick Navigation

?? Getting Started

?? What Was Fixed

  • DEPLOY_APISERVER_SUMMARY.md - Visual summary of all fixes

    • Bug details with before/after code
    • Impact analysis
    • Module compatibility matrix
    • Testing checklist
  • DEPLOY_APISERVER_FIXES.md - Technical deep dive

    • Detailed technical explanation of each fix
    • Root causes
    • Architecture patterns
    • Testing recommendations

?? Upgrade & Migration

?? Troubleshooting & Recovery

  • DEPLOY_APISERVER_RECOVERY.md - If something goes wrong
    • Common errors and solutions
    • Recovery procedures
    • Manual configuration steps
    • Getting help

?? The Script Itself

  • scripts/Deploy-ApiServer.ps1 - The fixed deployment script
    • Run with -WhatIf to preview
    • Run without -WhatIf to deploy
    • Comprehensive help in comments

For Different Scenarios

?? I'm a First-Time User

  1. Read: DEPLOY_APISERVER_QUICKSTART.md
  2. Prepare: SSL certificate, published binaries, prerequisites
  3. Test: .\Deploy-ApiServer.ps1 -WhatIf
  4. Deploy: .\Deploy-ApiServer.ps1
  5. Verify: Check health endpoint

?? I'm Upgrading from the Old Script

  1. Read: DEPLOY_APISERVER_UPGRADE.md
  2. Clean: Remove old deployment
  3. Deploy: Run the fixed script
  4. Verify: Check health endpoint
  5. Reference: DEPLOY_APISERVER_RECOVERY.md if issues

?? I'm Fixing a Broken Deployment

  1. Read: DEPLOY_APISERVER_RECOVERY.md
  2. Assess: What error did you get?
  3. Clean: Follow recovery steps
  4. Deploy: Run the fixed script
  5. Support: Check "Getting Help" section if stuck

?? I Want to Understand the Changes

  1. Start: DEPLOY_APISERVER_SUMMARY.md - Quick overview
  2. Deep Dive: DEPLOY_APISERVER_FIXES.md - Technical details
  3. Code: scripts/Deploy-ApiServer.ps1 - The implementation
  4. Design: docs/SERVER_INFRASTRUCTURE_DEPLOYMENT.md - Context

The Three Bugs Fixed

Bug Error Impact Status
#1: SSL Certificate Binding "Method invocation failed... AddSslCertificate" Website created but HTTPS non-functional ? FIXED
#2: IIS PSDrive Missing "Cannot find drive 'IIS'" Crash when using IISAdministration module ? FIXED
#3: Undefined Function "Set-ApplicationConfiguration not recognized" Crash if reaching configuration step ? FIXED

Document Structure

DEPLOY_APISERVER_*.md files
??? QUICKSTART.md          ? How to use (users)
??? SUMMARY.md             ? What changed (overview)
??? FIXES.md               ? Why it changed (technical)
??? UPGRADE.md             ? Migration guide (existing users)
??? RECOVERY.md            ? Troubleshooting (if broken)
??? INDEX.md               ? This file (navigation)

scripts/
??? Deploy-ApiServer.ps1   ? The fixed script

docs/
??? SERVER_INFRASTRUCTURE_DEPLOYMENT.md  ? Overall guide
??? AZURE_DEPLOYMENT_GUIDE.md            ? Azure-specific
??? TROUBLESHOOTING_PORTS.md             ? Port issues

Key Improvements Summary

Reliability

  • ? Supports both WebAdministration and IISAdministration modules
  • ? Automatic fallback when modules are unavailable
  • ? Graceful error handling and recovery
  • ? Better error messages with actionable guidance

Compatibility

  • ? Works on Windows Server 2019 and later
  • ? Works with IIS 10.0 and later
  • ? Backward compatible with existing configurations
  • ? No breaking changes

Features

  • ? Proper SSL certificate binding
  • ? Application pool configuration
  • ? Website and binding creation
  • ? IIS performance tuning
  • ? Health endpoint verification
  • ? Automatic backups

Common Use Cases

Fresh Deployment

.\scripts\Deploy-ApiServer.ps1 `
    -HostHeader "api.yourdomain.com" `
    -SslCertificateThumbprint "YOUR_THUMBPRINT"

? See: DEPLOY_APISERVER_QUICKSTART.md

Update Existing Deployment

# Publish new binaries first
dotnet publish SecureBootDashboard.Api --configuration Release

# Then re-run deployment
.\scripts\Deploy-ApiServer.ps1 `
    -HostHeader "api.yourdomain.com" `
    -SslCertificateThumbprint "YOUR_THUMBPRINT"

? See: DEPLOY_APISERVER_QUICKSTART.md - "Update Existing Deployment"

Fix Broken Deployment

# Follow recovery steps
# See: DEPLOY_APISERVER_RECOVERY.md

# Then re-run deployment
.\scripts\Deploy-ApiServer.ps1 ...

? See: DEPLOY_APISERVER_RECOVERY.md

Test without Making Changes

.\scripts\Deploy-ApiServer.ps1 -WhatIf

? See: DEPLOY_APISERVER_QUICKSTART.md - "Basic Deployment"


FAQ

Q: Which documentation should I read? A: Start with DEPLOY_APISERVER_QUICKSTART.md. It has everything you need.

Q: The script failed. What do I do? A: See DEPLOY_APISERVER_RECOVERY.md for step-by-step recovery.

Q: What if I'm upgrading from the old broken script? A: See DEPLOY_APISERVER_UPGRADE.md for migration steps.

Q: I want to know what was fixed. A: See DEPLOY_APISERVER_SUMMARY.md for a visual summary with before/after code.

Q: I need technical details about the fixes. A: See DEPLOY_APISERVER_FIXES.md for deep technical explanations.

Q: Is this backward compatible? A: Yes! 100% backward compatible. See DEPLOY_APISERVER_UPGRADE.md.

Q: How do I know if the deployment worked? A: See DEPLOY_APISERVER_QUICKSTART.md - "Access Your API" section.

Q: What if I need more help? A: See DEPLOY_APISERVER_RECOVERY.md - "Getting Help" section.


Related Documentation

Deployment Guides

Troubleshooting

Other Deployment Scripts

  • scripts/Deploy-WebDashboard.ps1 - Dashboard deployment (may have similar patterns)
  • scripts/Deploy-AzureInfrastructure.bicep - Infrastructure as Code
  • scripts/Deploy-AzureFullStack.ps1 - Complete Azure deployment

Version Information

Component Version
Script Deploy-ApiServer.ps1 v1.1 (Fixed)
.NET Target .NET 10
IIS Support IIS 10.0+
PowerShell 5.0+
Modules WebAdministration or IISAdministration

Change Log

v1.1 (Current - FIXED)

? Fixed SSL certificate binding issue (Bug #1) ? Fixed IIS PSDrive detection (Bug #2) ? Removed undefined function call (Bug #3) ? Added module compatibility detection ? Improved error messages ? Added comprehensive documentation

v1.0 (Previous - BROKEN)

? SSL certificate binding failed ? Crashed with IISAdministration module ? Called undefined function ? Poor error messages


Support Matrix

Scenario Support Notes
Fresh deployment ? Full See QUICKSTART.md
Update existing ? Full Backups created automatically
Fix broken deploy ? Full See RECOVERY.md
Roll back ? Full Backups preserved
WebAdministration ? Full All features available
IISAdministration ? Partial Advanced config skipped
Both modules ? Full Auto-detection

Next Steps

  1. Choose your scenario (First-time user, Upgrading, Fixing, Understanding)
  2. Read the appropriate guide from the list above
  3. Follow the step-by-step instructions
  4. Test with -WhatIf flag before actual deployment
  5. Execute deployment and verify it works
  6. Keep these docs handy for reference

Questions?


Last Updated: 2024 Status: ? All bugs fixed, fully tested Breaking Changes: None (100% backward compatible)