|
1 |
| -# Overview |
| 1 | +# Deploy Overview |
2 | 2 |
|
3 | 3 | Deploy usage guide and design decision.
|
4 | 4 |
|
@@ -56,3 +56,64 @@ then user try to deploy
|
56 | 56 |
|
57 | 57 | 1. always using the right resource group
|
58 | 58 | 1. restrictive for user who have already defined their resources
|
| 59 | + |
| 60 | +## Deployment Methodologies |
| 61 | + |
| 62 | +#### 1. Deployment to Function App (rollback disabled) |
| 63 | +- Deploy resource group, upload packaged artifact directly to function app. Sets function app `RUN_FROM_PACKAGE` setting to `1`. |
| 64 | + |
| 65 | +#### 2. Deployment to Blob Storage (rollback enabled) |
| 66 | +- Deploy resource group, upload packaged function app to blob storage with version name. Sets function app `RUN_FROM_PACKAGE` setting to path of zipped artifact in blob storage |
| 67 | +- Default container name - `DEPLOYMENT_ARTIFACTS` (configurable in `serverless.yml`, see below) |
| 68 | + |
| 69 | +### Deployment configuration |
| 70 | + |
| 71 | +```yml |
| 72 | +service: my-app |
| 73 | +provider: |
| 74 | + ... |
| 75 | +
|
| 76 | +plugins: |
| 77 | + - serverless-azure-functions |
| 78 | +
|
| 79 | +package: |
| 80 | + ... |
| 81 | +
|
| 82 | +deploy: |
| 83 | + # Rollback enabled, deploying to blob storage |
| 84 | + # Default is true |
| 85 | + # If false, deploys directly to function app |
| 86 | + rollback: true |
| 87 | + # Container in blob storage containing deployed packages |
| 88 | + # Default is DEPLOYMENT_ARTIFACTS |
| 89 | + container: MY_CONTAINER_NAME |
| 90 | +
|
| 91 | +functions: |
| 92 | + ... |
| 93 | +``` |
| 94 | + |
| 95 | +If rollback is enabled, the name of the created package will include the UTC timestamp of its creation. This timestamp will also be included in the name of the Azure deployment so as to be able to link the two together. Both names will have `-t{timestamp}` appended to the end. |
| 96 | + |
| 97 | +##### Sequence diagram for deployment to blob storage |
| 98 | + |
| 99 | +```mermaid |
| 100 | +sequenceDiagram |
| 101 | + participant s as Serverless CLI |
| 102 | + participant r as Resource Group |
| 103 | + participant f as Function App |
| 104 | + participant b as Blob Storage |
| 105 | +
|
| 106 | + note right of s: `sls deploy` |
| 107 | + s ->> r: Create resource group |
| 108 | + s ->> r: Deploy ARM template |
| 109 | + r ->> f: Included in ARM template |
| 110 | + r ->> b: Included in ARM template |
| 111 | + note right of s: Zip code |
| 112 | + s ->> b: Deploy zip code with name {appName}-v{version}.zip |
| 113 | + s ->> f: Set package path in settings |
| 114 | + note right of s: Log URLs |
| 115 | +``` |
| 116 | +
|
| 117 | +##### Sub-Commands |
| 118 | +
|
| 119 | +- `sls deploy list` - Logs list of deployments to configured resource group with relevant metadata (name, timestamp, etc.). Also logs versions of deployed function app code if available |
0 commit comments