Azure Blob Storage Deployment: Stored Access Policy gets deletedAzure Resource Manager microsoft.classicstorage/storageAccounts no registered resource providerAzure blobs - cannot display image store in blob container in MVC 4Azure Resource Manager Deployment vs Classic Deployment of Storage AccountsHas provisioning storage accounts through resource manager degraded in performance?Is it possible to choose in which container does an Azure classic Virtual Image is stored?With Azure blob storage, is a general level of privacy achievable with anonymous access?Use the Azure Cli to access Azure storage using a SASHow can I allow an Azure Logic app access to a secured blob storage accountHow to enable Azure CDN for Azure storage blob static website?

"You've called the wrong number" or "You called the wrong number"

A Paper Record is What I Hamper

How do I check if a string is entirely made of the same substring?

Size of electromagnet needed to replicate Earth's magnetic field

Which big number is bigger?

Should the Death Curse affect an undead PC in the Tomb of Annihilation adventure?

Pulling the rope with one hand is as heavy as with two hands?

Why does Mind Blank stop the Feeblemind spell?

Can an Area of Effect spell cast outside a Prismatic Wall extend inside it?

Providing evidence of Consent of Parents for Marriage by minor in England in early 1800s?

a sore throat vs a strep throat vs strep throat

Does a large simulator bay have standard public address announcements?

How to have a sharp product image?

Does tea made with boiling water cool faster than tea made with boiled (but still hot) water?

Is there a way to generate a list of distinct numbers such that no two subsets ever have an equal sum?

What is the most expensive material in the world that could be used to create Pun-Pun's lute?

Can I criticise the more senior developers around me for not writing clean code?

On The Origin of Dissonant Chords

Is Diceware more secure than a long passphrase?

Alignment of various blocks in tikz

How do I reattach a shelf to the wall when it ripped out of the wall?

Relationship between strut and baselineskip

How could Tony Stark make this in Endgame?

What is causing the white spot to appear in some of my pictures



Azure Blob Storage Deployment: Stored Access Policy gets deleted


Azure Resource Manager microsoft.classicstorage/storageAccounts no registered resource providerAzure blobs - cannot display image store in blob container in MVC 4Azure Resource Manager Deployment vs Classic Deployment of Storage AccountsHas provisioning storage accounts through resource manager degraded in performance?Is it possible to choose in which container does an Azure classic Virtual Image is stored?With Azure blob storage, is a general level of privacy achievable with anonymous access?Use the Azure Cli to access Azure storage using a SASHow can I allow an Azure Logic app access to a secured blob storage accountHow to enable Azure CDN for Azure storage blob static website?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















Context:



I deploy a storage account as well as one or more containers with the following ARM template with Azure DevOps respectively a Resource Deployment Task:




"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters":
"storageAccountName":
"type": "string",
"metadata":
"description": "The name of the Azure Storage account."

,
"containerNames":
"type": "array",
"metadata":
"description": "The names of the blob containers."

,
"location":
"type": "string",
"metadata":
"description": "The location in which the Azure Storage resources should be deployed."


,
"resources": [

"name": "[parameters('storageAccountName')]",
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2018-07-01",
"location": "[parameters('location')]",
"kind": "StorageV2",
"sku":
"name": "Standard_LRS",
"tier": "Standard"
,
"properties":
"accessTier": "Hot"

,

"name": "[concat(parameters('storageAccountName'), '/default/', parameters('containerNames')[copyIndex()])]",
"type": "Microsoft.Storage/storageAccounts/blobServices/containers",
"apiVersion": "2018-03-01-preview",
"dependsOn": [
"[parameters('storageAccountName')]"
],
"copy":
"name": "containercopy",
"count": "[length(parameters('containerNames'))]"


],
"outputs":
"storageAccountName":
"type": "string",
"value": "[parameters('storageAccountName')]"
,
"storageAccountKey":
"type": "string",
"value": "[listKeys(parameters('storageAccountName'), '2018-02-01').keys[0].value]"
,
"storageContainerNames":
"type": "array",
"value": "[parameters('containerNames')]"





Input can be e.g.



-storageAccountName 'stor1' -containerNames [ 'con1', 'con2' ] -location 'westeurope'


In an next step I create Stored Access Policies for the containers deployed.



Problem:



The first time I do that everything works fine. But if I execute the pipeline a second time the Stored Access Policies gets deleted by the deployment of the template. The storage account itself with its containers and blobs are not deleted (as it should be). This is unfortunate because I want to keep the Stored Access Policy with its starttime and expirytime as deployed the first time, furthermore I expect that the SAS also become invalid (not tested so far).



Questions:



Why is this happening?
How can I avoid this problem respectively keep the Stored Access Policies?



