Restrict Web App Access to selected IPV4 addresses

To secure your web app make sure you have setup HTTPS only and client certificate required.

To further restrict access, you can setup IP address-based rule.

To add an access restriction rule to your app, select Networking under settings and click on Configure Access Restrictions. On the Access Restrictions pane, select Add rule. After you add a rule, it becomes effective immediately.

Rules are enforced in priority order, starting from the lowest number in the Priority column. An implicit deny all is in effect after you add even a single rule.

On the Add Access Restriction pane, when you create a rule, do the following:

  1. Under Action, select either Allow or Deny.
  • Optionally, enter a name and description of the rule.
  • In the Priority box, enter a priority value.
  • In the Type drop-down list, select the type of rule.

The different types of rules are described in the following sections.

 Note

  • There is a limit of 512 access restriction rules. If you require more than 512 access restriction rules, we suggest that you consider installing a standalone security product, such as Azure Front Door, Azure App Gateway, or an alternative WAF.

Set an IP address-based rule

Follow the procedure as outlined in the preceding section, but with the following addition:

  • For step 4, in the Type drop-down list, select IPv4 or IPv6.

Specify the IP Address Block in Classless Inter-Domain Routing (CIDR) notation for both the IPv4 and IPv6 addresses. To specify an address, you can use something like 1.2.3.4/32, where the first four octets represent your IP address and /32 is the mask. The IPv4 CIDR notation for all addresses is 0.0.0.0/0. To learn more about CIDR notation, see Classless Inter-Domain Routing.

Azure DevOps required to deploy build to App Services and we need to allow these services for this use case. Microsoft has introduced an AzureDevOps service tag for it but as of this writing the tag is not working. The work around is to open app to selected geography where Azure DevOps is running. In my case, they are running in EASTUS. I am going to add this rule to allow Azure DevOps to works with Azure App Service;

This will open up App to the whole EastUS region but still is better than opening it up to the whole world.

As of this writing Azure DevOps Service tag is not supported for hosted agents. AzureDevOps tag does not cover Microsoft Hosted Agents IP range, which makes the use case for using it in Azure App Service limited. The only relevant use case is, if a custom web hook is hosted on App Services.

Azure DevOps IP address and domain URLs can be used and Azure Virtual machine scale set agents to shrink the possible IP range. Refer to following links for further info;

DevOps Inbound connections: Allowed address lists and network connections – Azure DevOps | Microsoft Docs

Scale set agents: Azure virtual machine scale set agents – Azure Pipelines | Microsoft Docs

SET AN IP ADDRESS-BASED RULE USING POWERSHELL

Add-AzWebAppAccessRestrictionRule -ResourceGroupName “appservice-rg” -WebAppName “simse” -Name IpRule -Priority 200 -Action Allow -IpAddress 100.15.181.143/32

Resource

https://docs.microsoft.com/en-us/azure/app-service/app-service-ip-restrictions

https://docs.microsoft.com/en-us/azure/app-service/app-service-ip-restrictions

Can I move an app resource from one region to another region?

I have created a resource group in East US2. I am going to move “app service plan” from “East US” to “East US2.

Great. The resource is moving.

The resource can be moved but its location (region) is retained.

This time I am going to move same resource from East US to East US2 (Region transfer).

If you click ok, you will see this message;

No use. One region resource cannot be moved to another region with Move option. What it means, that you have to create your resource group, app service plan, apps domain name, application insights in a separate region.

Follow this article from Microsoft to move your resources from one region to another.

https://docs.microsoft.com/en-us/azure/app-service/manage-move-across-regions

Azure App Service plan

Free plan are good if you don’t care about backup, auto-scaling, staging slots and storage.

As of this writing, these are Azure App service plan;

For less demanding workloads (Dev / Test)

For most production workloads (Production)

Other production tier options are here;

To scale up/down, go to Azure web application and select Scale up (App Service plan). The selected pricing tier will have a blue border around it. Change the lower pricing tier based on your requirements.

Once you have reached to a point where you will need more than 1GB of storage and RAM, then I think S1 production plan might be your starting point. This offers 10GB of storage, and all benefits that free tier does not provide.

The cost of S1 tier is 73.00 USD/Month.

Reference

https://azure.microsoft.com/en-us/pricing/details/app-service/windows/

https://azure.microsoft.com/en-us/pricing/calculator/

Hosting multiple domains under one app service

I am looking at taking our product page gallery and hosting it under multiple domains but keeping it with one app service so it is easy to deploy updates across these multiple domains. The code for this site would handle the UI change based on the domain.

Would hosting a simple app service and just adding multiple CNAME records be the best option for this? How many CNAME records can you have for one app service and how many SSL certificates?

https://docs.microsoft.com/en-us/answers/questions/117338/hosting-multiple-domains-under-one-app-service.html

I understand how to add multiple domains to a web app. What if I have say 100+ other company domains that I want to reference to the same webapp. These companies would create their own subdomains to point to this website the example is.

https://discovery.company1.com
https://discovery.company2.com
https://discovery.company3.com
….

I would assume I would need to host a separate SSL for each company and connect each CNAME. I am more just concerned I would hit a block after so many of these added to the same web app or wondering if there is a better option I should use in Azure if anyone knows of.

Azure App service allows 500 Custom domains per app that will be over this limit.

Read about X.509 certificates