https://pulumi.com logo
Docs
Join the conversationJoin Slack
Channels
announcements
automation-api
aws
azure
blog-posts
built-with-pulumi
cloudengineering
cloudengineering-support
content-share
contribex
contribute
docs
dotnet
finops
general
getting-started
gitlab
golang
google-cloud
hackathon-03-19-2020
hacktoberfest
install
java
jobs
kubernetes
learn-pulumi-events
linen
localstack
multi-language-hackathon
office-hours
oracle-cloud-infrastructure
plugin-framework
pulumi-cdk
pulumi-crosscode
pulumi-deployments
pulumi-kubernetes-operator
pulumi-service
pulumiverse
python
registry
status
testingtesting123
testingtesting321
typescript
welcome
workshops
yaml
Powered by Linen
dotnet
  • a

    ancient-solstice-53934

    06/29/2022, 12:24 PM
    Hi Team, I am creating Azure resources using Pulumi and .Net code. It was working fine earlier but now throwing following error ...runtime: VirtualAlloc of 8192 bytes failed with errno=1455 2022-06-29T06:23:03.6799320Z fatal error: out of memory 2022-06-29T06:23:03.6799446Z 2022-06-29T06:23:03.6799668Z runtime stack: 2022-06-29T06:23:03.6815219Z runtime.throw({0x265343d, 0xc18c848000}) 2022-06-29T06:23:03.6815922Z /opt/hostedtoolcache/go/1.17.11/x64/src/runtime/panic.go:1198 +0x76 2022-06-29T06:23:03.6816312Z runtime.sysUsed(0xc18c848000, 0x2000) ..................
  • a

    ancient-solstice-53934

    06/29/2022, 1:28 PM
    Is there any way to enable Synapse Link in Azure Cosmos DB containers using Pulumi and .Net code?
  • c

    clever-address-74879

    07/07/2022, 8:29 PM
    Hi! I accidentally used
    $"zone.Id"
    directly as a Cloudflare.Zone name, and now the name in pulumi is "Calling [ToString] on an [Output<T>] is not supported." I'm having issues recovering from that.
    o
    • 2
    • 3
  • r

    rapid-football-44318

    07/11/2022, 2:44 PM
    pulumi preview
  • r

    rapid-football-44318

    07/11/2022, 2:46 PM
    Hi, I posted this question in the general channel about AppSettings getting deleted from an Azure Function app during an unrelated update (using .Net C#). If anyone can help I would be very grateful. https://pulumi-community.slack.com/archives/C84L4E3N1/p1657549693249239
    e
    w
    • 3
    • 3
  • f

    flaky-school-82490

    07/13/2022, 2:06 PM
    Hi! I am trying to read a stack reference and get the value of some of the stack outputs in my C# console application. In powershell, I can do: $stackOuputs = pulumi stack output --show-secrets -s "myorg/mystack/dev" So I assumed I would be able to do the following in C#: var stackReference = new StackReference("myorg/mystack/dev"); var stackOutput = await stackReference.GetValueAsync("OutputName"); But it does not look like StackReference is supported outside of Run: 'Trying to acquire Deployment.Instance before 'Run' was called.' So any ideas on how to read a Stack outputs in a non-pulumi program using the C# SDK?
    b
    • 2
    • 8
  • g

    glamorous-waitress-51149

    07/14/2022, 11:54 AM
    i have a CI system in gitlab and all our repos use the same CI config in a central repo. My current problem in one of them is this error which may be a red herring but I’m not sure. ENVVAR are set for clientid, client secret, tenantid and subscription id. the verbose logs don’t show anything that i can see. any ideas what’s causing this?
    azure-native:web:AppServicePlan Staging-homepage-appplan  error: building auth config: obtain subscription() from Azure CLI: Error parsing json result from the Azure CLI: Error waiting for the Azure CLI: exit status 1
    e
    • 2
    • 3
  • e

    elegant-eye-39446

    07/18/2022, 1:59 PM
    Hi team! I've an issue with "azure-cs-appservice" example: when I try to upload my deploy.zip archive I get an error:
    RequestBodyTooLarge - The request body is too large and exceeds the maximum permissible limit
    This is my code
    var blob = new Blob(_blobAppServiceName, new BlobArgs
                {
                    ResourceGroupName = resourceGroup.Name,
                    AccountName = storageAccount.Name,
                    ContainerName = container.Name,
                    Type = BlobType.Block,
                    Source =  new FileArchive(@"publish\deploy.zip")
                });
    I've some dlls greater than 4MB, Is there any way to upload my zip? And moreover can I upload on a different target folder? At this time all files are extracted on wwwroot folder greeters
    • 1
    • 1
  • g

    gray-vr-25374

    07/21/2022, 8:52 AM
    Hi everyone! Does someone know how to add certificate (*.pfx format) to KeyVault with using Azure-native? In Azure classic we have Azure.KeyVault.Certificate class that accept content of certificate and password, so it is straight forward on how to use it. In Azure-native I think I should use AzureNative.KeyVault.Key but for me it not clear how to pass certificate there.
    b
    • 2
    • 4
  • d

    dazzling-gigabyte-42983

    07/29/2022, 7:52 PM
    Hey all, I'm looking to use pulumi .net and I'd like to capture the output variables so I can call the GitHub API and set some secrets. Is this kinda of stuff possible?
    b
    b
    b
    • 4
    • 5
  • h

    happy-grass-18954

    08/02/2022, 9:33 PM
    Is anyone using AWS
    assumeRole
    from Inline program? Appreciate an example if someone has one. It’s pretty straight-forward to set AWS region
    await stack.SetConfigAsync("aws:region", new ConfigValue("us-east-1"));
    I’m trying to figure out how to pass in the assumeRole settings using the same approach as the region.
    w
    c
    • 3
    • 8
  • l

    lemon-controller-56705

    08/05/2022, 8:42 PM
    Hello! I’m trying to run the CLI on an M1 Mac, and I get the following exception. This is a known problem that the grpc plugin are not available for osx-arm64, but I’m not sure why the CLI wants to run these during a
    pulumi up
    operation.
    Unhandled exception. System.IO.FileNotFoundException: Error loading native library. Not found in any of the possible locations: /Users/tm/git/pronghorn/Programs/OperatingEnvironment/bin/Debug/net6.0/libgrpc_csharp_ext.arm64.dylib,/Users/tm/git/pronghorn/Programs/OperatingEnvironment/bin/Debug/net6.0/runtimes/osx-arm64/native/libgrpc_csharp_ext.arm64.dylib,/Users/tm/git/pronghorn/Programs/OperatingEnvironment/bin/Debug/net6.0/../../runtimes/osx-arm64/native/libgrpc_csharp_ext.arm64.dylib
           at Grpc.Core.Internal.UnmanagedLibrary.FirstValidLibraryPath(String[] libraryPathAlternatives)
           at Grpc.Core.Internal.UnmanagedLibrary..ctor(String[] libraryPathAlternatives)
           at Grpc.Core.Internal.NativeExtension.LoadNativeMethodsUsingExplicitLoad()
           at Grpc.Core.Internal.NativeExtension.LoadNativeMethods()
           at Grpc.Core.Internal.NativeExtension..ctor()
           at Grpc.Core.Internal.NativeExtension.Get()
           at Grpc.Core.Internal.NativeMethods.Get()
           at Grpc.Core.GrpcEnvironment.GrpcNativeInit()
           at Grpc.Core.GrpcEnvironment..ctor()
           at Grpc.Core.GrpcEnvironment.AddRef()
           at Grpc.Core.Channel..ctor(String target, ChannelCredentials credentials, IEnumerable`1 options)
           at Pulumi.GrpcEngine..ctor(String engine)
           at Pulumi.Deployment..ctor()
           at Pulumi.Deployment.<>c__102`1.<RunAsync>b__102_0()
           at Pulumi.Deployment.CreateRunnerAndRunAsync(Func`1 deploymentFactory, Func`2 runAsync)
           at Program.<Main>$(String[] args) in /Users/tm/git/pronghorn/Programs/OperatingEnvironment/Program.cs:line 9
           at Program.<Main>(String[] args)
     
        error: an unhandled error occurred: Program exited with non-zero exit code: 134
    t
    • 2
    • 4
  • h

    high-france-81657

    08/09/2022, 3:53 PM
    Hi! Has anyone used OutputUtilities.CreateUnknown lately? It seems to hang my pulumi program.
    e
    t
    • 3
    • 22
  • h

    high-france-81657

    08/09/2022, 3:53 PM
    (dotnet 6, windows, latest everything)
  • h

    high-france-81657

    08/09/2022, 4:02 PM
    Code:
    async Task<Output<string>> x()
            {
                return OutputUtilities.CreateUnknown("false");
            }
    
    output = Output.Create(x()).Apply(_ => _);
  • c

    clever-address-74879

    08/11/2022, 7:31 PM
    Hey #dotnet I'm trying to do something like this
    var resourceGroup = ResourceGroup.Get(
            $"rg-{stackName}",
            $"/subscriptions/000-0000-0000-00000-0000/resourceGroups/rg-{stackName}");
    
        var managedEnvironment = await AzureNative.App.GetManagedEnvironment.InvokeAsync(new AzureNative.App.GetManagedEnvironmentArgs
        {
            ResourceGroupName = resourceGroup.Name,
            EnvironmentName = "AzureNative",
        });
    But the
    resourceGroup.Name
    reference doesn't work. I'm still not fully comfortable with these Output<T> types, and I'm not exactly sure how to get the string value out.
    b
    • 2
    • 17
  • c

    clever-address-74879

    08/11/2022, 7:36 PM
    #dotnet another question! When I do this:
    var resourceGroupName = sharedStack.GetOutput("resourceGroupName");
    I get a Output<object?>. How do I get a string value out? Any convenient methods to help here?
    w
    • 2
    • 1
  • r

    ripe-russia-4239

    08/18/2022, 9:38 AM
    Hi all, I need to run some SQL Server sprocs during my deployment, to enable/disable certain features. I'm looking for a flag equivalent to
    IsPreview
    but to indicate whether the deployment is an
    up
    or a
    destroy
    . I've not found anything yet, which leads me to believe I'm going about this the wrong way. Any advice on a better approach?
    w
    • 2
    • 2
  • b

    bored-bear-61303

    08/18/2022, 2:21 PM
    Hello. We were running 3 types of container in an Azure Container App. We want to scale only one of these and understand that's not possible so have moved the one we want to scale into it own app and deploying 2 apps together. Now communication is broken between the containers. Is there an example we can see where more than one container app is deployed and VNet is added to the Azure Container Environment please?
    b
    • 2
    • 3
  • e

    enough-ability-9030

    08/18/2022, 9:51 PM
    How do you use an output to say write it to file? I’m getting a string back and I need to write it to a file and use it elsewhere.
    b
    • 2
    • 3
  • e

    enough-ability-9030

    08/18/2022, 9:51 PM
    I’d much rather just do it in one fell swoop rather than run pulumi then run another thing
  • c

    chilly-analyst-14900

    08/22/2022, 12:23 PM
    stderr: error: failed to discover plugin requirements: unexpected output from 'dotnet list package --include-transitive'. Program does not appear to reference any 'Pulumi.*' packages
    Any idea what this really means (GitHub action output)? Bare bones Pulumi csproj.
    e
    b
    • 3
    • 11
  • v

    victorious-ghost-35676

    08/22/2022, 7:31 PM
    How would I go about getting a pulumi
    Output
    that is point to a
    InputList
    something like this.
    [Output("UserIds")]
    public Output<string> UserIds { get; private set; } 
    
    var userIds = new InputList<string>();
    
    UserIds = userIds
    b
    • 2
    • 5
  • v

    victorious-ghost-35676

    08/23/2022, 5:55 PM
    How would I go from an output --> input? I am getting a stack reference, and trying to pass that into a as a value.
    b
    • 2
    • 10
  • g

    glamorous-waitress-51149

    08/24/2022, 10:58 AM
    this is similar to my issue. is there a way to add to a container app’s env vars the url of the container app that is being created? You can get the url like so
    Url      = Output.Format($"https://{app.Configuration.Apply(x => x!.Ingress).Apply(x => x!.Fqdn)}");
    but obviously it’s cyclic dependency issue, you’re trying to add the url to the envvars but the url doesn’t exist yet
    e
    f
    • 3
    • 6
  • f

    faint-mouse-9657

    08/30/2022, 9:21 PM
    I'm having difficulties assigning the Managed Identity to the Web App. I keep getting the following error
    Code="InvalidRequestContent" Message="The request content was invalid and could not be deserialized: 'Error converting value \"/subscriptions/0b538061-fbd8-4498-98a5-b7fe568605a6/resourcegroups/wealthbuildapp-dev-westus/providers/Microsoft.ManagedIdentity/userAssignedIdentities/dev-wealthbuildapiappmanagedidentity\" to type 'Microsoft.WindowsAzure.Governance.PolicyService.Models.Policy.UserAssignedResourceIdentity'. Path 'identity.userAssignedIdentities['/subscriptions/0b538061-fbd8-4498-98a5-b7fe568605a6/resourceGroups/wealthbuildapp-dev-westus/providers/Microsoft.ManagedIdentity/userAssignedIdentities/dev-wealthbuildapiappmanagedidentity']'.'."
    I'm not sure what to make off that. I was sure that I have the correct key value being supplied. I have done a few implementations but this is my most recent attempt.
    public Output<Pulumi.AzureNative.Web.WebApp> WealthBuildAPIServicePlan(
                Pulumi.AzureNative.Resources.ResourceGroup resourceGroup,
                Pulumi.AzureNative.Web.AppServicePlan appServicePlan,
                Pulumi.AzureNative.Sql.Server server,
                Pulumi.AzureNative.Sql.Database database,
                Pulumi.AzureNative.ManagedIdentity.UserAssignedIdentity managedIdentity)
            {
                string resourceName = $"{config.EnviromentAbbreviatedLowerCaseName()}-{config.WealthBuildAppAPIName()}";
                string serverFarmId = $"/subscriptions/{config.WealthBuildAzureSubsctriptionId()}/resourceGroups/{config.WealthBuildAppResourceGroupName()}-{config.EnviromentAbbreviatedLowerCaseName()}-{config.LocationWestUS()}/providers/Microsoft.Web/serverFarms/{config.EnviromentAbbreviatedLowerCaseName()}-{config.WealthBuildAppAPIServerName()}";
                Output<string> connectionString = Output.Tuple(server.Name, database.Name, config.WealthBuildAzureSqlServerPassword()).Apply(cs => $"Server=tcp:{cs.Item1}.<http://database.windows.net|database.windows.net>,1433;Initial Catalog={cs.Item2};Persist Security Info=False;User ID={config.WealthBuildAzueSqlServerAdminName()};Password={cs.Item3};MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;");
                Output<string> userAssignedIdentiy = Output.Tuple(resourceGroup.Name, managedIdentity.Name).Apply(uai => $"/subscriptions/{config.WealthBuildAzureSubsctriptionId()}/resourceGroups/{uai.Item1}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{uai.Item2}");
                Output<Pulumi.AzureNative.Web.WebApp> output = Output.Tuple(connectionString, userAssignedIdentiy).Apply(ouputString =>
                new Pulumi.AzureNative.Web.WebApp(
                    resourceName,
                    new WebAppArgs()
                    {
                        Name = resourceName,
                        HttpsOnly = true,
                        Kind = "api-app",
                        Location = resourceGroup.Location,
                        ResourceGroupName = resourceGroup.Name,
                        ServerFarmId = serverFarmId,
                        Identity = new ManagedServiceIdentityArgs()
                        {
                            Type = ManagedServiceIdentityType.UserAssigned,
                            UserAssignedIdentities =
                            {
                                { ouputString.Item2, managedIdentity.Id }
                            }
                        },
                        KeyVaultReferenceIdentity = managedIdentity.Id,
                        SiteConfig = new SiteConfigArgs()
                        {
                            //AcrUserManagedIdentityID = managedIdentity.Id,
                            AppSettings = new InputList<NameValuePairArgs>()
                            {
                                new NameValuePairArgs()
                                {
                                    Name = "ASPNETCORE_ENVIRONMENT",
                                    Value = config.EnviromentName()
                                }
                            },
                            ConnectionStrings = new InputList<ConnStringInfoArgs>()
                            {
                                new ConnStringInfoArgs()
                                {
                                    Name = "AzureSqlServer",
                                    ConnectionString = ouputString.Item1,
                                    Type = ConnectionStringType.SQLAzure
                                }
                            },
                            AppCommandLine = "dotnet WebApi.dll"
                        }
                    },
                    new CustomResourceOptions()
                    {
                        DependsOn = new InputList<Resource>()
                        {
                            appServicePlan,
                            server,
                            database,
                            managedIdentity
                        }
                    })
                );
    
                Console.WriteLine($"Created API Web App: {config.WealthBuildAppAPIName()}");
                return output;
            }
    b
    • 2
    • 3
  • v

    victorious-ghost-35676

    08/31/2022, 5:16 PM
    What is the easiest way to find the name of a Metric? trying to use this https://www.pulumi.com/registry/packages/azure-native/api-docs/insights/metricalert/#create-or-update-an-alert-rule-for-single-resource Not sure if this is as easy as just looking at the azure metric page
    • 1
    • 1
  • v

    victorious-ghost-35676

    09/01/2022, 5:45 PM
    When trying to run one of the exampled here https://www.pulumi.com/registry/packages/azure-native/api-docs/insights/metricalert/#metricalertmultipleresourcemultiplemetriccriteria I am not able to get the
    Criteria
    to line up correctly
    • 1
    • 2
  • a

    ancient-solstice-53934

    09/12/2022, 7:36 AM
    Hi, I am creating an azure container app with Pulumi native v1.66. My container app in azure 'subscription1' and azure container registry is in 'subscription2'. I am trying to add Registry when creating container app but it throws error ERROR: The resource with name 'testacr' and type 'Microsoft.ContainerRegistry/registries' could not be found in subscription 'subscription1'. var containerApp= new ContainerApp(appName, new ContainerAppArgs { Configuration = new ConfigurationArgs { Dapr = new DaprArgs { AppPort = 80, AppProtocol = "http", Enabled = true, }, Ingress = new IngressArgs { External = false, TargetPort = 80 }, Secrets = new InputList<SecretArgs> { new SecretArgs { Name = "registry-password", Value = "testpassword"} }, Registries = new InputList<RegistryCredentialsArgs> // From other subscription { new RegistryCredentialsArgs { Server ="testacr.azurecr.io", Username = "testacr", PasswordSecretRef = "registry-password" } } } }
  • b

    better-agent-38563

    09/16/2022, 7:27 PM
    I am new to Pulumi. I'm using C# to create an app service. In that app service, I'd like the stack to show up as .NET with version 6.0 (e.g. in portal under Configuration/General Settings/Stack Settings/Stack). I have NetFrameworkVersion to "v6.0" on the SiteConfig property of the app. There is no reference in the C# code that I can find to "stack". When I publish the app service, the Stack value in the configuration shows up as blank. So, is there a way to make it show up as .NET as it does in app services I've created manually? And more generally, is there a process I can follow to answer this kind of question, or do I need to just spam the Slack channel every time I have a question?
    i
    m
    • 3
    • 4
Powered by Linen
Title
b

better-agent-38563

09/16/2022, 7:27 PM
I am new to Pulumi. I'm using C# to create an app service. In that app service, I'd like the stack to show up as .NET with version 6.0 (e.g. in portal under Configuration/General Settings/Stack Settings/Stack). I have NetFrameworkVersion to "v6.0" on the SiteConfig property of the app. There is no reference in the C# code that I can find to "stack". When I publish the app service, the Stack value in the configuration shows up as blank. So, is there a way to make it show up as .NET as it does in app services I've created manually? And more generally, is there a process I can follow to answer this kind of question, or do I need to just spam the Slack channel every time I have a question?
i

icy-doctor-13719

09/16/2022, 7:31 PM
For .NET x64, in SiteConfigArgs I use:
NetFrameworkVersion = "6",
Use32BitWorkerProcess = false,
✅ 1
✅ 1
b

better-agent-38563

09/16/2022, 8:12 PM
That answers another question I had. Setting the framework version to 6 instead of v6.0 fixes the stack problem. When I try to set the Use32BitWorkerProcess to false, it fails, but upon reflection I think that's because I'm using a free service plan which supports only 32 bit app services. Thanks!
🎉 1
m

mammoth-agency-10350

10/10/2022, 5:48 PM
is there a process I can follow to answer this kind of question
I've been having a lot of success in property value "discovery" using the import resource operation https://www.pulumi.com/docs/guides/adopting/import/ 1. Create an app with the desired configuration in the portal. 2. Declare an app via pulumi with the
ImportId
to what is in (1). 3. Use the "details" view (
pulumi up
) to see diffs, which are very helpful for what properties and values need configuring in (2).
View count: 3