Create Azure Funtcion From ARM whit custom Function App Edit Mode - azure-devops

I have an ARM template with a section with a function app, and I deploy all I need, except this parameter. I need to set in read / write mode, but I can not find how to do. I don't find the property. Any idea?

Think you need to set FUNCTION_APP_EDIT_MODE to readwrite as per: https://learn.microsoft.com/en-us/azure/azure-functions/functions-app-settings
Therefore you probably need something like this in your ARM json…
"appSettings": [
{
"name": "FUNCTION_APP_EDIT_MODE",
"value": "readwrite"
}]
Hope that helps,
Colin.

Related

Enable users of github program to configure their own DCMake prefix path

Consider a situation where people work together on the same code base; c++ with cmake. Code base depends on a library, that must be installed separately.
Each user may have the library in a different location. A user may invoke cmake like this:
cmake -DCMAKE_PREFIX_PATH=/path/for/that/user .
However, this is not very easy in all circumstances (e.g. windows and visual studio), and requires retyping. So instead, we have
list(APPEND CMAKE_PREFIX_PATH "/path/for/user")
In the CMakeLists.txt. This works, but requires people to constantly change that path after pulling a branch, which is annoying and easily forgotten. Is it possible to configure in a way that pulling new branches does not override this path, once set on a specific machine?
You can have each of your users create their own CMakeUserPresets.json file, and set it in the cacheVariables field of a configurePresets entry.
// CmakeUserPresets.json
{
"version": , // pick one
"cmakeMinimumRequired": {
"major": , // pick one
"minor": , // pick one
"patch": // pick one
},
"configurePresets": [
{
"name": "starball",
"displayName": "Starball's config",
"description": "Starball's private configuration preset",
"generator": "...",
"binaryDir": "...",
"cacheVariables": {
"CMAKE_PREFIX_PATH": "..."
},
"environment": {}
}
],
// ...
}
Make sure to put CMakeUserPresets.json in your .gitignore file (or whatever else you have to do for your specific VCS so that the user preset file isn't tracked in the VCS).

How to get all-contributers github app to render table of contributors and badge?

I'm using https://github.com/all-contributors/all-contributors, and I've gone through every detail I can on their documentation https://allcontributors.org/ as well. And been trying different things for the past 2 hours but I can't get this app to render the table of contributors. Their documentation is incredibly poor.
I have:
{
"files": [
"readme.md",
"docs/authors.md",
"docs/contributors.md"
],
"imageSize": 100,
"contributorsPerLine": 7,
"contributorsSortAlphabetically": false,
"badgeTemplate": "[![All Contributors](https://img.shields.io/badge/all_contributors-<%= contributors.length %>-pink.svg)](#contributors)",
"contributorTemplate": "<img src=\"<%= contributor.avatar_url %>\" width=\"<%= options.imageSize %>px;\" alt=\"\"/><br /><sub><b><%= contributor.name %></b></sub>",
"types": {
"contributor": {
"symbol": "❤️",
"description": "Contributor ❤️",
"link": "[<%= symbol %>](<%= url %> \"<%= description %>\"),"
}
},
"skipCi": true,
"contributors": [],
"projectName": ".github",
"projectOwner": "owner",
"repoType": "github",
"repoHost": "https://github.com"
}
I then use #all-contributors add #somename to code and it does correctly add it to the .all-contributersrc file, however it doesn't render the table in the readme.md.
I've also tried to hardcode the list in readme using:
<!-- ALL-CONTRIBUTORS-LIST:START -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
But no luck, nothing happens.
I also can not get the badge working. I can hardcode the badge and display "a" badge, but it never uses the above template badge with dynamic contributor length. So it's also not injecting the badge or using that template badge at all.
How can I get this bot to correctly show the badge and show the contributor list and generate the table in readme.md?
Note: I'm not interested in using node or running some generate command manually locally, then it defeats the point of using that app at all, then I can just as well do it myself. According to their documentation it should be generating the table automatically on first contributor, but it does not.
Also when I go to https://raw.githubusercontent.com/all-contributors/all-contributors/master/README.md in raw view, I can see:
Which tells me it has to be generating that table somehow, but it doesn't seem to work.
You can try and emulate other repositories using the same bot, like:
AtlasFoundation/AvatarCreator with this commit.
mrz1836/go-nownodes and its own .all-contributorsrc file
As an alternative, the estruyf/vscode-front-matter does include its own contributor list, using this commit which calls contrib.rocks.

Refer separately deployed components for reuse in an ui5 app

i'm developing some apps, for which everyone needs to show a document in the same way. For this i created a new component which handles my documents in a separate component. I then just want to reuse this component from my different apps.
To embed my reuse component i used something like this in my view.xml:
<core:ComponentContainer
name="de.mycomp.base.DocViewer"
component="de.mycomp.base.DocViewer"
settings='\{"param1":"value1"\}'/>
To access it during runtime i have to declare the namespace of the reuse component and associate it with an resource-url. To achive this, i used the following coding in the init-method of my Component.js which uses my reuse-component DocViewer.
jQuery.sap.registerModulePath("de.mycomp.base.DocViewer", "/sap/bc/ui5_ui5/sap/zdocviewer");
zdocviewer in this case is the name of the bsp-application to which the reuse-component was deployed on premise. To have this also work in webide and on SAP-Cloud-Plattform i needed to add an entry to neo-app.json
like this:
{
"path": "/sap/bc/ui5_ui5/sap/zdocviewer",
"target": {
"type": "application",
"name": "docviewer"
},
"description": "my base document viewer"
},
where docviewer is the name of the deployed app with the reuse component on SCP.
The type application implies that this destination is an app.
This works so far on premise and on sap cloud.
but my problem is that i dont want to have the registerModulePath in my Component.js. Nearly every configuration of components takes place in the manifest.json file. So i tried to move this coding line to configuration in manifest.json, but i failed so far.
Here's what i did:
i added a dependency in section sap.ui5 and there in the dependency-entry like this:
"components": {
"de.dvelop.base.DvelopBaseDocViewer": {
"lazy": true
}
}
i added the following entry to sap.ui5 part
"resourceRoots": {
"de.dvelop.base.DvelopBaseDocViewer": "/sap/bc/ui5_ui5/sap/zdocviewer"
},
The problem here is, that its not allowed to use absolute paths in the value-part of the resource-root entries. So this is invalid:
- /sap/bc/ui5_ui5/sap/zdocviewer
- ../sap/bc/ui5_ui5/sap/zdocviewer
Only this is valid:
- sap/bc/ui5_ui5/sap/zdocviewer
- ./sap/bc/ui5_ui5/sap/zdocviewer
So this annotation is only usable for embedded components, where the reuse-component is in the same deployed project. But this is not my understanding of a reuseable component. So changing something in that component would make it neccessary to copy the files to all the app-projects using the component. And they all have to be deployed again.
So for now i made a fallback to the jquery.sap.registerModulePath because this works with deployed components to refer them from other independent components.
Or does anybody have an idea how to handle this better or more proper within manifest.json?
kind regards
Matthias
see here: ui5 reuse components: https://github.com/Yelcho/UI5-Comp-Routing
you mixed up here old and new approches, wrinting all steps in this answer would be very long. Here brief step to step approche:
define your componentUsages
"componentUsages": {
"myDoc": {
"name": "com.company.myDoc",
"settings": {},
"componentData": {},
"lazy": true
}}
define path mapping, in resourceRoots
"resourceRoots": {
"com.company.myDoc": "/sap/bc/ui5_ui5/sap/zdocviewer"
},
define a targed type component
"targets": {
"myDocTarget": {
"type": "Component",
"usage": "myDoc"
}
use nested routing
.getRouter()
.navTo("myDocRoute", {
id: oBindingContext.getProperty("CategoryID")
}, {
products: {
route: "list",
parameters: {
}
}
});

Set Database Properties when creating it with SqlDatabase.createAsync()

This is the question about the Azure Management Libraries for Java.
First, some background:
The Azure Management REST API mentions at the createorupdate definition the ability to create the database and set different database properties like this (example from the page):
{
"location": "southeastasia",
"sku": {
"name": "S0",
"tier": "Standard"
},
"properties": {
"createMode": "Default",
"collation": "SQL_Latin1_General_CP1_CI_AS",
"maxSizeBytes": 1073741824
}
}
I'm looking how to do the similar request from the Azure Management Libraries for Java.
So far I have found how to set the "sku" part. This is done by using the appropriate ServiceObjectiveName object:
final SqlServer sqlServer = ...get SQL server object ...;
final Creatable<SqlDatabase> myDb = sqlServer.databases()
.define(targetDBName)
.withServiceObjective(ServiceObjectiveName.fromString("S0"));
...
myDb.createAsync(...); // create the db with sku S0
But I can't figure out how to set the properties. For my purpose I need to set a bit different properties than in the sample. Namely, the specific properties.maxSizeBytes and properties.autoPauseDelay.
I even found the .withMaxSizeBytes() method here but it's marked deprecated without any explanation.
I haven't found any way to set the autoPauseDelay.
By digging in the azure-sdk-for-java, I am sorry that I did not find any methods for setting these properties.
The complicated workaround I think of is to use resource deployment. It is supported in java sdk:
azure.deployments().define(deploymentName)
.withExistingResourceGroup(rgName)
.withTemplate(templateJson)
.withParameters("{}")
.withMode(DeploymentMode.INCREMENTAL)
.create();
And here is a sample which can give you some guidance: DeployUsingARMTemplate
By the way, you can try to create a database on Azure portal, and then you can download the template at the last step of the creation:

Where are the docs on how to add symbol support for a language to Visual Studio Code?

I would like to add symbol support for PowerShell to VS Code but I'm not finding any docs on the code.visualstudio.com/docs site.
Also, is it possible to do this for a language like PowerShell that, for the moment, will only work on Windows? Is there a way to light up symbol support on Windows only?
BTW I've added a bunch of PowerShell snippets that I'm in the process of trying to get integrated into VS Code. Any help on how to get these snippets into the product would be appreciated as well? I did submit an issue on the snippets, suggesting that the team put these into VS Code.
There is currently no documentation for the plugin API. It's too early for this as the API is still changing with every minor release. The VSCode team is focused on providing a stable plugin API. There will be a documentation about it when it's done.
Nevertheless it is already possible to add a new language plugin or extending an exisiting one. Take a look on this short description on how to add declaration support for a new language: Create Custom Language in Visual Studio Code
You could add symbol support in a similar way. What you need is something like an abstract syntax tree builder for powershell scripts and an application or a javascript module that is able to process a JSON request in order to provide the correct symbols. An example request for outline support is this:
{
"seq":442,
"type":"request",
"command":"navbar",
"arguments":
{
"file":"c:/Users/C/Documents/projects/MyProject/MyFile.xxx"
}
}
A response could look like that:
{
"seq":442,
"type":"response",
"command":"navbar",
"request_seq":442,
"success":true,
"body":[
{
"text":"TObjA",
"kind":"class",
"kindModifiers":"",
"spans":[
{
"start":{
"line":10,
"offset":3
},
"end":{
"line":16,
"offset":4
}
}
],
"childItems":[
]
},
{
"text":"DoSomething",
"kind":"method",
"kindModifiers":"",
"spans":[
{
"start":{
"line":20,
"offset":1
},
"end":{
"line":27,
"offset":4
}
}
],
"childItems":[
]
},
]
}
I'm not sure what do you mean with "symbol support". Is it something like "jump to symbol inside the current file" using CTRL+Shift+O? Then you are looking for outlineSupport.
Is it something like "find a symbol in any file" using CTRL+P, #? Then you are looking for navigateTypesSupport.
Copy the needed .js file from the vs.langauage.csharp.o folder to the vs.langauage.powershell folder and register the support in powershellMain.js as it is done in omnisharpMain.js.
If you want to register the new support only on Windows then you can do it like this:
var isWin = /^win/.test(process.platform);
if(isWin)
monaco.Modes.NavigateTypesSupport.register('powershell', new navigateTypesSupport_1.default(ModelService, server));
I hope this helps for the moment. Don't forget to save your changed plugins in a different folder. VSCode often deletes changes in the plugin folders on update.