https://pulumi.com logo
#azure
Title
# azure
f

fancy-umbrella-67692

02/10/2021, 9:44 PM
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

tall-needle-56640

02/10/2021, 10:31 PM
Is the update to storage account completing before the container is created? Code sample?
f

fancy-umbrella-67692

02/11/2021, 2:27 PM
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

tall-needle-56640

02/12/2021, 3:28 PM
I couldn't get this to repro using the above stacks. (NOTE: 'storageAccount' is not a valid name, so I used 'storageaccount'.)
f

fancy-umbrella-67692

02/18/2021, 1:26 PM
not sure what to say, that's the exact code that i used to reproduce the error, word for word.
t

tall-needle-56640

02/18/2021, 8:13 PM
Are you still seeing it repro? Can you post the project?
5 Views