AzureIPNetworks 1.9.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package AzureIPNetworks --version 1.9.4                
NuGet\Install-Package AzureIPNetworks -Version 1.9.4                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AzureIPNetworks" Version="1.9.4" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AzureIPNetworks --version 1.9.4                
#r "nuget: AzureIPNetworks, 1.9.4"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install AzureIPNetworks as a Cake Addin
#addin nuget:?package=AzureIPNetworks&version=1.9.4

// Install AzureIPNetworks as a Cake Tool
#tool nuget:?package=AzureIPNetworks&version=1.9.4                

AzureIPNetworks

NuGet Nuget

Introduction

This library eases working with known Azure IP networks in dotnet. AzureCloudServiceTag provides the IP ranges for the entire cloud and is also broken out by region within that cloud. You cannot create your own service tag nor can you specify which IP addresses are included within a tag. Microsoft manages the address prefixes encompassed by the service tag, and automatically updates the service tag and their addresses as they change.

Service tags are stored in a JSON file which contains the IP address ranges for Public Azure as a whole, each Azure region within Public, and ranges for several Azure services such as EventHub, KeyVault, Storage, SQL, and TrafficManager in Public. The JSON file is downloaded from Microsoft's Website every so often from:

The library offers capabilities such as:

  • Listing IP addresses or IP networks used by the whole of Azure or filtered to a single service tag.
  • Checking if a given IP address or IP network belongs to Azure

The current version of the files can be found at files.json

You can also download the files from the remote URL once per application run using AzureIPsProvider.Remote.xxxx methods

Installation

Using the .NET Core command-line interface (CLI) tools:

dotnet add package AzureIPNetworks

Using the NuGet Command Line Interface (CLI):

nuget install AzureIPNetworks

Using the Package Manager Console:

Install-Package AzureIPNetworks

From within Visual Studio:

  1. Open the Solution Explorer.
  2. Right-click on a project within your solution.
  3. Click on Manage NuGet Packages...
  4. Click on the Browse tab and search for "AzureIPNetworks".
  5. Click on the AzureIPNetworks package, select the appropriate version in the right-tab and click Install.

Example 1 - Get all IP Networks (local)

var networks = await AzureIPsProvider.Local.GetNetworksAsync(AzureCloud.Public);
foreach (var net in networks)
{
    Console.WriteLine($"{net} ({range.FirstUsable} to {net.LastUsable})");
}

Example 2 - Check if an IP is used by Azure (local)

var ip = "30.0.0.20";
var used = await AzureIPsProvider.Local.IsAzureIpAsync(IPAddress.Parse(ip));
Console.WriteLine($"{ip} is {(used ? "" : "not")} used by any Azure service");

Example 3 - Get all IP Networks (remote)

var networks = await AzureIPsProvider.Remote.GetNetworksAsync(AzureCloud.Public);
foreach (var net in networks)
{
    Console.WriteLine($"{net} ({range.FirstUsable} to {net.LastUsable})");
}

Example 42 - Check if an IP is used by Azure (remote)

var ip = "30.0.0.20";
var used = await AzureIPsProvider.Remote.IsAzureIpAsync(IPAddress.Parse(ip));
Console.WriteLine($"{ip} is {(used ? "" : "not")} used by any Azure service");

Issues & Comments

Please leave all comments, bugs, requests, and issues on the Issues page. We'll respond to your request ASAP!

License

The Library is licensed under the MIT license. Refer to the LICENSE file for more information.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on AzureIPNetworks:

Package Downloads
Tingle.AspNetCore.Authorization

Convenience authorization functionality such as approval of IPs in AspNetCore

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.9.6 163 9/21/2024
1.9.5 199 9/12/2024
1.9.4 505 7/22/2024
1.9.3 371 6/24/2024
1.9.2 285 6/5/2024
1.9.1 209 5/23/2024
1.9.0 297 5/10/2024
1.8.0 321 5/5/2024
1.7.4 123 4/24/2024
1.7.3 118 3/21/2024
1.7.2 129 2/22/2024
1.7.1 123 2/17/2024
1.7.0 748 1/19/2024
1.6.0 997 11/15/2023
1.5.5 139 10/23/2023
1.5.4 304 9/21/2023
1.5.3 174 8/21/2023
1.5.2 166 7/21/2023
1.5.1 160 6/21/2023
1.5.0 1,487 5/30/2023
1.4.3 170 5/29/2023
1.4.2 319 4/17/2023
1.4.1 260 3/21/2023
1.4.0 915 3/13/2023
1.3.0 439 11/11/2022
1.2.0 5,468 12/3/2021
1.1.1 3,850 9/12/2021
1.1.0 1,237 6/23/2021
1.0.2 1,097 4/28/2021
1.0.1 1,727 1/18/2021
1.0.0 706 11/29/2020