Liferay portlet with Angular, Pulling configurations from other portlets - json

Is there a way to pull the configurations of other portlets or categories within a single angular portlet? I was hoping to use a single system configuration in multiple portlets. In the feature > configuration json, I have added this code that I was hoping would work but I can't get it back into the portlet.
"system": {
"category": "related.configuration",
"name": "Related Configurations",
"fields": {
"development": {
"type": "boolean",
"name": "Developer Mode",
"description": "Should the portlets be set to developer mode?",
"default": false
}
}
},

There is no way to do this with this configuration setup. The configurations are for :
Individual portlets
All portlets of that type

Related

VS Code API extension development - configuration points issue

This is from package.json file:
"configuration": [
{
"id": "projectmanager",
"title": "Enable or Disable project manager",
"order": 1,
"properties": {
"AIO.projectmanager": {
"type": "boolean",
"order": 1,
"description": "Enabled - true, Disabled - false : for Project manager."
}
}
}
When I debug and run it, the setting does not show up in a GUI nor in the settings.json of the extension development host.
Any way to fix this?
Edit: When i run the extension, it sends a notification saying "[my:\extension\workspace]: property engines is mandatory and must be of type object "

How can I retrieve the query key for Bing Maps API for Enterprise in an Azure Resource Group Template?

I am working on an ARM template that deploys an entire infrastructure from scratch:
The resource group
App Service plans
Application Insights
an so forth...
At some point I get to the part where I write the scripts for deploying my App Service (for hosting and deploying my web app later on) to my resource group. Prior to that I have my BingMaps API deployed in the same script.
I am stuck at the part where I am setting the Application Settings for my web app:
"type": "Microsoft.Web/sites",
"properties": {
"siteConfig": {
"appSettings": [
{
"name": "SomeKey",
"value": "SomeValue"
}, //rest of the code omitted
I would like to know how could I retrieve my BING MAPS query key within an ARM template?
I have tried, and have a feeling that this might be close to it, something like:
"value": "[reference(resourceId('Microsoft.BingMaps/mapApis', variables('bingMapsName')), '2016-08-18').queryKey]"
Anybody who has done this before? Many thanks in advance! Cheers
If you want to access query key in your ARM template for your web app setting, I would suggest you to use something like below:
{
"name": "appsettings",
"type": "config",
"apiVersion": "2015-08-01",
"dependsOn": [
"[concat('Microsoft.Web/sites/', variables('webSiteName'))]"
],
"tags": {
"displayName": "WebAppSettings"
},
"properties": {
"key1": "[parameter('AppSetting_Key1_Value')]",
"key2": "value2"
}
}
and then in your template.Parmeter.jso file , you can declare the key AppSetting_Key1_Value with the value of your Bing maps query key.
Specify the Parameter Value
After the Parameter has been added to the ARM Template and it’s being used to populate an Application Setting, the final step is to define the Parameter value within the ARM Templates Parameter file used for deployments. In the Azure Resource Group project template in Visual Studio the Parameters file for the default deployment is the file that ends with “.parameters.json”.
Here’s a screenshot of the “WebSite.parameters.json” file created in the previous articles in this series with the “AppSetting_Key1_Value” Parameter set to a value:
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"hostingPlanName": {
"value": "WebApp1HostingPlan"
},
"WebApplication1PackageFolder": {
"value": "WebApplication1"
},
"WebApplication1PackageFileName": {
"value": "package.zip"
},
"WebApp_ConnString1": {
"value": "Server=myServerAddress;Database=myDataBase;Trusted_Connection=True;"
},
"AppSetting_Key1_Value": {
"value": "Template Value 1"
}
}
}
for security complaint solution , you can move all your secure key and connection string to Azure key vault if you are not comfortable to have keys in param file.
This should work. Hope it helps.

How do you make manifest.json for Microsoft Teams bot?

I followed the online tutorial for constructing a bot in Visual Studio and deploying it Azure, and so far that seems to have worked. Now I want to add this bot to Microsoft Teams via the "Sideload a bot or tab" method. The online tutorial has NO explanation for what I need to do so I need some help. Here is the manifest.json I was currently trying to upload in a zip folder. Please help, I don't know how this process works.
{
"$schema": "https://statics.teams.microsoft.com/sdk/v1.0/manifest/MicrosoftTeams.schema.json",
"manifestVersion": "1.0",
"version": "1.0.0",
"id": "a5db14e6-8adf-445b-a0aa-daadc5e155eb",
"packageName": "com.testbot20170525114049",
"developer": {
"name": "Megan",
"websiteUrl": "https://website.com/",
"privacyUrl": "https://website.com/privacy",
"termsOfUseUrl": "https://website.com/app-tos"
},
"name": {
"short": "Botty"
}
"description": {
"short": "A sample bot to test the bot upload process"
}
"bots": [
{
"botId": "a5db14e6-8adf-445b-a0aa-daadc5e155eb",
"needsChannelSelector": "true",
"scopes": [ "team", "personal" ]
}
]
}
Enable Public Developer Preview. The v1.0 manifest is fully supported in that mode, and while it may work in the public version, for now I'd switch to developer preview mode.
Make sure your manifest follows the v1.0 format. While your schema is close, there are a few required fields missing:
description.full
icons.outline
icons.color (note currently there is a 2k limit on file size)
accentColor
Zip the manifest and icons into a sideloadable package. Make sure the manifest.json is at the top level.
Follow the sideload instructions.

Azure RM Templates. How to upload assets automatically with VS instead of fetching them from GitHub

I would like to be able to deploy a complex ARM template that utilizes DSC extensions and nested templates from my local Visual Studio.
The example is set to download assets from GitHub:
https://github.com/Azure/azure-quickstart-templates/tree/master/active-directory-new-domain-ha-2-dc
What changes do I have to make that I can tie the assets to my local Visual Studio project and use them instead of downloading them from GitHub?
Here is the strip down version of the template responsible for downloading:
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
...
"adPDCVMName": {
"type": "string",
"metadata": {
"description": "The computer name of the PDC"
},
"defaultValue": "adPDC"
},
"assetLocation": {
"type": "string",
"metadata": {
"description": "The location of resources such as templates and DSC modules that the script is dependent"
},
"defaultValue": "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/active-directory-new-domain-ha-2-dc"
}
...
},
"variables": {
...
"adPDCModulesURL": "[concat(parameters('assetLocation'),'/DSC/CreateADPDC.ps1.zip')]",
"adPDCConfigurationFunction": "CreateADPDC.ps1\\CreateADPDC",
...
},
"resources": [
...
{
"name": "[parameters('adPDCVMName')]",
"type": "Microsoft.Compute/virtualMachines",
...
"resources": [
{
"name": "[concat(parameters('adPDCVMName'),'/CreateADForest')]",
"type": "Microsoft.Compute/virtualMachines/extensions",
...
"properties": {
...
"settings": {
"ModulesUrl": "[variables('adPDCModulesURL')]",
"ConfigurationFunction": "[variables('adPDCConfigurationFunction')]",
...
}
}
}
}
}
]
}
]
}
Do the following in your 'Azure Resource Group' project in Visual Studio:
Copy the files to your project in Visual Studio using the same
directory structure. So a DSC directory and a nestedtemplates directory with
the files that belong there.
Set the files in the directories as content (azuredeploy.json is not needed, only the files you are referring to). This way the powershell script to deploy the templates will upload it to a storage account in azure.
Make it possible to use files uploaded to the storage account. In this case the template that you are referring to is not using the common
namingconvention. So you need to change it a bit:
Change azuredeploy.json: Change the name of parameter
assetLocation to _artifactsLocation.
Second: Add a parameter
_artifactsLocationSasToken as securestring. These 2 parameters will be filled automatically by the powershell script in Visual Studio.
part of the azuredeploy.json:
"parameters": {
"_artifactsLocation": {
"type": "string",
"metadata": {
"description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated."
}
},
"_artifactsLocationSasToken": {
"type": "securestring",
"metadata": {
"description": "The SAS token to access the storage account"
}
},
Because the original azuredeploy.json is not using the _artifactsLocationSasToken parameter. You need to change all variables where the assetlocation is used. Change all variables so it uses the _artifactsLocation and add a part to use the _artifactsLocationSasToken.
one sample:
"vnetTemplateUri": "[concat(parameters('_artifactsLocation'),'/nestedtemplates/vnet.json', parameters('_artifactsLocationSasToken'))]",
After you changed all variables. You can deploy the template from Visual Studio using the resources in your project instead of from github.

How to set the application log in an Azure webapp using Azure resource manager

Does anyone know how to set the below diagnostic settings on an Azure Web App using Azure Resource Manager (Powershell or JSON).
Using .json I can only find these settings
"requestTracingEnabled": true, /* Failed request tracing, aka 'freb' */
"httpLoggingEnabled": true, /* IIS logs (aka Web server logging) */
"logsDirectorySizeLimit": 40, /* 40 MB limit for IIS logs */
"detailedErrorLoggingEnabled": true, /* Detailed error messages */
Which turns on web server logging to filesystem but NOT Application Logging or to blob storage.
With Powershell this command only seems to work with ASM as it does not find Non-classic storage accounts given to it
Enable-AzureWebsiteApplicationDiagnostic
Any help would be appreciated. We are currently using Azure Powershell 0.9.8
Regards
The Azure Resource Manager (ARM) template json section for configuring Application Log (Blob) and Web Server Logging (Storage) based on your screenshot above is as shown below:
{
"apiVersion": "2015-08-01",
"name": "logs",
"type": "config",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', parameters('siteName'))]"
],
"properties": {
"applicationLogs": {
"azureBlobStorage": {
"level": "Information",
"sasUrl": "<Your Azure Blob Storage Account SAS Url>",
"retentionInDays": null
}
},
"httpLogs": {
"azureBlobStorage": {
"sasUrl": "<Your Azure Blob Storage Account SAS Url>",
"retentionInDays": null,
"enabled": true
}
},
"failedRequestsTracing": {
"enabled": true
},
"detailedErrorMessages": {
"enabled": true
}
}
}
References: AzureWebsitesSamples/ARMTemplates/WebAppManyFeatures.json
Hope this answer your question and help solving your issue.
Please let me know if you need further help or clarifications.
If you browse an existing webapp in Resource Explorer you'll find a config/logs section that looks something like this:
{
"id": "/subscriptions/.../config/logs",
"name": "logs",
"type": "Microsoft.Web/sites/config",
"location": "North Central US",
"properties": {
"applicationLogs": {
"fileSystem": {
"level": "Off"
},
"azureBlobStorage": {
"level": "Information",
"sasUrl": "...",
"retentionInDays": 14
}
},
...
}
I believe you can use this format in your json template to configure the logging. (This section would be a sibling to the config/web section which contains the settings mentioned in the question.)
Note though that the config/logs section is not described in the System.Web schema, and so I'd imagine is not currently supported by MS at this time. I'm pretty sure I've tried it and seen it work though.
I didn't find how to set it in the template at the first provision. But it turned out to be easy after resources were provisioned. Please see answer at https://stackoverflow.com/a/51617949/511144 for the actual script to do it that uses Set-AzureRmResource