https://github.com/groovy-sky/azure-ip-ranges
Stores Azure DC IP addresses
https://github.com/groovy-sky/azure-ip-ranges
automation azure cloud github-actions ip microsoft microsoft-azure network public-data
Last synced: 6 months ago
JSON representation
Stores Azure DC IP addresses
- Host: GitHub
- URL: https://github.com/groovy-sky/azure-ip-ranges
- Owner: groovy-sky
- License: mit
- Created: 2022-02-08T20:15:43.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-03-22T03:06:53.000Z (about 2 years ago)
- Last Synced: 2024-03-22T04:24:38.838Z (about 2 years ago)
- Topics: automation, azure, cloud, github-actions, ip, microsoft, microsoft-azure, network, public-data
- Language: Python
- Homepage:
- Size: 8.1 MB
- Stars: 11
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Azure IP Ranges and Service Tags – Public Cloud
This repository obtains and stores (using Action) the current Azure's Datacenters public IP addresses. Results you can check [here](/ip).

## Why?
By default, Microsoft doesn't provide a posibility to obtain Azure DC IP anonymously. Instead, it suggest to use [Azure CLI/Powershell/REST](https://docs.microsoft.com/en-us/azure/virtual-network/service-tags-overview#service-tags-on-premises) to query Azure using an authorized account. **The main aim of this repository is** to show how with a minimum effort you can obtain and store all necessary configs/data in one place.
## How?
There is only [one workflow](/.github/workflows/main.yml) which do a few things:
1. Converts and stores SPN_KEY_BASE64 secret as a certificate (which is used for authentication).
2. Using the certificate logins to Azure CLI.
3. Executes [script.sh](/ip/script.sh), which get IPs and stores them in separate files locally.
4. Pushes changes to this repository.
## What?
The result of the workflow is a bunch of files with IP addresses. For easier search I also wrote a small Python script which can be used to search for a specific IP in all of these files. The script is located [here](/search.py). You can install it using the following command(you'll need to have Python and Linux OS/WSL installed):
```
curl -s https://raw.githubusercontent.com/groovy-sky/azure-ip-ranges/main/requirements.txt | xargs -n 1 pip install --user
alias azsearch='curl -s https://raw.githubusercontent.com/groovy-sky/azure-ip-ranges/main/search.py | python -' # Add this to your .bashrc or .zshrc
```
After that you can use it like this:
```
azsearch [IP_ADDRESS]
```
As a result you will get a list of files where the IP is located (or none if it's not found). Also works in Azure CLI:
