This message was deleted.
# azure
s
This message was deleted.
c
Maybe to use "depends"? As Pulumi will try to create multiple resource at same time.
r
Not sure I follow what do I set it to depends on?
c
Peter, can you share some code ? I will try to assist you
Sometimes we need to use depends on, to say some resource needs to wait another before it can be created.
r
Copy code
return new WebAppSlot($"webapp-slot-{index}", new WebAppSlotArgs
            {
                Slot = resourceSetting.Values["SlotName"],
                ResourceGroupName = _configOptions.ResourceGroupName,
                Location = _configOptions.Location,
                Name = webApp.Name,
                Kind = "app,linux,container",
                HttpsOnly = true,
                SiteConfig = new SiteConfigArgs
                {
                    AlwaysOn = true,
                    LinuxFxVersion = Output.Format($"DOCKER|{resourceSetting.Values["ImageName"]}"),
                    AcrUseManagedIdentityCreds = true,
                    WindowsFxVersion = null,
                    Http20Enabled = true,
                    MinTlsVersion = SupportedTlsVersions.SupportedTlsVersions_1_2,
                    IpSecurityRestrictions = new[]
                    {
                        new IpSecurityRestrictionArgs
                        {
                            Action = "Allow",
                            Name = "AllowApim",
                            VnetSubnetResourceId = apimSubnetId,
                            Priority = 100,
                        }
                    }
                },
                StorageAccountRequired = false,
                Identity = new ManagedServiceIdentityArgs
                {
                    Type = ManagedServiceIdentityType.SystemAssigned
                },
                VirtualNetworkSubnetId = subnetId,
            }, new CustomResourceOptions { Parent = parent });            
        }
This is the portion of code that creates the slot
The line
VirtualNetworkSubnetId = subnetId,
causes the issue
If I comment this out it runs fine
If I then uncomment it and run again it updates fine just won't do it first time around
This is there error I get error:
Code="Failed" Message="The async operation failed." AdditionalInfo=[{"Message":"An error has occurred."}]
Which isn't the most helpful of error messages
c
In that code, you create subnet also ?
if yes
r
no subnet already exists
c
if you create in your code, you can use name of resourse.id
r
no its managed outside
c
if is created in some other file, as you said
you can use whole path to that resourse
one sec to copy from my files
r
yes I'm aware of that, the subnetId is fine that's not the problem
c
containerRegistry: "/subscriptions/707xxxxxxxxxxxxxxxx936/resourceGroups/rg-xxxxxx-pulumi-comm/providers/Microsoft.ContainerRegistry/registries/xxxxxxxxxx04a6",
just change for your issue
that mean
r
I don't think you understand what the issue is
c
something like this
r
but thanks for trying
c
id: "/subscriptions/7xxxxxxxx6/resourceGroups/YourResourceGroup-dev/providers/Microsoft.Network/virtualNetworks/yourVNET/subnets/nameofsubnet",
r
Yes I know what format it needs to be in.
c
ok, in that case, if is not working for you, sorry, I will not be able to assist you, fingers crossed 🙂
r
no worries