Questions tagged [csx]

For questions about Azure Functions C# scripts, previously known as C# script. For questions about C#, see the C# tag.

This tag is for questions about Azure Functions C# scripts.

Useful resources:

48 questions
1
vote
1 answer

Can't use Nuget package in C# Azure function

I'm trying to write an azure function which will use Sendgrid to send emails. However, I can't get my function to recognize the external nuget package. Here's what I have: project.json { "frameworks": { "net46": { "dependencies": { …
Dan O'Leary
  • 2,660
  • 6
  • 24
  • 50
1
vote
1 answer

Query CosmosDB from Azure Function .csx

I want to query a CosmosDB collection to see if a document already exists from within a Azure Function using csx. As well as the following code I have an implicit binding towards the cosmosDB collection to be able to create new documents. This is…
selbu
  • 106
  • 1
  • 8
1
vote
1 answer

update and delete documents in cosmos db through azure functions

I am new to cosmos db as well as azure functions and I'm getting nowhere fast. I've been able to find every tutorial under the sun to create and read documents but not update and delete. No one seems to have a full CRUD tutorial using azure…
Devin Prejean
  • 626
  • 6
  • 12
1
vote
2 answers

Elevating privilege for C# scripts

Let's say I want to change a registry key with the following script. RegistryKey myKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Company\\SomeFolder", true); if(myKey != null) { myKey.SetValue("NameXYZ", "1", RegistryValueKind.String); …
H0ney
  • 55
  • 5
0
votes
1 answer

Java Script OOP setting Object Key name and accessing Key name and values in methods

function Inventory(item, price){ const newObj = {}; this.item = { price: price, quantity: 1, }; /*I tried this too [item] = { price: price, quantity: 1, }; */ } …
0
votes
1 answer

Elementor plugin not working on a VPS/WHM with CSF & CFX , how to solve it?

i have a VPS Centos7 with CPanel Certificate from contabo. Elementor is not working on all wordpress sites hosted on this VPS. I tryed all the debugging solutions but still not working .. I have cfs and cfx installed on this VPS, I think there is a…
0
votes
1 answer

Access to TelemetryConfiguration object from C# script (csx) in Azure Function

I need to inject a TelemetryProcessor into existing TelemetryConfiguration (Application Insights) to modify default Azure Function behavior. There are examples how to do it through Dependency Injection for c# projects. I wonder whether there is a…
0
votes
1 answer

Setting a session id when pushing to an Azure Service Bus Queue in a csx file

We have build a system in Azure and found that a Http triggered C# project dies if you call it 300 times in a short time periond. CSX files seem to not have this limitation. So it's pretty trivial to create a csx that receives a string via a POST…
cgraus
  • 784
  • 2
  • 9
  • 26
0
votes
1 answer

Stop VSCode formatting from performing specific formatting (line breaks) on save

Has anyone had an issue in VScode where a line starting with # is broken into two lines? I'm writing a csx dotnet-script programme and the nuget reference is defined as: #r "nuget: YamlDotNet, 8.1.2" But on save, that is being split into... # r…
ChrisAddams
  • 190
  • 1
  • 8
0
votes
2 answers

Asynchronous JavaScript Challenge question with setTimeout and recreating forEach

Please help! I've been trying to solve this on my own, but keep hitting the wall. Recreate the built in array method, forEach - Write a function that takes as parameters an array, arr, and a callback function, cb. The forEach function will iterate…
Nick
  • 3
  • 2
0
votes
1 answer

Loading scripts based off conditions

I am currently working with a bunch of c sharp scripts and I want to implement this such that each script will be quite unique for a certain task . Which is why I want to #load certain script when a certain condition is fulfilled. But seems like by…
Devss
  • 67
  • 7
0
votes
0 answers

Is there a specific reason why we don't explicitly specify type of variable in csx scripts and use var at all times?

I have been working very closely with csx lately and something that I noticed was that whenever we specify a variable it always used var name = "Hello World"; instead of string name = "Hello World"; . Is this due to a certain convention that…
Devss
  • 67
  • 7
0
votes
2 answers

Use Microsoft.Azure.Storage in Azure Function csx

Somehow I cannot use package Microsoft.Azure.Storage.blob in Azure Function v2 using csx. In extension.proj I have following: In csx file I have: using…
Piotr Stapp
  • 19,392
  • 11
  • 68
  • 116
0
votes
1 answer

Convert byte array into image in Azure Functions

System.Drawing is not supported in Azure Functions, therefore Image class cannot be used to convert byte array into Image. Then how do we convert byte arrays into Image in Azure Functions that uses C#Script where System.Drawing is not recognized as…
0
votes
1 answer

Azure Functions - nodejs and dot net core 2.2 memory consumption keeps growing until recycled

I have a simple http triggered azure function which retrieve scalar value from azure sql database and return it as json, the function is hosted using azure app service plan, i have tried both "dot net core 2.2 app package" and "nodejs" and both of…