anyone seen this behavior? ```failed creating cont...
# azure
f
anyone seen this behavior?
Copy code
failed creating container: containers.Client#Create: Failure sending request: StatusCode=409 -- Original Error: autorest/azure: Service returned an error. Status=<nil> Code="PublicAccessNotPermitted" Message="Public access is not permitted on this storage account.
very easy to replicate: 1. create storage account with no public blob access;
pulumi up
2. alter the code to update storage account with public blob access and create a container;
pulumi up
t
Is the update to storage account completing before the container is created? Code sample?
f
i'll have to trim it down, its in our production code files, i'll get a sample here soon
First this:
Copy code
import * as azure from "@pulumi/azure";

const resourceGroup = new azure.core.ResourceGroup("resourceGroup", {
    location: 'Central US'
});

const storageAccount = new azure.storage.Account("storageAccount", {
    resourceGroupName: resourceGroup.name,
    accountTier: "Standard",
    accountReplicationType: "LRS",
    allowBlobPublicAccess: false
});
then after it's provisioned, update it to this: update storage account to allow public blob access and create a new container.
Copy code
import * as azure from "@pulumi/azure";

const resourceGroup = new azure.core.ResourceGroup("resourceGroup", {
    location: 'Central US'
});

const storageAccount = new azure.storage.Account("storageAccount", {
    resourceGroupName: resourceGroup.name,
    accountTier: "Standard",
    accountReplicationType: "LRS",
    allowBlobPublicAccess: true
});

new azure.storage.Container('container', {
  name: 'my-container',
  storageAccountName: storageAccount.name,
  containerAccessType: 'blob'
})
should get this error:
Copy code
azure:storage:Container (container):
    error: failed creating container: containers.Client#Create: Failure sending request: StatusCode=409 -- Original Error: autorest/azure: Service returned an error. Status=<nil> Code="PublicAccessNotPermitted" Message="Public access is not permitted on this storage account.\nRequestId:11415c7e-101e-0069-5ab7-002aaa000000\nTime:2021-02-11T20:49:28.8736873Z"
but if you modify the storage account to allow public blob access for one
pulumi up
and then update it again with the new container with a different
pulumi up
that will work, or you can just run
pulumi up
twice with the existing code and it will create the container.
t
I couldn't get this to repro using the above stacks. (NOTE: 'storageAccount' is not a valid name, so I used 'storageaccount'.)
f
not sure what to say, that's the exact code that i used to reproduce the error, word for word.
t
Are you still seeing it repro? Can you post the project?