Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

feat: specify subscription ID in serverless yaml #209

Closed
wants to merge 54 commits into from

Conversation

neerajmandal
Copy link
Contributor

New PR created due to merge issues because of one unsigned commit.

AB#360

wbreza and others added 30 commits May 21, 2019 07:42
Fixes plugin after conversion to TypeScript
1. remove individual function deploy support
- Adds better logging for API management (displays function urls)
- Adds unit tests
- Updates configuration for better Jest debugging
Fixed compile issue #160 on windows by adding shx npm package to use in build scripts. Also added some local dev instructions and contribution hints to Readme.md
- Updates packaging strategy to write function.json into expected folder structure
- Dynamically resolves handler path based on yaml definition and destination folder
- Removes and cleans up function.json and function folders after packaging is completed

Resolves ABA#82, 90, 89
When azure serverless project is deploy with webpack we need to ensure that the required files for azure functions are part of the deployment package.

- Copies host.json & function.json files for each serverless function.
When the APIM CORS policy is defined within the serverless yaml then we need to deploy the XML policy document during deployment.

Resolve ABA#207
* Bumped to version 1.0.0-4
* add docs for releasing and scripts to do it
Ensures valid Azure values are set for region and stage. Renames instances of "location" to "region" to align with core naming convention.
so user don't have to login everytime they run
`sls deploy`
Based on various well-known skus we can generate ARM templates with the correct resources and expose parameters.

Well Known variations:

- Consumption
- Premium
- AppServiceEnvironment

Consolidate ARM template deployment strategy into ArmService
wbreza and others added 24 commits June 25, 2019 11:34
#178)

The SCM domain is different based on the type of function app deployment. In a typical function app, the SCM domain is always {appName}.scm.azurewebsites.net.

When deploying a function into an App Service Environment (ASE) the SCM domain is a sub domain off of the ASE, ex) {appName}.scm.{asePath}.p.azurewebsites.net

This fix addresses the difference in finding the correct SCM domain to deploy the zip package.
Wrapper service for Azure Blob Storage functionality. To be used in update of deployment process for rollback capability.

Resolves [AB#361]
)

- Fixes missing import statements in MockFactory
- Adds new CI step to confirm TypeScript compile succeeds before running tests.
Add sequence diagram png files and update version to timestamp
Updating the deployment process will take a few pull requests to keep them (relatively) small. Here are the changes included in this pull request.
- Update default naming convention of Azure Storage account (and a utility function that assists with creating name)
- Stubs for rollback enabled (currently switched off to avoid breaking tests, will switch on in future PR), which includes
    - Timestamping names of deployments
    - Timestamping names of packages
    - Initialization of deployment artifact container
- Updates the `LoginService` to accept options, which is used in the `AzureBlobStorageService` to retrieve a storage-specific access token
- Remove dead code from `FunctionAppService`

Resolves [AB#357], [AB#408], [AB#414], [AB#415]
## High Level Overview
- Uploads a timestamped archive of code to Azure Blob Storage
- Adds same timestamp to ARM deployments to enable linking
- **Does not set `WEBSITE_RUN_FROM_PACKAGE` to use package directly from blob storage**
  - Currently just used as an archive. Initially, thought to update the `WEBSITE_RUN_FROM_PACKAGE` setting with the URL for the blob (hence the implementation of the SAS URL generator), but discovered [issues with cold start when using that methodology to deploy to Windows](https://docs.microsoft.com/en-us/azure/azure-functions/run-functions-from-deployment-package#enabling-functions-to-run-from-a-package).
  - Future `rollback` implementation will download the appropriate archive and re-deploy it to the Function App.
  - This may (and probably will) change as the Azure Functions Premium plan is released on Linux or cold start issues are mitigated

## Details

- Adds dependency on the `@azure/arm-storage` package
- Sets `rollbackEnabled` as default
- Updates broken tests because of timestamped deployment name
- Add tests for blob storage operations
- Allows user to still specify deployment name with rollback

Resolves [AB#388], [AB#358], [AB#414] and [AB#415]
…189)

when a name is specified in cli or yaml, serverless will use this name to create the resourceGroup instead of creating a name from convention.

all underlying resources will still be created with a convention name.
Ensures storage account names do not clash based on combination of prefix, region, stage & service name

- Ensures generated name is <= 24 chars
-  Ensures region names don't conflict
-  Generates short region part from full value
-  Generates short stage part from full value
-  Includes partial hash of service name in full name

Resolves AB#420
## Updates
- Adds new `rollback` plugin
- Fixes `deploy list` to show actual timestamp from name, which is used for rollback
- Adds required functionality to `AzureBlobStorageService` and `ArmService`
- Adds previously missing tests of required functionality

## How to Use
1. Get a timestamp. Use
```
sls deploy list
```
to retrieve one.
2. Roll back function app to timestamp
```
sls rollback -t <timestamp>
```

## Options
In `deploy` section of `serverless.yml`, you can specify whether to run from a blob URL or deploy the package directly to the function app by setting:
```yaml
deploy:
  # Default is false
  runFromBlobUrl: true|false
```

Resolves [AB#317]
* feat: Invoke Plugin

* feat: Invoke Plugin

* Resolved conflicts

* url encoder added & conflicts resoloved
1. All plugin classes now extends from base plugin
1. All plugin classes rename to follow naming convention
* modify script that generating commit msg for release
Adds npm script to generate service principal
Update readme for current state of project

Resolves [AB#483]
…loyment (#203)

* option to specify subscription id from CLI added

* Build issue resolved

* azureBasePlugin issue resolved

* Two test cases added to test subscription ID feature

* Changes made accoridng to feedback
- [x] Allow `-p` or `--package` param to specify package to deploy
- [x] Log in before deployment rather than packaging
- [x] Don't run deployment if local package does not exist

Resolves [AB#500]
@wbreza wbreza deleted the t-nemand/azureSubscriptionID branch September 12, 2019 20:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants