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
azure
  • n

    nice-guitar-97142

    03/05/2021, 2:47 PM
    is there a mapping of the old
    @pulimi/azure
    to
    @pulumi/auzre-nextgen
    somewhere? I am trying to figure out how to get something similar to the
    @pulumi/azure/storage/account.primaryConnectionString
    while using the
    @pulumi/azure-nexgen
    provider
    t
    • 2
    • 3
  • w

    worried-knife-31967

    03/05/2021, 4:16 PM
    Hi All... Has anyone got a pattern for creating function keys for azure functions? It doesn't seem there is a resource for it?
    t
    • 2
    • 5
  • l

    little-orange-65618

    03/05/2021, 6:26 PM
    In azure-native (python) I don't see anything to create encryption_scopes (similar to azure.storage.EncryptionScope) but still see the ability to use one in Blob Container. Did that get moved somewhere?
    t
    • 2
    • 2
  • w

    worried-knife-31967

    03/06/2021, 6:42 PM
    If anyone is trying to us stack references with an Azure blob storage backend, I did this recently... https://twitter.com/MartinDotNet/status/1367601480878981121
  • n

    numerous-artist-1705

    03/07/2021, 9:14 AM
    hi all, I just published the Pulumi.FSharp.Extensions for the new AzureNative provider https://www.nuget.org/packages/Pulumi.FSharp.AzureNative/0.7.1.1
    🙌 1
  • p

    powerful-football-81694

    03/07/2021, 10:58 PM
    Hey guys, I’m almost there now with our migration to AzureNative. Just struggling to migrate our TemplateDeployment stuff, it seems Pulumi no longer likes it when we supply parameters with an anonymous object, like so:
    return new DeploymentArgs()
    {
    	DeploymentName = "hostname-binding-template",
    	ResourceGroupName = resourceGroupName,
    	Location = location,
    	Properties = new DeploymentPropertiesArgs()
    	{
    		Mode = DeploymentMode.Incremental,
    		Parameters = new
    		{
    			webAppName = webAppName,
    			hostname = hostname,
    			sslState = sslState.ToString(),
    			thumbprint = thumbprint
    		},
    		Template = templateJson
    	}
    };
    This gets us an exception when running
    pulumi up
    :
    System.InvalidOperationException: <>f__AnonymousType0`4[[Pulumi.Input`1[[System.String, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], Pulumi, Version=2.21.2.0, Culture=neutral, PublicKeyToken=null],[Pulumi.Input`1[[System.String, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], Pulumi, Version=2.21.2.0, Culture=neutral, PublicKeyToken=null],[System.String, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Pulumi.Input`1[[System.String, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], Pulumi, Version=2.21.2.0, Culture=neutral, PublicKeyToken=null]] is not a supported argument type.
    So I checked the XML docs for the
    Parameters
    property, which say:
    // Summary:
    //     Name and value pairs that define the deployment parameters for the template.
    //     You use this element when you want to provide the parameter values directly in
    //     the request rather than link to an existing parameter file. Use either the parametersLink
    //     property or the parameters property, but not both. It can be a JObject or a well
    //     formed JSON string.
    [Input("parameters", false, false)]
    public Input<object>? Parameters { get; set; }
    So I tried a JSON string instead, but then we get a different error:
    error: azure-native:resources:Deployment resource 'hostname-binding-template' has a problem: 'properties.parameters' should be of type '' but got a string
    Can someone tell me how I should pass the parameters now? With the old provider, the anonymous object approach worked fine. The C# examples here don’t give any hint - they are even incorrect C# syntax (value for the
    Parameters
    property is just missing from the code snippet: https://www.pulumi.com/docs/reference/pkg/azure-native/resources/deployment/
    t
    • 2
    • 30
  • f

    few-coat-22129

    03/08/2021, 1:59 AM
    Question on creating Firewall Rules: [using AzureNextGen] So I am aiming to turn on 'System assigned managed identity' for an App Service (Web API). I added a firewall rule to allow as follows:
    // SQLDB FIREWALL EXCEPTIONS
           Output<List<FirewallRule>>? list = app.OutboundIpAddresses.Apply(
                ips => ips.Split(",").Select(
                    ip => new FirewallRule($"{ip}", new FirewallRuleArgs
                    {
                        FirewallRuleName = SQLSVRFIREWALLRULENAME,
                        ResourceGroupName = resourceGroup.Name,
                        ServerName = DBSERVERNAME,
                        StartIpAddress = "0.0.0.0",
                        EndIpAddress = "0.0.0.0"
                    })
                ).ToList());
    It sort of works but i think it's adding in more rules than what I need due to the select statement. So my questions is: Am I going about this the right way? If so , how do I add a single Firewall Rule to implement System assigned MI?
    t
    • 2
    • 1
  • f

    full-winter-70537

    03/08/2021, 7:32 AM
    Hi, I am trying to add a stack reference, but keep encountering this error:
    registered twice (read and read)
    . Does anyone know how to fix this? Example code:
    var stackNames = new List<string> { "stack1", "stack2" };
                
                var backendPools = stackNames.Select(stack =>
                {
                    var stackRef = new StackReference($"{stack}ref", new StackReferenceArgs { Name = $"company/project/{stack}" });
    
                    var output1 = stackRef.RequireOutput("output1").Apply(_ => _.ToString());
                    var output2 = stackRef.RequireOutput("output2").Apply(_ => _.ToString());
    
                    return GetBackendPoolArgs(..);
                });
    t
    • 2
    • 7
  • f

    full-winter-70537

    03/08/2021, 10:26 AM
    Some feedback on creating Azure Frontdoor: • Frontdoor location has to be
    global
    , you can't set any other region such as
    westus
    in the examples • Unlike the examples, you can't reference the rules engine unless it already exists. Leave it empty and new up a separate one, using the name of the front door you're creating + make the RulesEngine
    DependsOn
    the Frontdoor Some requests: • Please get rid of all the circular referencing, this is very painful. I'm having to use convention-based names and I'd prefer to just use stack references. • I'd like the ability to new up the RuleEngine(s) when creating a front door, as it is technically a child resource • ^ Ditto for backends • Also inside
    ForwardingConfigurationArgs
    , why have a property that can only accept one value but make us set it? The comment on the
    odata
    property reads "Expected value is '#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration'.". Please either make it private or readonly.
    t
    • 2
    • 3
  • n

    nice-guitar-97142

    03/08/2021, 1:35 PM
    trying to add a blob to our storage account account that is xml. it’s really just a “starter” which our applications then pick up and add information to. that being said, I have converted to
    azure-native
    using the
    StringAsset
    and get the following exception :
    Error: Invalid asset encountered when unmarshaling resource property
  • n

    nice-guitar-97142

    03/08/2021, 1:37 PM
    am i missing something with the
    contentType
    property? does a
    StringAsset
    have to be an octet stream?
    t
    • 2
    • 6
  • w

    worried-knife-31967

    03/08/2021, 5:34 PM
    Is there an established way to update a tag for an appservice (function-app) once it's been created. That is, I want to create the function, but there is a resource (APIM api) that I need to update once I have the function endpoints, but I want to backfill the tags of the function with resource ID of the API.
  • w

    worried-knife-31967

    03/08/2021, 7:35 PM
    Also, what would be the process of returning a "mapped" output of properties for a given stack? I.e. if I'm wanting to have an APIM instance in 2 regions, and then reference the API in a specific region from another project/stack. I wanted to do something like
    Output.Create(new Dictionary<string, ApiManagementService>() { { "uksouth", apim }}.ToImmutableDictionary());
  • w

    worried-knife-31967

    03/08/2021, 7:37 PM
    however, I'm getting this...
  • w

    worried-knife-31967

    03/08/2021, 8:45 PM
    nm... I've managed to do it now
  • b

    broad-dog-22463

    03/08/2021, 9:10 PM
    would be interested in seeing this
  • w

    worried-knife-31967

    03/08/2021, 10:01 PM
    Really hacky... in the stack performing the output...
    protected readonly ImmutableDictionary<string, object>.Builder OutputBuilder = ImmutableDictionary.CreateBuilder<string, object>();
    
        OutputBuilder.Add(location, Output.Create(ImmutableDictionary.CreateBuilder<string, object>()
           .Append(new KeyValuePair<string, object>("GatewayUrl", apim.GatewayUrl))
           .Append(new KeyValuePair<string, object>("ResourceGroup", resourceGroup.Name))
           .Append(new KeyValuePair<string, object>("ServiceName", apim.Name))
           .ToImmutableDictionary()));
    then to consume it...
    public static class OutputExtensions
        {
            public static Output<string> RequireSubDictionaryOutput(this StackReference stackReference, string outputName, string mainKey, string subKey)
            {
                return stackReference.RequireOutput(outputName).Apply<string>(_ => {
                    var mainArray = (ImmutableDictionary<string, object>)((ImmutableDictionary<string, object>)_)[mainKey];
                    return mainArray[subKey]?.ToString() ?? "";
                });
            }
        }
    Then used:
    var apimResourceGroup = sharedStack.RequireSubDictionaryOutput("Gateways", location, "ResourceGroup");
                    var apimServiceName = sharedStack.RequireSubDictionaryOutput("Gateways", location, "ServiceName");
    Like I said... very hacky... The usecase is that the "shared" stack outputs multiple API-Management services, one for each region, then the service stacks need to add themselves to each of the regions. That requires them to know the RG and ServiceName of them.
  • w

    worried-knife-31967

    03/08/2021, 10:07 PM
    I'm now onto frontdoor. Which I'm not sure I'm going to be able to do using the resources from the Azure-Native api. Essentially, I need the same thing, but for a shared Frontdoor, then for the backend pools, and the backends within them. So Frontdoor is part of the "shared stack" but the backends are added by the services. A kind "delegated" ownership scenario. I'm thinking that I may need to resort to the Azure APIs using the approach that Mikhail showed.
  • w

    worried-knife-31967

    03/08/2021, 10:35 PM
    Is
    HealthProbeSettings
    supposed to be an object that can be setup with another resource? I can't seem to see where it exists
  • w

    worried-knife-31967

    03/08/2021, 10:45 PM
    ok, so I'm going to make the assumption that Azure Frontdoor on the AzureNative isn't usable, I can't seem to find anyway to create the subresources required to get healthprobe and loadbalancing strategy working. Perhaps this is something I'm going to have to revert to the previous API for?
    s
    • 2
    • 3
  • b

    broad-dog-22463

    03/08/2021, 10:46 PM
    @tall-librarian-49374 ☝️ (it's 2346 CET @worried-knife-31967 so Mikhail will more than likely not respond till tomorrow)
  • w

    worried-knife-31967

    03/08/2021, 10:57 PM
    no worries, I'm burning the midnight oil, no expectations
  • l

    limited-planet-95090

    03/08/2021, 11:52 PM
    Hey folks, I’m working on adding code examples to get to language parity across our top five code examples in AWS, Azure, Google Cloud, and Kubernetes. For Azure, these are the tutorials I’m adding examples for: Azure App Service Running Docker Containers on Linux (https://www.pulumi.com/docs/tutorials/azure/azure-cs-appservice-docker/) Deploy to Azure Container Instance (ACI) (https://www.pulumi.com/docs/tutorials/azure/container-webserver/) Azure Kubernetes Service (AKS) Cluster using the Native Provider (https://www.pulumi.com/docs/tutorials/azure/azure-py-aks/) Azure Kubernetes Service (AKS) Cluster and Helm Chart (https://github.com/pulumi/examples/tree/master/classic-azure-ts-aks-helm) Multiple Azure Kubernetes Service (AKS) Clusters (https://github.com/pulumi/examples/tree/master/classic-azure-py-aks-multicluster) Do these feel like the most important examples you’ve used or are there other examples from our examples repo that have been more helpful? Are there different examples you’d like to see? Thanks, Dave
  • f

    full-winter-70537

    03/09/2021, 3:45 AM
    Hi, does anyone know how to use the
    Any
    routing rule operator in Azure Frontdoor/Rules Engine? It complains about the
    RulesEngineMatchValue
    . If I don't supply a
    RulesEngineMatchValue
    , I get
    System.ArgumentNullException: [Input] Pulumi.AzureNative.Network.Inputs.RulesEngineMatchConditionArgs._rulesEngineMatchValue is required but was not given a value (Parameter '_rulesEngineMatchValue')
           at Pulumi.InputArgs.ToDictionaryAsync()
           at Pulumi.Serialization.Serializer.SerializeInputArgsAsync(String ctx, InputArgs args, Boolean keepResources)
           at Pulumi.Serialization.Serializer.SerializeAsync(String ctx, Object prop, Boolean keepResources)
           at Pulumi.Serialization.Serializer.SerializeListAsync(String ctx, IList list, Boolean keepResources)
           at Pulumi.Serialization.Serializer.SerializeAsync(String ctx, Object prop, Boolean keepResources)
           at Pulumi.Serialization.Serializer.SerializeAsync(String ctx, Object prop, Boolean keepResources)
           at Pulumi.Serialization.Serializer.SerializeAsync(String ctx, Object prop, Boolean keepResources)
           at Pulumi.Serialization.Serializer.SerializeDictionaryAsync(String ctx, IDictionary dictionary, Boolean keepResources)
           at Pulumi.Serialization.Serializer.SerializeInputArgsAsync(String ctx, InputArgs args, Boolean keepResources)
           at Pulumi.Serialization.Serializer.SerializeAsync(String ctx, Object prop, Boolean keepResources)
           at Pulumi.Serialization.Serializer.SerializeListAsync(String ctx, IList list, Boolean keepResources)
           at Pulumi.Serialization.Serializer.SerializeAsync(String ctx, Object prop, Boolean keepResources)
           at Pulumi.Serialization.Serializer.SerializeAsync(String ctx, Object prop, Boolean keepResources)
           at Pulumi.Serialization.Serializer.SerializeAsync(String ctx, Object prop, Boolean keepResources)
           at Pulumi.Deployment.SerializeFilteredPropertiesAsync(String label, IDictionary`2 args, Predicate`1 acceptKey, Boolean keepResources)
           at Pulumi.Deployment.PrepareResourceAsync(String label, Resource res, Boolean custom, ResourceArgs args, ResourceOptions options)
           at Pulumi.Deployment.RegisterResourceAsync(Resource resource, Boolean remote, Func`2 newDependency, ResourceArgs args, ResourceOptions options)
           at Pulumi.Deployment.ReadOrRegisterResourceAsync(Resource resource, Boolean remote, Func`2 newDependency, ResourceArgs args, ResourceOptions options)
           at Pulumi.Deployment.CompleteResourceAsync(Resource resource, Boolean remote, Func`2 newDependency, ResourceArgs args, ResourceOptions options, ImmutableDictionary`2 completionSources)
           at Pulumi.Deployment.Runner.<>c__DisplayClass9_0.<<WhileRunningAsync>g__HandleCompletion|0>d.MoveNext()
        --- End of stack trace from previous location where exception was thrown ---
           at Pulumi.Deployment.Runner.WhileRunningAsync()
    If I supply a value, I get
    Rules Engines validation failed. More information: Match value(s) must not be provided for Operator 'Any'.
    Damned if you do, damned if you don't!
    • 1
    • 1
  • w

    worried-knife-31967

    03/09/2021, 9:54 AM
    On the Frontdoor c# stuff, I've managed to use the old azure library in the same solution, which is pretty cool. There's still some nuances that mean that I don't think it's fully usable in a fully managed way, but I'll wait for some replies on the state of play before I comment further.
  • p

    powerful-football-81694

    03/09/2021, 2:32 PM
    Is there a way at the Pulumi layer to mark resources as protected against deletion? For example, we want to prevent Pulumi from automatically deleting our Cosmos DB account in production if some key properties have changed by mistake. I can think of a few ways to do this at the Azure layer (RBAC, locking, etc.) but I’m wondering if there’s also any mechanism for this in Pulumi.
    f
    • 2
    • 1
  • w

    worried-knife-31967

    03/09/2021, 2:33 PM
    it's part of the resource args at the end of the constructors
  • b

    brave-planet-10645

    03/09/2021, 2:34 PM
    https://www.pulumi.com/docs/intro/concepts/resources/#protect
  • b

    brave-planet-10645

    03/09/2021, 2:34 PM
    @powerful-football-81694 That's what you're looking for ^^
  • p

    powerful-football-81694

    03/09/2021, 2:35 PM
    Indeed - thanks guys! And to do this conditionally by stack, I guess the standard way is to add a stack config value?
    b
    • 2
    • 1
Powered by Linen
Title
p

powerful-football-81694

03/09/2021, 2:35 PM
Indeed - thanks guys! And to do this conditionally by stack, I guess the standard way is to add a stack config value?
b

brave-planet-10645

03/09/2021, 2:47 PM
Yes you can do that
🙏 1
View count: 4