Thanks










share|improve this question




























    0















    Context:



    I deploy a storage account as well as one or more containers with the following ARM template with Azure DevOps respectively a Resource Deployment Task:




    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters":
    "storageAccountName":
    "type": "string",
    "metadata":
    "description": "The name of the Azure Storage account."

    ,
    "containerNames":
    "type": "array",
    "metadata":
    "description": "The names of the blob containers."

    ,
    "location":
    "type": "string",
    "metadata":
    "description": "The location in which the Azure Storage resources should be deployed."


    ,
    "resources": [

    "name": "[parameters('storageAccountName')]",
    "type": "Microsoft.Storage/storageAccounts",
    "apiVersion": "2018-07-01",
    "location": "[parameters('location')]",
    "kind": "StorageV2",
    "sku":
    "name": "Standard_LRS",
    "tier": "Standard"
    ,
    "properties":
    "accessTier": "Hot"

    ,

    "name": "[concat(parameters('storageAccountName'), '/default/', parameters('containerNames')[copyIndex()])]",
    "type": "Microsoft.Storage/storageAccounts/blobServices/containers",
    "apiVersion": "2018-03-01-preview",
    "dependsOn": [
    "[parameters('storageAccountName')]"
    ],
    "copy":
    "name": "containercopy",
    "count": "[length(parameters('containerNames'))]"


    ],
    "outputs":
    "storageAccountName":
    "type": "string",
    "value": "[parameters('storageAccountName')]"
    ,
    "storageAccountKey":
    "type": "string",
    "value": "[listKeys(parameters('storageAccountName'), '2018-02-01').keys[0].value]"
    ,
    "storageContainerNames":
    "type": "array",
    "value": "[parameters('containerNames')]"





    Input can be e.g.



    -storageAccountName 'stor1' -containerNames [ 'con1', 'con2' ] -location 'westeurope'


    In an next step I create Stored Access Policies for the containers deployed.



    Problem:



    The first time I do that everything works fine. But if I execute the pipeline a second time the Stored Access Policies gets deleted by the deployment of the template. The storage account itself with its containers and blobs are not deleted (as it should be). This is unfortunate because I want to keep the Stored Access Policy with its starttime and expirytime as deployed the first time, furthermore I expect that the SAS also become invalid (not tested so far).



    Questions:



    Why is this happening?
    How can I avoid this problem respectively keep the Stored Access Policies?



    Thanks










    share|improve this question
























      0












      0








      0








      Context:



      I deploy a storage account as well as one or more containers with the following ARM template with Azure DevOps respectively a Resource Deployment Task:




      "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
      "contentVersion": "1.0.0.0",
      "parameters":
      "storageAccountName":
      "type": "string",
      "metadata":
      "description": "The name of the Azure Storage account."

      ,
      "containerNames":
      "type": "array",
      "metadata":
      "description": "The names of the blob containers."

      ,
      "location":
      "type": "string",
      "metadata":
      "description": "The location in which the Azure Storage resources should be deployed."


      ,
      "resources": [

      "name": "[parameters('storageAccountName')]",
      "type": "Microsoft.Storage/storageAccounts",
      "apiVersion": "2018-07-01",
      "location": "[parameters('location')]",
      "kind": "StorageV2",
      "sku":
      "name": "Standard_LRS",
      "tier": "Standard"
      ,
      "properties":
      "accessTier": "Hot"

      ,

      "name": "[concat(parameters('storageAccountName'), '/default/', parameters('containerNames')[copyIndex()])]",
      "type": "Microsoft.Storage/storageAccounts/blobServices/containers",
      "apiVersion": "2018-03-01-preview",
      "dependsOn": [
      "[parameters('storageAccountName')]"
      ],
      "copy":
      "name": "containercopy",
      "count": "[length(parameters('containerNames'))]"


      ],
      "outputs":
      "storageAccountName":
      "type": "string",
      "value": "[parameters('storageAccountName')]"
      ,
      "storageAccountKey":
      "type": "string",
      "value": "[listKeys(parameters('storageAccountName'), '2018-02-01').keys[0].value]"
      ,
      "storageContainerNames":
      "type": "array",
      "value": "[parameters('containerNames')]"





      Input can be e.g.



      -storageAccountName 'stor1' -containerNames [ 'con1', 'con2' ] -location 'westeurope'


      In an next step I create Stored Access Policies for the containers deployed.



      Problem:



      The first time I do that everything works fine. But if I execute the pipeline a second time the Stored Access Policies gets deleted by the deployment of the template. The storage account itself with its containers and blobs are not deleted (as it should be). This is unfortunate because I want to keep the Stored Access Policy with its starttime and expirytime as deployed the first time, furthermore I expect that the SAS also become invalid (not tested so far).



      Questions:



      Why is this happening?
      How can I avoid this problem respectively keep the Stored Access Policies?



      Thanks










      share|improve this question














      Context:



      I deploy a storage account as well as one or more containers with the following ARM template with Azure DevOps respectively a Resource Deployment Task:




      "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
      "contentVersion": "1.0.0.0",
      "parameters":
      "storageAccountName":
      "type": "string",
      "metadata":
      "description": "The name of the Azure Storage account."

      ,
      "containerNames":
      "type": "array",
      "metadata":
      "description": "The names of the blob containers."

      ,
      "location":
      "type": "string",
      "metadata":
      "description": "The location in which the Azure Storage resources should be deployed."


      ,
      "resources": [

      "name": "[parameters('storageAccountName')]",
      "type": "Microsoft.Storage/storageAccounts",
      "apiVersion": "2018-07-01",
      "location": "[parameters('location')]",
      "kind": "StorageV2",
      "sku":
      "name": "Standard_LRS",
      "tier": "Standard"
      ,
      "properties":
      "accessTier": "Hot"

      ,

      "name": "[concat(parameters('storageAccountName'), '/default/', parameters('containerNames')[copyIndex()])]",
      "type": "Microsoft.Storage/storageAccounts/blobServices/containers",
      "apiVersion": "2018-03-01-preview",
      "dependsOn": [
      "[parameters('storageAccountName')]"
      ],
      "copy":
      "name": "containercopy",
      "count": "[length(parameters('containerNames'))]"


      ],
      "outputs":
      "storageAccountName":
      "type": "string",
      "value": "[parameters('storageAccountName')]"
      ,
      "storageAccountKey":
      "type": "string",
      "value": "[listKeys(parameters('storageAccountName'), '2018-02-01').keys[0].value]"
      ,
      "storageContainerNames":
      "type": "array",
      "value": "[parameters('containerNames')]"





      Input can be e.g.



      -storageAccountName 'stor1' -containerNames [ 'con1', 'con2' ] -location 'westeurope'


      In an next step I create Stored Access Policies for the containers deployed.



      Problem:



      The first time I do that everything works fine. But if I execute the pipeline a second time the Stored Access Policies gets deleted by the deployment of the template. The storage account itself with its containers and blobs are not deleted (as it should be). This is unfortunate because I want to keep the Stored Access Policy with its starttime and expirytime as deployed the first time, furthermore I expect that the SAS also become invalid (not tested so far).



      Questions:



      Why is this happening?
      How can I avoid this problem respectively keep the Stored Access Policies?



      Thanks







      azure-devops azure-storage azure-storage-blobs azure-resource-manager azure-pipelines-release-pipeline






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Oct 11 '18 at 5:48









      quervernetztquervernetzt

      1,1002618




      1,1002618






















          1 Answer
          1






          active

          oldest

          votes


















          0














          After doing some investigation this seems to be by design. When deploying ARM templates for storage accounts the PUT operation is used, i.e. elements that are not specified within the template are removed. As it is not possible to specify Shared Access Policies for containers within an ARM template for Storage Accounts existing ones get deleted when the template is redeployed...






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52753067%2fazure-blob-storage-deployment-stored-access-policy-gets-deleted%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            After doing some investigation this seems to be by design. When deploying ARM templates for storage accounts the PUT operation is used, i.e. elements that are not specified within the template are removed. As it is not possible to specify Shared Access Policies for containers within an ARM template for Storage Accounts existing ones get deleted when the template is redeployed...






            share|improve this answer



























              0














              After doing some investigation this seems to be by design. When deploying ARM templates for storage accounts the PUT operation is used, i.e. elements that are not specified within the template are removed. As it is not possible to specify Shared Access Policies for containers within an ARM template for Storage Accounts existing ones get deleted when the template is redeployed...






              share|improve this answer

























                0












                0








                0







                After doing some investigation this seems to be by design. When deploying ARM templates for storage accounts the PUT operation is used, i.e. elements that are not specified within the template are removed. As it is not possible to specify Shared Access Policies for containers within an ARM template for Storage Accounts existing ones get deleted when the template is redeployed...






                share|improve this answer













                After doing some investigation this seems to be by design. When deploying ARM templates for storage accounts the PUT operation is used, i.e. elements that are not specified within the template are removed. As it is not possible to specify Shared Access Policies for containers within an ARM template for Storage Accounts existing ones get deleted when the template is redeployed...







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 9 at 9:11









                quervernetztquervernetzt

                1,1002618




                1,1002618





























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52753067%2fazure-blob-storage-deployment-stored-access-policy-gets-deleted%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    1928 у кіно

                    Захаров Федір Захарович

                    Ель Греко