Score:0

Restricting access to storage account containing package blob for cloud service (extended support) deployment

in flag

I'm nearly done migrating our cloud service (classic) deployments to cloud service (extended support). I'm working now on updating deployment pipelines. My package blob is located in a storage account. I create a SAS for the blob and use an API call to management.azure.com to create/update the deployment, passing ARM template as the body of the request.

This works correctly as long as the storage account with the package blob has its network set to "allow access from all networks". I want to restrict this access. I set the allow access from:

  • specific IP addresses of our devops servers
  • our own IP addresses
  • private vnet/subnets for the cloud service

I also tick the "Allow Azure services on the trusted services list to access this storage account" checkbox.

Yet, API call fails with error message indicating access is not allowed to the blob. When I change the storage account network configuration to "allow access from all networks", everything works correctly.

With lots of searches, I found only one hit explaining the same problem - https://github.com/Azure/azure-powershell/issues/20299 - yet no solution has been suggested other than allowing access from all networks.

I must be missing some trick - but what is it? How can I restrict access to the storage account?

Score:0
ng flag

There are two things you can look at here:

  1. Using the private IP's of your cloud service vNet won't work as the storage account only see's the public IP. By default your outbound public IP will be randomly assigned, but you can make this static by attaching a Nat Gateway to the vNet and then allowing the public IP of that gateway to storage firewall.

  2. Alternatively you could also use a Private Endpoint to join the storage account to your vNet, this would then mean that the cloud service would access it over a private IP and would be allowed through the firewall. This might be the simplest and cheapest option.

in flag
Thanks for the answer. Yet, I think the issue is different. I don't have the cloud service yet - I'm trying to create one using API. The access that doesn't work is from azure deployment "something" (service? framework? api?) to the storage account containing the blob for the deployment package.
ng flag
If the ARM fabric needs to access the storage account at deploy time then you have no option other than leaving the storage account open to any network. It is not possible to have an ARM deployment access files over a private network, and it is not a trusted service.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.