Skip to content

Commit

Permalink
Upgrade Azure function guide (#254)
Browse files Browse the repository at this point in the history
* Upgrade Azure function guide

* Upgrade deployment button
  • Loading branch information
Mandur committed Aug 17, 2020
1 parent 0df8e9e commit 72977e7
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
Binary file added Docs/Pictures/vsdeploytoazurefunc.PNG
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 9 additions & 4 deletions Docs/devguide.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,16 @@ If you want to update a LoRa Gateway running a previous version fo our software

You have the option to either deploy the Azure Function code from your Visual Studio Code to Azure or create an empty Azure Function that points to a Zip file hosted by us, containing the function code. Follow one of the two sets of instructions that follow:

#### If you choose to deploy manually using Visual Studio Code
#### Deploy manually using Visual Studio

- Build and deploy the [Azure function](LoraKeysManagerFacade). The best way is to open the [Azure function folder](LoraKeysManagerFacade) with Visual Studio Code with the [Azure Functions Plugin](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions) installed. Now run the command `Azure Functions: Deploy to function app...` and provide the name of the Azure function to deploy to. If prompted, select environment `C#` and version `V2`.
On your Visual Studio Solution, right click on the 'LoRaKeysManagerFacade' project, select 'deploy', then 'Azure' and then 'Azure function'. You should then arrive on a page where you just need to hit the deploy button to get the code deployed on Azure.
![Deploy to Azure Function from Visual Studio](/Docs/Pictures/vsdeploytoazurefunc.png)

- If you want to just deploy the function from Visual Studio Code with the root project folder `iotedge-lorawan-starterkit` open (of which the Function is a subfolder `/LoRaEngine/LoraKeysManagerFacade`), you need to run the Visual Studio Command `Azure Functions: Deploy to function app...` and then **manually** choose the folder `LoraKeysManagerFacade/bin/Release/netstandard2.0/publish`. (Unfortunately at time of this writing we saw the behavior that VSCode is proposing the wrong folder). Building the function does not work in this way unfortunately.
#### Deploy manually using Visual Studio Code

- Open the [Azure function folder](../LoRaEngine/LoraKeysManagerFacade) with Visual Studio Code with the [Azure Functions Plugin](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions) installed. Now run the command `Azure Functions: Deploy to function app...` and provide the name of the Azure function to deploy to. If prompted, select environment `C#` and version `V3`.

- If you want to just deploy the function from Visual Studio Code with the root project folder `iotedge-lorawan-starterkit` open (of which the Function is a subfolder `/LoRaEngine/LoraKeysManagerFacade`), you need to run the Visual Studio Command `Azure Functions: Deploy to function app...` and then **manually** choose the folder `LoraKeysManagerFacade/bin/Release/netcoreapp3.1/publish`. (Unfortunately at time of this writing we saw the behavior that VSCode is proposing the wrong folder). Building the function does not work in this way unfortunately.

#### If you choose to create an empty Azure Function pointing to our Zipped code

Expand All @@ -98,7 +103,7 @@ You have the option to either deploy the Azure Function code from your Visual St

|App Settings Name|Value|
|-|-|
|WEBSITE_RUN_FROM_ZIP|<https://github.com/Azure/iotedge-lorawan-starterkit/releases/download/v1.0.0/function-1.0.0.zip>|
|WEBSITE_RUN_FROM_ZIP|<https://github.com/Azure/iotedge-lorawan-starterkit/releases/download/v1.0.4/function-1.0.4.zip>|

![Run Azure Function from Zip file](/Docs/Pictures/FunctionRunFromZip.png)

Expand Down
4 changes: 2 additions & 2 deletions LoRaEngine/LoraKeysManagerFacade/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"azureFunctions.projectRuntime": "~2",
"azureFunctions.projectRuntime": "~3",
"azureFunctions.projectLanguage": "C#",
"azureFunctions.templateFilter": "Verified",
"azureFunctions.deploySubpath": "bin/Release/netstandard2.0/publish",
"azureFunctions.deploySubpath": "bin/Release/netcoreapp3.1/publish",
"azureFunctions.preDeployTask": "publish",
"debug.internalConsoleOptions": "neverOpen"
}
2 changes: 1 addition & 1 deletion LoRaEngine/LoraKeysManagerFacade/.vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"type": "shell",
"dependsOn": "build",
"options": {
"cwd": "${workspaceFolder}/bin/Debug/netstandard2.0"
"cwd": "${workspaceFolder}/bin/Debug/netcoreapp3.1"
},
"command": "func host start",
"isBackground": true,
Expand Down
2 changes: 1 addition & 1 deletion Template/azuredeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"storageAccountType": "Standard_LRS",
"functionAppName": "[concat(parameters('uniqueSolutionPrefix'), 'function')]",
"gitUsername": "Azure",
"functionZipBinary": "https://github.com/Azure/iotedge-lorawan-starterkit/releases/download/v1.0.3/function-1.0.3.zip",
"functionZipBinary": "https://github.com/Azure/iotedge-lorawan-starterkit/releases/download/v1.0.4/function-1.0.4.zip",
"gitBranch": "master",
"storageAccountId": "[concat(resourceGroup().id, '/providers/', 'Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]",
"iotHubOwnerPolicyName": "iothubowner",
Expand Down

0 comments on commit 72977e7

Please sign in to comment.