Azure / pcs-cli

A CLI for deploying Azure IoT PCS
MIT License
33 stars 37 forks source link

When deploy the solution to Azure China, Setup Keyvault parameters failed, because deployment outputs missed some values #524

Closed lzyms closed 3 years ago

lzyms commented 5 years ago

Type of issue

Description

When running: pcs -t remotemonitoring -s basic, but occurred error when do deployment validation. It returns the following error: ✕ Error: Could not find template or parameters file for KeyVault, Exception:

Steps to reproduce

  1. pcs login -e AzureChinaCloud
  2. pcs -t remotemonitoring -s basic

Expected behavior

Deploy succeed and go to the next step

Current behavior

Deploy failed and blocked the deployment process

Known workarounds

The deployment output in arm template (basic-static-map.json) missed the following values: storageAccountName storageAccountKey azureMapsKey iotHubHostName

So need to add these deployment outputs into "outputs" section

"storageAccountName": { "type": "string", "value": "[parameters('storageName')]" }, "storageAccountKey": { "type": "string", "value": "[listKeys(variables('storageResourceId'), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value]" }, "azureMapsKey": { "type": "string", "value": "Undefined" }, "iotHubHostName": { "type": "string", "value": "[parameters('iotHubName')]" }

Possible solution

Add the missed deployment outputs in arm template

Context and Environment

• Operating System: Win10 1903 • GitHub branch: 51dacd2aa4 • Node.js Runtime: v10.16.0